Package org.forgerock.oauth2.core
Class PEMDecoder
- java.lang.Object
-
- org.forgerock.oauth2.core.PEMDecoder
-
public final class PEMDecoder extends Object
Utility for decoding PEM formatted keys and certificates.- Since:
- 12.0.0
-
-
Constructor Summary
Constructors Constructor Description PEMDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RSAPublicKeydecodeRSAPublicKey(String encodedKey)Decodes a PEM encoded Public Key.X509CertificatedecodeX509Certificate(String encodedCert)Decodes a PEM encoded X.509 Certificate.
-
-
-
Method Detail
-
decodeRSAPublicKey
public RSAPublicKey decodeRSAPublicKey(String encodedKey) throws NoSuchAlgorithmException, InvalidKeySpecException
Decodes a PEM encoded Public Key.- Parameters:
encodedKey- The Base64 encoded public key bytes.- Returns:
- The decoded Public Key.
- Throws:
NoSuchAlgorithmException- If the key cannot be decoded.InvalidKeySpecException- If the key cannot be decoded.
-
decodeX509Certificate
public X509Certificate decodeX509Certificate(String encodedCert) throws CertificateException
Decodes a PEM encoded X.509 Certificate.- Parameters:
encodedCert- The Base64 encoded certificate bytes.- Returns:
- The decoded X.509 Certificate.
- Throws:
CertificateException- If the certificate cannot be decoded.
-
-