public final class PemUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEK_INFO
Decryption infor tag for PEM-encoded private key in OpenSSL format.
|
static java.lang.String |
FOOTER_END
PEM encoding footer start string.
|
static java.lang.String |
HEADER_BEGIN
PEM encoding header start string.
|
static int |
LINE_LENGTH
Line length.
|
static java.lang.String |
PROC_TYPE
Procedure type tag for PEM-encoded private key in OpenSSL format.
|
| Modifier | Constructor and Description |
|---|---|
private |
PemUtil()
Private constructor of utility class.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(byte[] pem)
Decodes a PEM-encoded cryptographic object into the raw bytes of its ASN.1 encoding.
|
static byte[] |
decode(java.lang.String pem)
Decodes a PEM-encoded cryptographic object into the raw bytes of its ASN.1 encoding.
|
static boolean |
isBase64Char(byte b)
Determines whether the given byte represents an ASCII character in the character set for base64 encoding.
|
static boolean |
isPem(byte[] data)
Determines whether the data in the given byte array is base64-encoded data of PEM encoding.
|
private static void |
writeLine(java.nio.CharBuffer line,
java.nio.CharBuffer output)
Copies a non-header line to the output buffer.
|
public static final int LINE_LENGTH
public static final java.lang.String HEADER_BEGIN
public static final java.lang.String FOOTER_END
public static final java.lang.String PROC_TYPE
public static final java.lang.String DEK_INFO
public static boolean isPem(byte[] data)
data - Data to test for PEM encodingpublic static boolean isBase64Char(byte b)
b - Byte to test.public static byte[] decode(byte[] pem)
pem - Bytes of PEM-encoded data to decode.public static byte[] decode(java.lang.String pem)
pem - PEM-encoded data to decode.private static void writeLine(java.nio.CharBuffer line,
java.nio.CharBuffer output)
line - Line to consider writing.output - Output buffer.