public final class PemUtils extends Object
Modifier and Type | Method and Description |
---|---|
static X509Certificate |
decodeCertificate(InputStream is) |
static PrivateKey |
decodePrivateKey(InputStream is) |
static PrivateKey |
decodePrivateKey(String pem)
Extract a private key that is a PKCS#8 PEM string (base64 encoded PKCS#8).
|
static PublicKey |
decodePublicKey(String pem)
Extract a public key from a PEM string.
|
static String |
pemFromStream(InputStream is) |
static byte[] |
pemToDer(InputStream is)
Decode a PEM file to DER format.
|
static byte[] |
pemToDer(String pem)
Decode a PEM string to DER format.
|
public static X509Certificate decodeCertificate(InputStream is) throws IOException, CertificateException, NoSuchProviderException
public static PublicKey decodePublicKey(String pem) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
public static PrivateKey decodePrivateKey(String pem) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
public static PrivateKey decodePrivateKey(InputStream is) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
public static byte[] pemToDer(InputStream is) throws IOException
IOException
public static byte[] pemToDer(String pem) throws IOException
IOException
public static String pemFromStream(InputStream is) throws IOException
IOException
Copyright © 2016. All rights reserved.