Inheritance: RecipientInfoGenerator
コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
		}