Top Description Inners Fields Constructors Methods
org.bouncycastle.openssl

public Class PEMParser

extends PemReader
Class Inheritance
Imports
java.io.IOException, .Reader, java.util.Collections, .HashMap, .Iterator, .List, .Map, .Set, .StringTokenizer, org.bouncycastle.asn1.ASN1BitString, .ASN1Integer, .ASN1ObjectIdentifier, .ASN1Primitive, .ASN1Sequence, .DERNull, org.bouncycastle.asn1.cms.ContentInfo, org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo, .PKCSObjectIdentifiers, .PrivateKeyInfo, .RSAPublicKey, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .DSAParameter, .SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X9ECParameters, .X9ObjectIdentifiers, org.bouncycastle.cert.X509AttributeCertificateHolder, .X509CRLHolder, .X509CertificateHolder, org.bouncycastle.pkcs.PKCS10CertificationRequest, .PKCS8EncryptedPrivateKeyInfo, org.bouncycastle.util.encoders.Hex, org.bouncycastle.util.io.pem.PemHeader, .PemObject, .PemObjectParser, .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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
protected final Map<K, V>
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
Inherited from org.bouncycastle.util.io.pem.PemReader:
LAX_PEM_PARSING_SYSTEM_PROPERTY_NAME

Constructor Summary

AccessConstructor and Description
public
PEMParser(Reader
the Reader
reader
)

Create a new PEMReader

Method Summary

Modifier and TypeMethod and Description
public Set<String>

Returns:

set of pem object types that can be parsed
getSupportedTypes
()

public Object

Returns:

the next object in the stream, null if no objects left.
readObject
()

Read the next PEM object attempting to interpret the header and create a higher level object from the content.

Inherited from org.bouncycastle.util.io.pem.PemReader:
readPemObject

Field Detail

parsersback to summary
protected final Map<K, V> parsers
TYPE_ATTRIBUTE_CERTIFICATEback to summary
public static final String TYPE_ATTRIBUTE_CERTIFICATE
TYPE_CERTIFICATEback to summary
public static final String TYPE_CERTIFICATE
TYPE_CERTIFICATE_REQUESTback to summary
public static final String TYPE_CERTIFICATE_REQUEST
TYPE_CMSback to summary
public static final String TYPE_CMS
TYPE_DSA_PRIVATE_KEYback to summary
public static final String TYPE_DSA_PRIVATE_KEY
TYPE_EC_PARAMETERSback to summary
public static final String TYPE_EC_PARAMETERS
TYPE_EC_PRIVATE_KEYback to summary
public static final String TYPE_EC_PRIVATE_KEY
TYPE_ENCRYPTED_PRIVATE_KEYback to summary
public static final String TYPE_ENCRYPTED_PRIVATE_KEY
TYPE_NEW_CERTIFICATE_REQUESTback to summary
public static final String TYPE_NEW_CERTIFICATE_REQUEST
TYPE_PKCS7back to summary
public static final String TYPE_PKCS7
TYPE_PRIVATE_KEYback to summary
public static final String TYPE_PRIVATE_KEY
TYPE_PUBLIC_KEYback to summary
public static final String TYPE_PUBLIC_KEY
TYPE_RSA_PRIVATE_KEYback to summary
public static final String TYPE_RSA_PRIVATE_KEY
TYPE_RSA_PUBLIC_KEYback to summary
public static final String TYPE_RSA_PUBLIC_KEY
TYPE_TRUSTED_CERTIFICATEback to summary
public static final String TYPE_TRUSTED_CERTIFICATE
TYPE_X509_CERTIFICATEback to summary
public static final String TYPE_X509_CERTIFICATE
TYPE_X509_CRLback to summary
public static final String TYPE_X509_CRL

Constructor Detail

PEMParserback to summary
public PEMParser(Reader reader)

Create a new PEMReader

Parameters
reader:Reader

the Reader

Method Detail

getSupportedTypesback to summary
public Set<String> getSupportedTypes()
Returns:Set<String>

set of pem object types that can be parsed

See Also
PemObject#getType()
readObjectback to summary
public Object readObject() throws IOException

Read the next PEM object attempting to interpret the header and create a higher level object from the content.

Returns:Object

the next object in the stream, null if no objects left.

Exceptions
IOException:
in case of a parse error.
org.bouncycastle.openssl back to summary

private Class PEMParser.DSAKeyPairParser

extends Object
implements PEMKeyPairParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.openssl.PEMKeyPairParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public PEMKeyPair
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DSAKeyPairParserback to summary
private DSAKeyPairParser()

Method Detail

parseback to summary
public PEMKeyPair parse(byte[] encoding) throws IOException

Implements org.bouncycastle.openssl.PEMKeyPairParser.parse.

org.bouncycastle.openssl back to summary

private Class PEMParser.ECCurveParamsParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ECCurveParamsParserback to summary
private ECCurveParamsParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Parameters
obj:PemObject

the PEM object containing the details for the specific object.

Returns:Object

a specific object represented by the PEM object.

Exceptions
IOException:
on a parsing error.
org.bouncycastle.openssl back to summary

private Class PEMParser.ECDSAKeyPairParser

extends Object
implements PEMKeyPairParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.openssl.PEMKeyPairParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public PEMKeyPair
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ECDSAKeyPairParserback to summary
private ECDSAKeyPairParser()

Method Detail

parseback to summary
public PEMKeyPair parse(byte[] encoding) throws IOException

Implements org.bouncycastle.openssl.PEMKeyPairParser.parse.

org.bouncycastle.openssl back to summary

private Class PEMParser.EncryptedPrivateKeyParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the X509Certificate
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in an EncryptedPrivateKeyInfo

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EncryptedPrivateKeyParserback to summary
public EncryptedPrivateKeyParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in an EncryptedPrivateKeyInfo

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the X509Certificate

Exceptions
IOException:
if an I/O error occured
org.bouncycastle.openssl back to summary

private Class PEMParser.KeyPairParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Field Summary

Modifier and TypeField and Description
private final PEMKeyPairParser

Constructor Summary

AccessConstructor and Description
public
KeyPairParser(PEMKeyPairParser pemKeyPairParser)

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Read a Key Pair

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pemKeyPairParserback to summary
private final PEMKeyPairParser pemKeyPairParser

Constructor Detail

KeyPairParserback to summary
public KeyPairParser(PEMKeyPairParser pemKeyPairParser)

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Read a Key Pair

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

a specific object represented by the PEM object.

Exceptions
IOException:

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

on a parsing error.

org.bouncycastle.openssl back to summary

private Class PEMParser.PKCS10CertificationRequestParser

extends Object
implements PemObjectParser
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.openssl.PEMParser.PKCS10CertificationRequestParser
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the certificate request.
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a PKCS10 certification request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PKCS10CertificationRequestParserback to summary
private PKCS10CertificationRequestParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a PKCS10 certification request.

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the certificate request.

Exceptions
IOException:
if an I/O error occured
org.bouncycastle.openssl back to summary

private Class PEMParser.PKCS7Parser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the X509Certificate
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a PKCS7 object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PKCS7Parserback to summary
private PKCS7Parser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a PKCS7 object. This returns a ContentInfo object suitable for use with the CMS API.

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the X509Certificate

Exceptions
IOException:
if an I/O error occured
org.bouncycastle.openssl back to summary

private Class PEMParser.PrivateKeyParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivateKeyParserback to summary
public PrivateKeyParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Parameters
obj:PemObject

the PEM object containing the details for the specific object.

Returns:Object

a specific object represented by the PEM object.

Exceptions
IOException:
on a parsing error.
org.bouncycastle.openssl back to summary

private Class PEMParser.PublicKeyParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PublicKeyParserback to summary
public PublicKeyParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Parameters
obj:PemObject

the PEM object containing the details for the specific object.

Returns:Object

a specific object represented by the PEM object.

Exceptions
IOException:
on a parsing error.
org.bouncycastle.openssl back to summary

private Class PEMParser.RSAKeyPairParser

extends Object
implements PEMKeyPairParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.openssl.PEMKeyPairParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public PEMKeyPair
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RSAKeyPairParserback to summary
private RSAKeyPairParser()

Method Detail

parseback to summary
public PEMKeyPair parse(byte[] encoding) throws IOException

Implements org.bouncycastle.openssl.PEMKeyPairParser.parse.

org.bouncycastle.openssl back to summary

private Class PEMParser.RSAPublicKeyParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RSAPublicKeyParserback to summary
public RSAPublicKeyParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Parameters
obj:PemObject

the PEM object containing the details for the specific object.

Returns:Object

a specific object represented by the PEM object.

Exceptions
IOException:
on a parsing error.
org.bouncycastle.openssl back to summary

private Class PEMParser.X509AttributeCertificateParser

extends Object
implements PemObjectParser
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.openssl.PEMParser.X509AttributeCertificateParser
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
parseObject(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

X509AttributeCertificateParserback to summary
private X509AttributeCertificateParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Parse an object out of the PEM object passed in.

Parameters
obj:PemObject

the PEM object containing the details for the specific object.

Returns:Object

a specific object represented by the PEM object.

Exceptions
IOException:
on a parsing error.
org.bouncycastle.openssl back to summary

private Class PEMParser.X509CertificateParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the X509Certificate
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509Certificate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

X509CertificateParserback to summary
private X509CertificateParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509Certificate.

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the X509Certificate

Exceptions
IOException:
if an I/O error occured
org.bouncycastle.openssl back to summary

private Class PEMParser.X509CRLParser

extends Object
implements PemObjectParser
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the X509Certificate
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509CRL.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

X509CRLParserback to summary
private X509CRLParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509CRL.

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the X509Certificate

Exceptions
IOException:
if an I/O error occured
org.bouncycastle.openssl back to summary

private Class PEMParser.X509TrustedCertificateParser

extends Object
implements PemObjectParser
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.openssl.PEMParser.X509TrustedCertificateParser
All Implemented Interfaces
org.bouncycastle.util.io.pem.PemObjectParser

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the X509Certificate
parseObject
(PemObject
the PEM object containing the details for the specific object.
obj
)

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509Certificate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

X509TrustedCertificateParserback to summary
private X509TrustedCertificateParser()

Method Detail

parseObjectback to summary
public Object parseObject(PemObject obj) throws IOException

Implements org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

Reads in a X509Certificate.

Parameters
obj:PemObject

Doc from org.bouncycastle.util.io.pem.PemObjectParser.parseObject.

the PEM object containing the details for the specific object.

Returns:Object

the X509Certificate

Exceptions
IOException:
if an I/O error occured