Пример #1
0
 public RevokedInfo(
     DERGeneralizedTime revocationTime,
     CRLReason revocationReason)
 {
     this.revocationTime   = revocationTime;
     this.revocationReason = revocationReason;
 }
Пример #2
0
        public KEKIdentifier(
            ASN1Sequence seq)
        {
            keyIdentifier = (ASN1OctetString)seq.getObjectAt(0);

            switch (seq.size())
            {
            case 1:
                break;

            case 2:
                if (seq.getObjectAt(1) is DERGeneralizedTime)
                {
                    date = (DERGeneralizedTime)seq.getObjectAt(1);
                }
                else
                {
                    other = OtherKeyAttribute.getInstance(seq.getObjectAt(2));
                }
                break;

            case 3:
                date  = (DERGeneralizedTime)seq.getObjectAt(1);
                other = OtherKeyAttribute.getInstance(seq.getObjectAt(2));
                break;

            default:
                throw new ArgumentException("Invalid KEKIdentifier");
            }
        }
Пример #3
0
        public SingleResponse(
            ASN1Sequence seq)
        {
            this.certID     = CertID.getInstance(seq.getObjectAt(0));
            this.certStatus = CertStatus.getInstance(seq.getObjectAt(1));
            this.thisUpdate = (DERGeneralizedTime)seq.getObjectAt(2);

            if (seq.size() > 4)
            {
                this.nextUpdate = DERGeneralizedTime.getInstance(
                    (ASN1TaggedObject)seq.getObjectAt(3), true);
                this.singleExtensions = X509Extensions.getInstance(
                    (ASN1TaggedObject)seq.getObjectAt(4), true);
            }
            else if (seq.size() > 3)
            {
                ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(3);

                if (o.getTagNo() == 0)
                {
                    this.nextUpdate = DERGeneralizedTime.getInstance(o, true);
                }
                else
                {
                    this.singleExtensions = X509Extensions.getInstance(o, true);
                }
            }
        }
Пример #4
0
 public AttCertValidityPeriod(
     DERGeneralizedTime notBeforeTime,
     DERGeneralizedTime notAfterTime)
 {
     this.notBeforeTime = notBeforeTime;
     this.notAfterTime  = notAfterTime;
 }
Пример #5
0
        public ResponseData(
            ASN1Sequence seq)
        {
            int index = 0;

            if (seq.getObjectAt(0) is ASN1TaggedObject)
            {
                ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(0);

                if (o.getTagNo() == 0)
                {
                    this.version = DERInteger.getInstance(
                        (ASN1TaggedObject)seq.getObjectAt(0), true);
                    index++;
                }
                else
                {
                    this.version = null;
                }
            }
            else
            {
                this.version = null;
            }

            this.responderID = ResponderID.getInstance(seq.getObjectAt(index++));
            this.producedAt  = (DERGeneralizedTime)seq.getObjectAt(index++);
            this.responses   = (ASN1Sequence)seq.getObjectAt(index++);

            if (seq.size() > index)
            {
                this.responseExtensions = X509Extensions.getInstance(
                    (ASN1TaggedObject)seq.getObjectAt(index), true);
            }
        }
Пример #6
0
        public CrlID(
            ASN1Sequence seq)
        {
            IEnumerator e = seq.getObjects();

            while (e.MoveNext())
            {
                ASN1TaggedObject o = (ASN1TaggedObject)e.Current;

                switch ((int)o.getTagNo())
                {
                case 0:
                    crlUrl = DERIA5String.getInstance(o, true);
                    break;

                case 1:
                    crlNum = DERInteger.getInstance(o, true);
                    break;

                case 2:
                    crlTime = DERGeneralizedTime.getInstance(o, true);
                    break;

                default:
                    throw new ArgumentException(
                              "unknown tag number: " + o.getTagNo());
                }
            }
        }
Пример #7
0
 public KEKIdentifier(
     byte[]              keyIdentifier,
     DERGeneralizedTime date,
     OtherKeyAttribute other)
 {
     this.keyIdentifier = new DEROctetString(keyIdentifier);
     this.date          = date;
     this.other         = other;
 }
Пример #8
0
 public RecipientKeyIdentifier(
     ASN1OctetString subjectKeyIdentifier,
     DERGeneralizedTime date,
     OtherKeyAttribute other)
 {
     this.subjectKeyIdentifier = subjectKeyIdentifier;
     this.date  = date;
     this.other = other;
 }
Пример #9
0
        public RevokedInfo(
            ASN1Sequence seq)
        {
            this.revocationTime = (DERGeneralizedTime)seq.getObjectAt(0);

            if (seq.size() > 1)
            {
                this.revocationReason = new CRLReason(DEREnumerated.getInstance(
                                                          (ASN1TaggedObject)seq.getObjectAt(1), true));
            }
        }
Пример #10
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;
 }
Пример #11
0
 public ResponseData(
     DERInteger version,
     ResponderID responderID,
     DERGeneralizedTime producedAt,
     ASN1Sequence responses,
     X509Extensions responseExtensions)
 {
     this.version            = version;
     this.responderID        = responderID;
     this.producedAt         = producedAt;
     this.responses          = responses;
     this.responseExtensions = responseExtensions;
 }
Пример #12
0
        public ResponseObject(CertificateID certId, CertificateStatus certStatus, DateTime thisUpdate, Object nextUpdate, X509Extensions extensions)
        {
            this.certId = certId;
            if (certStatus == null)
            {
                this.certStatus = new CertStatus();
            }
            else if (certStatus is UnknownStatus)
            {
                this.certStatus = new CertStatus(2, new DERNull());
            }
            else
            {
                RevokedStatus rs = (RevokedStatus)certStatus;

                if (rs.hasRevocationReason())
                {
                    this.certStatus = new CertStatus(
                        new RevokedInfo(new DERGeneralizedTime(rs.getRevocationTime()),
                                        new CRLReason(rs.getRevocationReason()))
                        );
                }
                else
                {
                    this.certStatus = new CertStatus(
                        new RevokedInfo(new DERGeneralizedTime(rs.getRevocationTime()), null));
                }
            }

            this.thisUpdate = new DERGeneralizedTime(thisUpdate);

            if (nextUpdate != null)
            {
                this.nextUpdate = new DERGeneralizedTime((DateTime)nextUpdate);
            }

            this.extensions = extensions;
        }
Пример #13
0
 public void setEndDate(
     DERGeneralizedTime endDate)
 {
     this.endDate = endDate;
 }
Пример #14
0
 public void setStartDate(
     DERGeneralizedTime startDate)
 {
     this.startDate = startDate;
 }
Пример #15
0
 public AttCertValidityPeriod(
     ASN1Sequence seq)
 {
     notBeforeTime = (DERGeneralizedTime)seq.getObjectAt(0);
     notAfterTime  = (DERGeneralizedTime)seq.getObjectAt(1);
 }