상속: Asn1Encodable
예제 #1
0
        /**
        * Constructor for CRLEntries of indirect CRLs. If <code>isIndirect</code>
        * is <code>false</code> {@link #getCertificateIssuer()} will always
        * return <code>null</code>, <code>previousCertificateIssuer</code> is
        * ignored. If this <code>isIndirect</code> is specified and this CrlEntry
        * has no certificate issuer CRL entry extension
        * <code>previousCertificateIssuer</code> is returned by
        * {@link #getCertificateIssuer()}.
        *
        * @param c
        *            TbsCertificateList.CrlEntry object.
        * @param isIndirect
        *            <code>true</code> if the corresponding CRL is a indirect
        *            CRL.
        * @param previousCertificateIssuer
        *            Certificate issuer of the previous CrlEntry.
        */
        public X509CrlEntry(
			CrlEntry		c,
			bool			isIndirect,
			X509Name		previousCertificateIssuer)
        {
            this.c = c;
            this.isIndirect = isIndirect;
            this.previousCertificateIssuer = previousCertificateIssuer;
        }
 public CrlEntry[] GetRevokedCertificates()
 {
     if (this.revokedCertificates == null)
     {
         return(new CrlEntry[0]);
     }
     CrlEntry[] entryArray = new CrlEntry[this.revokedCertificates.Count];
     for (int i = 0; i < entryArray.Length; i++)
     {
         entryArray[i] = new CrlEntry(Asn1Sequence.GetInstance(this.revokedCertificates[i]));
     }
     return(entryArray);
 }
        internal TbsCertificateList(
            Asn1Sequence seq)
        {
            if (seq.Count < 3 || seq.Count > 7)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            int seqPos = 0;

            this.seq = seq;

            if (seq[seqPos] is DerInteger)
            {
                version = DerInteger.GetInstance(seq[seqPos++]);
            }
            else
            {
                version = new DerInteger(0);
            }

            signature  = AlgorithmIdentifier.GetInstance(seq[seqPos++]);
            issuer     = X509Name.GetInstance(seq[seqPos++]);
            thisUpdate = Time.GetInstance(seq[seqPos++]);

            if (seqPos < seq.Count &&
                (seq[seqPos] is DerUtcTime ||
                 seq[seqPos] is DerGeneralizedTime ||
                 seq[seqPos] is Time))
            {
                nextUpdate = Time.GetInstance(seq[seqPos++]);
            }

            if (seqPos < seq.Count &&
                !(seq[seqPos] is DerTaggedObject))
            {
                Asn1Sequence certs = Asn1Sequence.GetInstance(seq[seqPos++]);
                revokedCertificates = new CrlEntry[certs.Count];

                for (int i = 0; i < revokedCertificates.Length; i++)
                {
                    revokedCertificates[i] = new CrlEntry(Asn1Sequence.GetInstance(certs[i]));
                }
            }

            if (seqPos < seq.Count &&
                seq[seqPos] is DerTaggedObject)
            {
                crlExtensions = X509Extensions.GetInstance(seq[seqPos++]);
            }
        }
예제 #4
0
		public CrlEntry[] GetRevokedCertificates()
        {
			if (revokedCertificates == null)
			{
				return new CrlEntry[0];
			}

			CrlEntry[] entries = new CrlEntry[revokedCertificates.Count];

			for (int i = 0; i < entries.Length; i++)
			{
				entries[i] = new CrlEntry(Asn1Sequence.GetInstance(revokedCertificates[i]));
			}

			return entries;
		}
        public X509CrlEntry(
			CrlEntry c)
        {
            this.c = c;
            this.certificateIssuer = loadCertificateIssuer();
        }
예제 #6
0
        internal TbsCertificateList(
            Asn1Sequence seq)
        {
            if (seq.Count < 3 || seq.Count > 7)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            int seqPos = 0;

            this.seq = seq;

            if (seq[seqPos] is DerInteger)
            {
                version = DerInteger.GetInstance(seq[seqPos++]);
            }
            else
            {
                version = new DerInteger(0);
            }

            signature = AlgorithmIdentifier.GetInstance(seq[seqPos++]);
            issuer = X509Name.GetInstance(seq[seqPos++]);
            thisUpdate = Time.GetInstance(seq[seqPos++]);

            if (seqPos < seq.Count
                && (seq[seqPos] is DerUtcTime
                   || seq[seqPos] is DerGeneralizedTime
                   || seq[seqPos] is Time))
            {
                nextUpdate = Time.GetInstance(seq[seqPos++]);
            }

            if (seqPos < seq.Count
                && !(seq[seqPos] is DerTaggedObject))
            {
                Asn1Sequence certs = Asn1Sequence.GetInstance(seq[seqPos++]);
                revokedCertificates = new CrlEntry[certs.Count];

                for ( int i = 0; i < revokedCertificates.Length; i++)
                {
                    revokedCertificates[i] = new CrlEntry(Asn1Sequence.GetInstance(certs[i]));
                }
            }

            if (seqPos < seq.Count
                && seq[seqPos] is DerTaggedObject)
            {
                crlExtensions = X509Extensions.GetInstance(seq[seqPos++]);
            }
        }
예제 #7
0
        public X509CrlEntry(
			CrlEntry c)
        {
            this.c = c;
        }