/**
         * add a recipient.
         *
         * @param cert recipient's public key certificate
         * @exception ArgumentException if there is a problem with the certificate
         */
        public void AddKeyTransRecipient(
            X509Certificate cert)
        {
            KeyTransRecipientInfoGenerator ktrig = new KeyTransRecipientInfoGenerator();

            ktrig.RecipientCert = cert;

            recipientInfoGenerators.Add(ktrig);
        }
        /**
         * add a recipient
         *
         * @param key the public key used by the recipient
         * @param subKeyId the identifier for the recipient's public key
         * @exception ArgumentException if there is a problem with the key
         */
        public void AddKeyTransRecipient(
            AsymmetricKeyParameter pubKey,
            byte[]                                  subKeyId)
        {
            KeyTransRecipientInfoGenerator ktrig = new KeyTransRecipientInfoGenerator();

            ktrig.RecipientPublicKey   = pubKey;
            ktrig.SubjectKeyIdentifier = new DerOctetString(subKeyId);

            recipientInfoGenerators.Add(ktrig);
        }