public class PemUtils extends Object
| Constructor and Description |
|---|
PemUtils() |
| Modifier and Type | Method and Description |
|---|---|
static X509Certificate |
decodeCertificate(InputStream is) |
static X509Certificate |
decodeCertificate(String cert) |
static PrivateKey |
decodePrivateKey(InputStream is) |
static PrivateKey |
decodePrivateKey(String pem)
Extract a private key that is a PKCS8 pem string (base64 encoded PKCS8).
|
static PublicKey |
decodePublicKey(String pem)
Extract a public key from a PEM string.
|
static String |
pemFromStream(InputStream is) |
static byte[] |
pemToDer(InputStream is)
Decode a PEM file to DER format.
|
static byte[] |
pemToDer(String pem)
Decode a PEM string to DER format.
|
static String |
removeBeginEnd(String pem) |
public static X509Certificate decodeCertificate(InputStream is) throws Exception
Exceptionpublic static X509Certificate decodeCertificate(String cert) throws Exception
Exceptionpublic static PublicKey decodePublicKey(String pem) throws Exception
public static PrivateKey decodePrivateKey(String pem) throws Exception
pem - PEM encoded stringPrivateKeyException - if error occurredpublic static PrivateKey decodePrivateKey(InputStream is) throws Exception
Exceptionpublic static byte[] pemToDer(InputStream is) throws IOException
is - input streamIOException - if I/O error occurredpublic static byte[] pemToDer(String pem) throws IOException
pem - PEM encoded stringIOException - if I/O error occurredpublic static String pemFromStream(InputStream is) throws IOException
IOExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.