Class PemReader
java.lang.Object
org.apache.hadoop.hbase.io.crypto.tls.PemReader
This file has been copied from the Apache ZooKeeper project.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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)
-
Field Details
-
CERT_PATTERN
-
PRIVATE_KEY_PATTERN
-
PUBLIC_KEY_PATTERN
-
-
Constructor Details
-
PemReader
private PemReader()
-
-
Method Details
-
loadTrustStore
public static KeyStore loadTrustStore(File certificateChainFile) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
loadKeyStore
public static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, char[] keyPassword) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
readCertificateChain
public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
readCertificateChain
public static List<X509Certificate> readCertificateChain(String certificateChain) throws CertificateException - Throws:
CertificateException
-
loadPrivateKey
public static PrivateKey loadPrivateKey(File privateKeyFile, char[] keyPassword) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
loadPrivateKey
public static PrivateKey loadPrivateKey(String privateKey, char[] keyPassword) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
loadPublicKey
public static PublicKey loadPublicKey(File publicKeyFile) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
loadPublicKey
- Throws:
GeneralSecurityException
-
base64Decode
-