상속: Org.BouncyCastle.Asn1.Asn1Encodable, IAsn1Choice
예제 #1
0
        private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
            if (seq.Count < 7 || seq.Count > 9)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            this.version                = DerInteger.GetInstance(seq[0]);
            this.holder                 = Holder.GetInstance(seq[1]);
            this.issuer                 = AttCertIssuer.GetInstance(seq[2]);
            this.signature              = AlgorithmIdentifier.GetInstance(seq[3]);
            this.serialNumber           = DerInteger.GetInstance(seq[4]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
            this.attributes             = Asn1Sequence.GetInstance(seq[6]);

            for (int i = 7; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable)seq[i];

                if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
 private AttributeCertificateInfo(Asn1Sequence seq)
 {
     //IL_002e: Unknown result type (might be due to invalid IL or missing references)
     if (seq.Count < 7 || seq.Count > 9)
     {
         throw new ArgumentException(string.Concat((object)"Bad sequence size: ", (object)seq.Count));
     }
     version                = DerInteger.GetInstance(seq[0]);
     holder                 = Holder.GetInstance(seq[1]);
     issuer                 = AttCertIssuer.GetInstance(seq[2]);
     signature              = AlgorithmIdentifier.GetInstance(seq[3]);
     serialNumber           = DerInteger.GetInstance(seq[4]);
     attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
     attributes             = Asn1Sequence.GetInstance(seq[6]);
     for (int i = 7; i < seq.Count; i++)
     {
         Asn1Encodable asn1Encodable = seq[i];
         if (asn1Encodable is DerBitString)
         {
             issuerUniqueID = DerBitString.GetInstance(seq[i]);
         }
         else if (asn1Encodable is Asn1Sequence || asn1Encodable is X509Extensions)
         {
             extensions = X509Extensions.GetInstance(seq[i]);
         }
     }
 }
		private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
			if (seq.Count < 7 || seq.Count > 9)
			{
				throw new ArgumentException("Bad sequence size: " + seq.Count);
			}

			this.version = DerInteger.GetInstance(seq[0]);
            this.holder = Holder.GetInstance(seq[1]);
            this.issuer = AttCertIssuer.GetInstance(seq[2]);
            this.signature = AlgorithmIdentifier.GetInstance(seq[3]);
            this.serialNumber = DerInteger.GetInstance(seq[4]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
            this.attributes = Asn1Sequence.GetInstance(seq[6]);

			for (int i = 7; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable) seq[i];

				if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
        private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
            if (seq.Count < 6 || seq.Count > 9)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            int start;

            if (seq[0] is DerInteger)   // in version 1 certs version is DEFAULT  v1(0)
            {
                this.version = DerInteger.GetInstance(seq[0]);
                start        = 1;
            }
            else
            {
                this.version = new DerInteger(0);
                start        = 0;
            }

            this.holder                 = Holder.GetInstance(seq[start]);
            this.issuer                 = AttCertIssuer.GetInstance(seq[start + 1]);
            this.signature              = AlgorithmIdentifier.GetInstance(seq[start + 2]);
            this.serialNumber           = DerInteger.GetInstance(seq[start + 3]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[start + 4]);
            this.attributes             = Asn1Sequence.GetInstance(seq[start + 5]);

            for (int i = start + 6; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable)seq[i];

                if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
예제 #5
0
 public static AttCertIssuer GetInstance(Asn1TaggedObject obj, bool isExplicit)
 {
     return(AttCertIssuer.GetInstance(obj.GetObject()));
 }
		public void SetIssuer(
            AttCertIssuer issuer)
        {
            this.issuer = issuer;
        }
예제 #7
0
		/**
		 * Set the issuer directly with the ASN.1 structure.
		 *
		 * @param issuer The issuer
		 */
		public AttributeCertificateIssuer(
			AttCertIssuer issuer)
		{
			form = issuer.Issuer;
		}
 public void SetIssuer(
     AttCertIssuer issuer)
 {
     this.issuer = issuer;
 }
        /**
         * Set the issuer directly with the ASN.1 structure.
         *
         * @param issuer The issuer
         */
        internal AttributeCertificateIssuer(
			AttCertIssuer issuer)
        {
            form = issuer.Issuer;
        }