private static void ReadRecipientInfo(
            IList infos,
            RecipientInfo info,
            Stream contentStream,
            AlgorithmIdentifier encAlg,
            AlgorithmIdentifier macAlg,
            AlgorithmIdentifier authEncAlg)
        {
            Asn1Encodable recipInfo = info.Info;

            if (recipInfo is KeyTransRecipientInfo)
            {
                infos.Add(new KeyTransRecipientInformation(
                              (KeyTransRecipientInfo)recipInfo, encAlg, macAlg, authEncAlg, contentStream));
            }
            else if (recipInfo is KekRecipientInfo)
            {
                infos.Add(new KekRecipientInformation(
                              (KekRecipientInfo)recipInfo, encAlg, macAlg, authEncAlg, contentStream));
            }
            else if (recipInfo is KeyAgreeRecipientInfo)
            {
                KeyAgreeRecipientInformation.ReadRecipientInfo(infos,
                                                               (KeyAgreeRecipientInfo)recipInfo, encAlg, macAlg, authEncAlg, contentStream);
            }
            else if (recipInfo is PasswordRecipientInfo)
            {
                infos.Add(new PasswordRecipientInformation(
                              (PasswordRecipientInfo)recipInfo, encAlg, macAlg, authEncAlg, contentStream));
            }
        }
        private static void ReadRecipientInfo(global::System.Collections.IList infos, RecipientInfo info, CmsSecureReadable secureReadable)
        {
            Asn1Encodable info2 = info.Info;

            if (info2 is KeyTransRecipientInfo)
            {
                infos.Add((object)new KeyTransRecipientInformation((KeyTransRecipientInfo)info2, secureReadable));
            }
            else if (info2 is KekRecipientInfo)
            {
                infos.Add((object)new KekRecipientInformation((KekRecipientInfo)info2, secureReadable));
            }
            else if (info2 is KeyAgreeRecipientInfo)
            {
                KeyAgreeRecipientInformation.ReadRecipientInfo(infos, (KeyAgreeRecipientInfo)info2, secureReadable);
            }
            else if (info2 is PasswordRecipientInfo)
            {
                infos.Add((object)new PasswordRecipientInformation((PasswordRecipientInfo)info2, secureReadable));
            }
        }
        private static void ReadRecipientInfo(
            IList infos, RecipientInfo info, CmsSecureReadable secureReadable)
        {
            Asn1Encodable recipInfo = info.Info;

            if (recipInfo is KeyTransRecipientInfo)
            {
                infos.Add(new KeyTransRecipientInformation((KeyTransRecipientInfo)recipInfo, secureReadable));
            }
            else if (recipInfo is KekRecipientInfo)
            {
                infos.Add(new KekRecipientInformation((KekRecipientInfo)recipInfo, secureReadable));
            }
            else if (recipInfo is KeyAgreeRecipientInfo)
            {
                KeyAgreeRecipientInformation.ReadRecipientInfo(infos, (KeyAgreeRecipientInfo)recipInfo, secureReadable);
            }
            else if (recipInfo is PasswordRecipientInfo)
            {
                infos.Add(new PasswordRecipientInformation((PasswordRecipientInfo)recipInfo, secureReadable));
            }
        }
Esempio n. 4
0
        private static void ReadRecipientInfo(IList infos, RecipientInfo info, CmsSecureReadable secureReadable)
        {
            Asn1Encodable info2 = info.Info;

            if (info2 is KeyTransRecipientInfo)
            {
                infos.Add(new KeyTransRecipientInformation((KeyTransRecipientInfo)info2, secureReadable));
                return;
            }
            if (info2 is KekRecipientInfo)
            {
                infos.Add(new KekRecipientInformation((KekRecipientInfo)info2, secureReadable));
                return;
            }
            if (info2 is KeyAgreeRecipientInfo)
            {
                KeyAgreeRecipientInformation.ReadRecipientInfo(infos, (KeyAgreeRecipientInfo)info2, secureReadable);
                return;
            }
            if (info2 is PasswordRecipientInfo)
            {
                infos.Add(new PasswordRecipientInformation((PasswordRecipientInfo)info2, secureReadable));
            }
        }