Package org.bouncycastle.openssl
Class PEMParser
java.lang.Object
java.io.Reader
java.io.BufferedReader
org.bouncycastle.util.io.pem.PemReader
org.bouncycastle.openssl.PEMParser
- All Implemented Interfaces:
Closeable
,AutoCloseable
,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
Modifier and TypeFieldDescriptionprotected final Map
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.bouncycastle.util.io.pem.PemReader
LAX_PEM_PARSING_SYSTEM_PROPERTY_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRead 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
-
Field Details
-
TYPE_CERTIFICATE_REQUEST
- See Also:
-
TYPE_NEW_CERTIFICATE_REQUEST
- See Also:
-
TYPE_CERTIFICATE
- See Also:
-
TYPE_TRUSTED_CERTIFICATE
- See Also:
-
TYPE_X509_CERTIFICATE
- See Also:
-
TYPE_X509_CRL
- See Also:
-
TYPE_PKCS7
- See Also:
-
TYPE_CMS
- See Also:
-
TYPE_ATTRIBUTE_CERTIFICATE
- See Also:
-
TYPE_EC_PARAMETERS
- See Also:
-
TYPE_PUBLIC_KEY
- See Also:
-
TYPE_RSA_PUBLIC_KEY
- See Also:
-
TYPE_RSA_PRIVATE_KEY
- See Also:
-
TYPE_DSA_PRIVATE_KEY
- See Also:
-
TYPE_EC_PRIVATE_KEY
- See Also:
-
TYPE_ENCRYPTED_PRIVATE_KEY
- See Also:
-
TYPE_PRIVATE_KEY
- See Also:
-
parsers
-
-
Constructor Details
-
PEMParser
Create a new PEMReader- Parameters:
reader
- the Reader
-
-
Method Details
-
readObject
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:
IOException
- in case of a parse error.
-
getSupportedTypes
- Returns:
- set of pem object types that can be parsed
- See Also:
-