public class PEMReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BEGIN_MARKER |
private java.lang.String |
beginMarker |
static java.lang.String |
CERTIFICATE_X509_MARKER |
private byte[] |
derBytes |
static java.lang.String |
PRIVATE_PKCS1_MARKER |
static java.lang.String |
PRIVATE_PKCS8_MARKER |
static java.lang.String |
PUBLIC_X509_MARKER |
private java.io.InputStream |
stream |
Constructor and Description |
---|
PEMReader(byte[] buffer) |
PEMReader(java.io.InputStream inStream) |
PEMReader(java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBeginMarker() |
byte[] |
getDerBytes() |
private byte[] |
readBytes(java.io.BufferedReader reader,
java.lang.String endMarker)
Read the lines between BEGIN and END marker and convert
the Base64 encoded content into binary byte array.
|
protected void |
readFile()
Read the PEM file and save the DER encoded octet
stream and begin marker.
|
public static final java.lang.String PRIVATE_PKCS1_MARKER
public static final java.lang.String PRIVATE_PKCS8_MARKER
public static final java.lang.String CERTIFICATE_X509_MARKER
public static final java.lang.String PUBLIC_X509_MARKER
private static final java.lang.String BEGIN_MARKER
private java.io.InputStream stream
private byte[] derBytes
private java.lang.String beginMarker
public PEMReader(java.io.InputStream inStream) throws java.io.IOException
java.io.IOException
public PEMReader(byte[] buffer) throws java.io.IOException
java.io.IOException
public PEMReader(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public byte[] getDerBytes()
public java.lang.String getBeginMarker()
protected void readFile() throws java.io.IOException
java.io.IOException
private byte[] readBytes(java.io.BufferedReader reader, java.lang.String endMarker) throws java.io.IOException
java.io.IOException