Class CrlStreamParser


  • public class CrlStreamParser
    extends Asn1StreamParser
    Both BouncyCastle and JDK read the whole CRL during the initialization. The size of the consumed memory is linear to the size of CRL. This may cause that OutOfMemory error for large CRLs.

    This class implements a real stream based parser of CRL with constant memory consumption.

    Definition of CertificateList.

     CertificateList  ::=  SEQUENCE  {
           tbsCertList          TBSCertList,
           signatureAlgorithm   AlgorithmIdentifier,
           signatureValue       BIT STRING  }
    
      TBSCertList  ::=  SEQUENCE  {
           version                 Version OPTIONAL,
                                        -- if present, MUST be v2
           signature               AlgorithmIdentifier,
           issuer                  Name,
           thisUpdate              Time,
           nextUpdate              Time OPTIONAL,
           revokedCertificates     SEQUENCE OF SEQUENCE  {
                userCertificate         CertificateSerialNumber,
                revocationDate          Time,
                crlEntryExtensions      Extensions OPTIONAL
                                         -- if present, version MUST be v2
                                     }  OPTIONAL,
           crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
                                         -- if present, version MUST be v2
                                     }
     
    Author:
    Lijun Liao (xipki)
    • Method Detail

      • getVersion

        public int getVersion()
      • getIssuer

        public org.bouncycastle.asn1.x500.X500Name getIssuer()
      • getThisUpdate

        public Instant getThisUpdate()
      • getNextUpdate

        public Instant getNextUpdate()
      • getAlgorithmIdentifier

        public org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
      • getSignature

        public byte[] getSignature()
      • getBaseCrlNumber

        public BigInteger getBaseCrlNumber()
      • isDeltaCrl

        public boolean isDeltaCrl()
      • getCrlExtensions

        public org.bouncycastle.asn1.x509.Extensions getCrlExtensions()
      • verifySignature

        public boolean verifySignature​(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
                                throws IOException
        Throws:
        IOException