Package org.elasticsearch.common.ssl
Class PemUtils
java.lang.Object
org.elasticsearch.common.ssl.PemUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Certificate>readCertificates(Collection<Path> certPaths) static PrivateKeyreadPrivateKey(Path keyPath, Supplier<char[]> passwordSupplier) Creates aPrivateKeyfrom the contents of a file.
-
Method Details
-
readPrivateKey
public static PrivateKey readPrivateKey(Path keyPath, Supplier<char[]> passwordSupplier) throws IOException, GeneralSecurityException Creates aPrivateKeyfrom the contents of a file. Supports PKCS#1, PKCS#8 encoded formats of encrypted and plaintext RSA, DSA and EC(secp256r1) keys- Parameters:
keyPath- the path for the key filepasswordSupplier- A password supplier for the potentially encrypted (password protected) key- Returns:
- a private key from the contents of the file
- Throws:
IOExceptionGeneralSecurityException
-
readCertificates
public static List<Certificate> readCertificates(Collection<Path> certPaths) throws CertificateException, IOException - Throws:
CertificateExceptionIOException
-