Org.BouncyCastle.Asn1.Cms.RecipientInfo.GetInstance C# (CSharp) Méthode

GetInstance() public static méthode

public static GetInstance ( object o ) : RecipientInfo
o object
Résultat RecipientInfo
		public static RecipientInfo GetInstance(
            object o)
        {
            if (o == null || o is RecipientInfo)
                return (RecipientInfo) o;

			if (o is Asn1Sequence)
                return new RecipientInfo((Asn1Sequence) o);

			if (o is Asn1TaggedObject)
                return new RecipientInfo((Asn1TaggedObject) o);

			throw new ArgumentException("unknown object in factory: " + o.GetType().Name);
        }

Usage Example

Exemple #1
0
        public EnvelopedData(
            OriginatorInfo originatorInfo,
            Asn1Set recipientInfos,
            EncryptedContentInfo encryptedContentInfo,
            Asn1Set unprotectedAttrs)
        {
            if (originatorInfo != null || unprotectedAttrs != null)
            {
                version = new DerInteger(2);
            }
            else
            {
                version = new DerInteger(0);

                foreach (object o in recipientInfos)
                {
                    RecipientInfo ri = RecipientInfo.GetInstance(o);

                    if (!ri.Version.Equals(version))
                    {
                        version = new DerInteger(2);
                        break;
                    }
                }
            }

            this.originatorInfo       = originatorInfo;
            this.recipientInfos       = recipientInfos;
            this.encryptedContentInfo = encryptedContentInfo;
            this.unprotectedAttrs     = unprotectedAttrs;
        }
All Usage Examples Of Org.BouncyCastle.Asn1.Cms.RecipientInfo::GetInstance