Package org.keycloak.common.util
Class DerUtils
java.lang.Object
org.keycloak.common.util.DerUtils
Extract PrivateKey, PublicKey, and X509Certificate from a DER encoded byte array or file. Usually
generated from openssl
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionstatic X509Certificate
static PrivateKey
decodePrivateKey
(byte[] der) static PrivateKey
static PublicKey
decodePublicKey
(byte[] der) static PublicKey
decodePublicKey
(byte[] der, String type)
-
Method Details
-
decodePrivateKey
- Throws:
Exception
-
decodePublicKey
public static PublicKey decodePublicKey(byte[] der) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException -
decodePublicKey
public static PublicKey decodePublicKey(byte[] der, String type) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException -
decodeCertificate
- Throws:
Exception
-
decodePrivateKey
public static PrivateKey decodePrivateKey(byte[] der) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
-