Package org.keycloak.common.util
Class DerUtils
- java.lang.Object
-
- org.keycloak.common.util.DerUtils
-
public final class DerUtils extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static X509Certificate
decodeCertificate(InputStream is)
static PrivateKey
decodePrivateKey(byte[] der)
static PrivateKey
decodePrivateKey(InputStream is)
static PublicKey
decodePublicKey(byte[] der)
static PublicKey
decodePublicKey(byte[] der, String type)
-
-
-
Method Detail
-
decodePrivateKey
public static PrivateKey decodePrivateKey(InputStream is) throws Exception
- 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
public static X509Certificate decodeCertificate(InputStream is) throws Exception
- Throws:
Exception
-
decodePrivateKey
public static PrivateKey decodePrivateKey(byte[] der) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
-
-