Package net.oauth.signature.pem
Class PEMReader
- java.lang.Object
-
- net.oauth.signature.pem.PEMReader
-
public class PEMReader extends Object
This class convert PEM into byte array. The begin marker is saved and it can be used to determine the type of the PEM file.- Author:
- zhang
-
-
Field Summary
Fields Modifier and Type Field Description static String
CERTIFICATE_X509_MARKER
static String
PRIVATE_PKCS1_MARKER
static String
PRIVATE_PKCS8_MARKER
static String
PUBLIC_X509_MARKER
-
Constructor Summary
Constructors Constructor Description PEMReader(byte[] buffer)
PEMReader(InputStream inStream)
PEMReader(String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBeginMarker()
byte[]
getDerBytes()
protected void
readFile()
Read the PEM file and save the DER encoded octet stream and begin marker.
-
-
-
Field Detail
-
CERTIFICATE_X509_MARKER
public static final String CERTIFICATE_X509_MARKER
- See Also:
- Constant Field Values
-
PRIVATE_PKCS1_MARKER
public static final String PRIVATE_PKCS1_MARKER
- See Also:
- Constant Field Values
-
PRIVATE_PKCS8_MARKER
public static final String PRIVATE_PKCS8_MARKER
- See Also:
- Constant Field Values
-
PUBLIC_X509_MARKER
public static final String PUBLIC_X509_MARKER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PEMReader
public PEMReader(byte[] buffer) throws IOException
- Throws:
IOException
-
PEMReader
public PEMReader(InputStream inStream) throws IOException
- Throws:
IOException
-
PEMReader
public PEMReader(String fileName) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getBeginMarker
public String getBeginMarker()
-
getDerBytes
public byte[] getDerBytes()
-
readFile
protected void readFile() throws IOException
Read the PEM file and save the DER encoded octet stream and begin marker.- Throws:
IOException
-
-