Class FlexiblePEMReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable

    public class FlexiblePEMReader
    extends org.bouncycastle.openssl.PEMParser
    Extends BC's PEMParser class so it can read correctly also PEM files with a garbage at the beginning and minor syntax violations which occur more then often in the wild. TODO - probably we can remove this class - BC seems to be fixed.
    Author:
    K. Benedyczak
    • Field Summary

      • Fields inherited from class org.bouncycastle.openssl.PEMParser

        parsers, TYPE_ATTRIBUTE_CERTIFICATE, TYPE_CERTIFICATE, TYPE_CERTIFICATE_REQUEST, TYPE_CMS, TYPE_DSA_PRIVATE_KEY, TYPE_EC_PARAMETERS, TYPE_EC_PRIVATE_KEY, TYPE_ENCRYPTED_PRIVATE_KEY, TYPE_NEW_CERTIFICATE_REQUEST, TYPE_PKCS7, TYPE_PRIVATE_KEY, TYPE_PUBLIC_KEY, TYPE_RSA_PRIVATE_KEY, TYPE_RSA_PUBLIC_KEY, TYPE_TRUSTED_CERTIFICATE, TYPE_X509_CERTIFICATE, TYPE_X509_CRL
      • Fields inherited from class java.io.Reader

        lock
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.util.io.pem.PemObject readPemObject()
      Generate BC's PemObject
      • Methods inherited from class org.bouncycastle.openssl.PEMParser

        getSupportedTypes, readObject
      • Methods inherited from class java.io.BufferedReader

        close, lines, mark, markSupported, read, read, readLine, ready, reset, skip
      • Methods inherited from class java.io.Reader

        nullReader, read, read, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlexiblePEMReader

        public FlexiblePEMReader​(java.io.Reader reader)
        Creates a new FlexiblePEMReader object.
        Parameters:
        reader - input source
    • Method Detail

      • readPemObject

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