public void AddPasswordRecipient( CmsPbeKey pbeKey, string kekAlgorithmOid) { Pbkdf2Params p = new Pbkdf2Params(pbeKey.Salt, pbeKey.IterationCount); KeyParameter secretKey = pbeKey.GetEncoded(kekAlgorithmOid); recipientInfs.Add(new RecipientInf(kekAlgorithmOid, secretKey, new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, p))); }
public void AddPasswordRecipient(CmsPbeKey pbeKey, string kekAlgorithmOid) { Pbkdf2Params parameters = new Pbkdf2Params(pbeKey.Salt, pbeKey.IterationCount); PasswordRecipientInfoGenerator passwordRecipientInfoGenerator = new PasswordRecipientInfoGenerator(); passwordRecipientInfoGenerator.KeyDerivationAlgorithm = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, parameters); passwordRecipientInfoGenerator.KeyEncryptionKeyOID = kekAlgorithmOid; passwordRecipientInfoGenerator.KeyEncryptionKey = pbeKey.GetEncoded(kekAlgorithmOid); recipientInfoGenerators.Add((object)passwordRecipientInfoGenerator); }
public void AddPasswordRecipient( CmsPbeKey pbeKey, string kekAlgorithmOid) { Pbkdf2Params p = new Pbkdf2Params(pbeKey.Salt, pbeKey.IterationCount); PasswordRecipientInfoGenerator prig = new PasswordRecipientInfoGenerator(); prig.DerivationAlg = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, p); prig.WrapAlgorithm = kekAlgorithmOid; prig.WrapKey = pbeKey.GetEncoded(kekAlgorithmOid); recipientInfoGenerators.Add(prig); }
public void AddPasswordRecipient( CmsPbeKey pbeKey, string kekAlgorithmOid) { Pbkdf2Params p = new Pbkdf2Params(pbeKey.Salt, pbeKey.IterationCount); PasswordRecipientInfoGenerator prig = new PasswordRecipientInfoGenerator(); prig.KeyDerivationAlgorithm = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, p); prig.KeyEncryptionKeyOID = kekAlgorithmOid; prig.KeyEncryptionKey = pbeKey.GetEncoded(kekAlgorithmOid); recipientInfoGenerators.Add(prig); }