public final class PemUtils extends Object
Modifier and Type | Method and Description |
---|---|
static X509Certificate |
decodeCertificate(String cert)
Decode a X509 Certificate from a PEM string
|
static PrivateKey |
decodePrivateKey(String pem)
Decode a Private Key from a PEM string
|
static PublicKey |
decodePublicKey(String pem)
Decode a Public Key from a PEM string
|
static String |
encodeCertificate(Certificate certificate)
Encode a X509 Certificate to a PEM string
|
static String |
encodeKey(Key key)
Encode a Key to a PEM string
|
static String |
generateThumbprint(String[] certChain,
String encoding) |
static byte[] |
pemToDer(String pem) |
static String |
removeBeginEnd(String pem) |
public static X509Certificate decodeCertificate(String cert)
cert
- Exception
public static PublicKey decodePublicKey(String pem)
pem
- Exception
public static PrivateKey decodePrivateKey(String pem)
pem
- Exception
public static String encodeKey(Key key)
key
- Exception
public static String encodeCertificate(Certificate certificate)
certificate
- public static byte[] pemToDer(String pem)
public static String generateThumbprint(String[] certChain, String encoding) throws NoSuchAlgorithmException
NoSuchAlgorithmException
Copyright © 2019 JBoss by Red Hat. All rights reserved.