Ejemplo n.º 1
0
        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);
        }
		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);
		}