Class PEMParser

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

    public class PEMParser
    extends org.bouncycastle.util.io.pem.PemReader
    Class for parsing OpenSSL PEM encoded streams containing X509 certificates, PKCS8 encoded keys and PKCS7 objects.

    In the case of PKCS7 objects the reader will return a CMS ContentInfo object. Public keys will be returned as well formed SubjectPublicKeyInfo objects, private keys will be returned as well formed PrivateKeyInfo objects. In the case of a private key a PEMKeyPair will normally be returned if the encoding contains both the private and public key definition. CRLs, Certificates, PKCS#10 requests, and Attribute Certificates will generate the appropriate BC holder class.

    • Field Summary

      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      PEMParser​(java.io.Reader reader)
      Create a new PEMReader
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object readObject()
      Read the next PEM object attempting to interpret the header and create a higher level object from the content.
      • Methods inherited from class org.bouncycastle.util.io.pem.PemReader

        readPemObject
      • 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

      • PEMParser

        public PEMParser​(java.io.Reader reader)
        Create a new PEMReader
        Parameters:
        reader - the Reader
    • Method Detail

      • readObject

        public java.lang.Object readObject()
                                    throws java.io.IOException
        Read the next PEM object attempting to interpret the header and create a higher level object from the content.
        Returns:
        the next object in the stream, null if no objects left.
        Throws:
        java.io.IOException - in case of a parse error.