Package org.jboss.resteasy.jose.jws.util
Class PemUtils
java.lang.Object
org.jboss.resteasy.jose.jws.util.PemUtils
Utility classes to extract PublicKey, PrivateKey, and X509Certificate from openssl generated PEM files
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionstatic X509Certificate
decodeCertificate
(String cert) Decode a X509 Certificate from a PEM stringstatic PrivateKey
decodePrivateKey
(String pem) Decode a Private Key from a PEM stringstatic PublicKey
decodePublicKey
(String pem) Decode a Public Key from a PEM stringstatic String
encodeCertificate
(Certificate certificate) Encode a X509 Certificate to a PEM stringstatic String
Encode a Key to a PEM stringstatic String
generateThumbprint
(String[] certChain, String encoding) static byte[]
static String
removeBeginEnd
(String pem)
-
Method Details
-
decodeCertificate
Decode a X509 Certificate from a PEM string- Parameters:
cert
-- Returns:
- Throws:
Exception
-
decodePublicKey
Decode a Public Key from a PEM string- Parameters:
pem
-- Returns:
- Throws:
Exception
-
decodePrivateKey
Decode a Private Key from a PEM string- Parameters:
pem
-- Returns:
- Throws:
Exception
-
encodeKey
Encode a Key to a PEM string- Parameters:
key
-- Returns:
- Throws:
Exception
-
encodeCertificate
Encode a X509 Certificate to a PEM string- Parameters:
certificate
-- Returns:
-
pemToDer
-
removeBeginEnd
-
generateThumbprint
public static String generateThumbprint(String[] certChain, String encoding) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-