Inheritance: Asn1Encodable, IAsn1Choice
示例#1
0
        public SingleResponse(
            Asn1Sequence seq)
        {
            this.certID     = CertID.GetInstance(seq[0]);
            this.certStatus = CertStatus.GetInstance(seq[1]);
            this.thisUpdate = (DerGeneralizedTime)seq[2];

            if (seq.Count > 4)
            {
                this.nextUpdate = DerGeneralizedTime.GetInstance(
                    (Asn1TaggedObject)seq[3], true);
                this.singleExtensions = X509Extensions.GetInstance(
                    (Asn1TaggedObject)seq[4], true);
            }
            else if (seq.Count > 3)
            {
                Asn1TaggedObject o = (Asn1TaggedObject)seq[3];

                if (o.TagNo == 0)
                {
                    this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
                }
                else
                {
                    this.singleExtensions = X509Extensions.GetInstance(o, true);
                }
            }
        }
示例#2
0
		public SingleResponse(
            Asn1Sequence seq)
        {
            this.certID = CertID.GetInstance(seq[0]);
            this.certStatus = CertStatus.GetInstance(seq[1]);
            this.thisUpdate = (DerGeneralizedTime)seq[2];

			if (seq.Count > 4)
            {
                this.nextUpdate = DerGeneralizedTime.GetInstance(
					(Asn1TaggedObject) seq[3], true);
                this.singleExtensions = X509Extensions.GetInstance(
					(Asn1TaggedObject) seq[4], true);
            }
            else if (seq.Count > 3)
            {
                Asn1TaggedObject o = (Asn1TaggedObject) seq[3];

				if (o.TagNo == 0)
                {
                    this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
                }
                else
                {
                    this.singleExtensions = X509Extensions.GetInstance(o, true);
                }
            }
        }
			private ResponseObject(
				CertificateID		certId,
				CertificateStatus	certStatus,
				DerGeneralizedTime	thisUpdate,
				DerGeneralizedTime	nextUpdate,
				X509Extensions		extensions)
			{
				this.certId = certId;

				if (certStatus == null)
				{
					this.certStatus = new CertStatus();
				}
				else if (certStatus is UnknownStatus)
				{
					this.certStatus = new CertStatus(2, DerNull.Instance);
				}
				else
				{
					RevokedStatus rs = (RevokedStatus) certStatus;
					CrlReason revocationReason = rs.HasRevocationReason
						?	new CrlReason(rs.RevocationReason)
						:	null;

					this.certStatus = new CertStatus(
						new RevokedInfo(new DerGeneralizedTime(rs.RevocationTime), revocationReason));
				}

				this.thisUpdate = thisUpdate;
				this.nextUpdate = nextUpdate;

				this.extensions = extensions;
			}
示例#4
0
 public SingleResponse(CertID certID, CertStatus certStatus, DerGeneralizedTime thisUpdate, DerGeneralizedTime nextUpdate, X509Extensions singleExtensions)
 {
     this.certID           = certID;
     this.certStatus       = certStatus;
     this.thisUpdate       = thisUpdate;
     this.nextUpdate       = nextUpdate;
     this.singleExtensions = singleExtensions;
 }
示例#5
0
		public SingleResponse(
            CertID              certID,
            CertStatus          certStatus,
            DerGeneralizedTime  thisUpdate,
            DerGeneralizedTime  nextUpdate,
            X509Extensions      singleExtensions)
        {
            this.certID = certID;
            this.certStatus = certStatus;
            this.thisUpdate = thisUpdate;
            this.nextUpdate = nextUpdate;
            this.singleExtensions = singleExtensions;
        }
示例#6
0
 public SingleResponse(Asn1Sequence seq)
 {
     certID     = CertID.GetInstance(seq[0]);
     certStatus = CertStatus.GetInstance(seq[1]);
     thisUpdate = (DerGeneralizedTime)seq[2];
     if (seq.Count > 4)
     {
         nextUpdate       = DerGeneralizedTime.GetInstance((Asn1TaggedObject)seq[3], isExplicit: true);
         singleExtensions = X509Extensions.GetInstance((Asn1TaggedObject)seq[4], explicitly: true);
     }
     else if (seq.Count > 3)
     {
         Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)seq[3];
         if (asn1TaggedObject.TagNo == 0)
         {
             nextUpdate = DerGeneralizedTime.GetInstance(asn1TaggedObject, isExplicit: true);
         }
         else
         {
             singleExtensions = X509Extensions.GetInstance(asn1TaggedObject, explicitly: true);
         }
     }
 }