Package io.airlift.security.pem
Class PemReader
java.lang.Object
io.airlift.security.pem.PemReader
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]base64Decode(String base64) static booleanstatic booleanstatic KeyStoreloadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword) static KeyStoreloadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword, boolean storeKeyWithPassword) static PrivateKeyloadPrivateKey(File privateKeyFile, Optional<String> keyPassword) static PrivateKeyloadPrivateKey(String privateKey, Optional<String> keyPassword) static PublicKeyloadPublicKey(File publicKeyFile) static PublicKeyloadPublicKey(String publicKey) static KeyStoreloadTrustStore(File certificateChainFile) static List<X509Certificate>readCertificateChain(File certificateChainFile) static List<X509Certificate>readCertificateChain(String certificateChain)
-
Method Details
-
isPem
- Throws:
IOException
-
isPem
-
loadTrustStore
public static KeyStore loadTrustStore(File certificateChainFile) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
loadKeyStore
public static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
loadKeyStore
public static KeyStore loadKeyStore(File certificateChainFile, File privateKeyFile, Optional<String> keyPassword, boolean storeKeyWithPassword) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
readCertificateChain
public static List<X509Certificate> readCertificateChain(File certificateChainFile) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
readCertificateChain
public static List<X509Certificate> readCertificateChain(String certificateChain) throws CertificateException - Throws:
CertificateException
-
loadPrivateKey
public static PrivateKey loadPrivateKey(File privateKeyFile, Optional<String> keyPassword) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
loadPrivateKey
public static PrivateKey loadPrivateKey(String privateKey, Optional<String> keyPassword) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
loadPublicKey
public static PublicKey loadPublicKey(File publicKeyFile) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
loadPublicKey
- Throws:
GeneralSecurityException
-
base64Decode
-