Class CachedPEMReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

    public class CachedPEMReader
    extends org.bouncycastle.openssl.PEMParser
    This class extends the PEMParser class from the BC library. It is modified to use the provided PemObject (it is done to optimize the code: pem is not read twice) as otherwise BC's parsers code would need to be copied. The reader is bootstraped with the data from the PemObject.

    This class interface is the readObject method.

    This implementation overrides the PEMParser readPemObject method to return a provided PemObject. The Reader used by the PEMParser is not used.

    Author:
    K. Benedyczak
    • Field Detail

      • pem

        protected org.bouncycastle.util.io.pem.PemObject pem
    • Constructor Detail

      • CachedPEMReader

        public CachedPEMReader​(org.bouncycastle.util.io.pem.PemObject pem)
    • Method Detail

      • readPemObject

        public org.bouncycastle.util.io.pem.PemObject readPemObject()
                                                             throws IOException
        Generate BC's PemObject from the input stream.
        Overrides:
        readPemObject in class org.bouncycastle.util.io.pem.PemReader
        Returns:
        the parsed PEM object
        Throws:
        IOException - IO exception