final class PemReader extends Object
Modifier and Type | Field and Description |
---|---|
private static Pattern |
CERT_PATTERN |
private static Pattern |
PRIVATE_KEY_PATTERN |
private static Pattern |
PUBLIC_KEY_PATTERN |
Modifier | Constructor and Description |
---|---|
private |
PemReader() |
Modifier and Type | Method and Description |
---|---|
private static byte[] |
base64Decode(String base64) |
static KeyStore |
loadKeyStore(File certificateChainFile,
File privateKeyFile,
char[] keyPassword) |
static PrivateKey |
loadPrivateKey(File privateKeyFile,
char[] keyPassword) |
static PrivateKey |
loadPrivateKey(String privateKey,
char[] keyPassword) |
static PublicKey |
loadPublicKey(File publicKeyFile) |
static PublicKey |
loadPublicKey(String publicKey) |
static KeyStore |
loadTrustStore(File certificateChainFile) |
static List<X509Certificate> |
readCertificateChain(File certificateChainFile) |
static List<X509Certificate> |
readCertificateChain(String certificateChain) |
private static final Pattern CERT_PATTERN
private static final Pattern PRIVATE_KEY_PATTERN
private static final Pattern PUBLIC_KEY_PATTERN
private PemReader()
public static KeyStore loadTrustStore(File certificateChainFile) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, char[] keyPassword) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static List<X509Certificate> readCertificateChain(String certificateChain) throws CertificateException
CertificateException
public static PrivateKey loadPrivateKey(File privateKeyFile, char[] keyPassword) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PrivateKey loadPrivateKey(String privateKey, char[] keyPassword) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PublicKey loadPublicKey(File publicKeyFile) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PublicKey loadPublicKey(String publicKey) throws GeneralSecurityException
GeneralSecurityException
private static byte[] base64Decode(String base64)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.