Inheritance: RecipientInfoGenerator
        public void AddKekRecipient(string keyAlgorithm, KeyParameter key, KekIdentifier kekIdentifier)
        {
            KekRecipientInfoGenerator kekRecipientInfoGenerator = new KekRecipientInfoGenerator();

            kekRecipientInfoGenerator.KekIdentifier       = kekIdentifier;
            kekRecipientInfoGenerator.KeyEncryptionKeyOID = keyAlgorithm;
            kekRecipientInfoGenerator.KeyEncryptionKey    = key;
            recipientInfoGenerators.Add((object)kekRecipientInfoGenerator);
        }
        /**
         * add a KEK recipient.
         * @param key the secret key to use for wrapping
         * @param keyIdentifier the byte string that identifies the key
         */
        public void AddKekRecipient(
            string keyAlgorithm,                              // TODO Remove need for this parameter
            KeyParameter key,
            byte[]                  keyIdentifier)
        {
            KekRecipientInfoGenerator kekrig = new KekRecipientInfoGenerator();

            kekrig.KekIdentifier = new KekIdentifier(keyIdentifier, null, null);
            kekrig.WrapAlgorithm = keyAlgorithm;
            kekrig.WrapKey       = key;

            recipientInfoGenerators.Add(kekrig);
        }
        /**
         * add a KEK recipient.
         * @param key the secret key to use for wrapping
         * @param keyIdentifier the byte string that identifies the key
         */
        public void AddKekRecipient(
            string keyAlgorithm,                              // TODO Remove need for this parameter
            KeyParameter key,
            KekIdentifier kekIdentifier)
        {
            KekRecipientInfoGenerator kekrig = new KekRecipientInfoGenerator();

            kekrig.KekIdentifier       = kekIdentifier;
            kekrig.KeyEncryptionKeyOID = keyAlgorithm;
            kekrig.KeyEncryptionKey    = key;

            recipientInfoGenerators.Add(kekrig);
        }
Example #4
0
		/**
		* add a KEK recipient.
		* @param key the secret key to use for wrapping
		* @param keyIdentifier the byte string that identifies the key
		*/
		public void AddKekRecipient(
			string			keyAlgorithm, // TODO Remove need for this parameter
			KeyParameter	key,
			KekIdentifier	kekIdentifier)
		{
			KekRecipientInfoGenerator kekrig = new KekRecipientInfoGenerator();
			kekrig.KekIdentifier = kekIdentifier;
			kekrig.KeyEncryptionKeyOID = keyAlgorithm;
			kekrig.KeyEncryptionKey = key;

			recipientInfoGenerators.Add(kekrig);
		}