public final class PemUtils extends Object
X509ExtendedKeyManager or X509ExtendedTrustManager.
- load trusted certificates and map it into a list ofX509Certificate- load identity material and map it into aPrivateKey
The PemUtils serves mainly as a helper class to easily supply the PEM formatted SSL material
for the SSLFactory, but can also be used for other purposes.
| Modifier and Type | Method and Description |
|---|---|
static List<X509Certificate> |
loadCertificate(InputStream... certificateStreams)
Loads certificates from multiple InputStreams and maps it to a list of
X509Certificate |
static List<X509Certificate> |
loadCertificate(Path... certificatePaths)
Loads certificates from the filesystem and maps it to a list of
X509Certificate |
static List<X509Certificate> |
loadCertificate(String... certificatePaths)
Loads certificates from the classpath and maps it to a list of
X509Certificate |
static X509ExtendedKeyManager |
loadIdentityMaterial(InputStream identityStream)
Loads the identity material based on a combined entity containing the certificate chain and the private key
from an InputStream and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(InputStream identityStream,
char[] keyPassword)
Loads the identity material based on a combined entity containing the certificate chain and the private key
from an InputStream and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(InputStream certificateChainStream,
InputStream privateKeyStream)
Loads the identity material based on a certificate chain and a private key
as an InputStream and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(InputStream certificateChainStream,
InputStream privateKeyStream,
char[] keyPassword)
Loads the identity material based on a certificate chain and a private key
as an InputStream and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(Path identityPath)
Loads the identity material based on a combined file containing the certificate chain and the private key
from the filesystem and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(Path identityPath,
char[] keyPassword)
Loads the identity material based on a combined file containing the certificate chain and the private key
from the filesystem and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(Path certificateChainPath,
Path privateKeyPath)
Loads the identity material based on a certificate chain and a private key
from the filesystem and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(Path certificateChainPath,
Path privateKeyPath,
char[] keyPassword)
Loads the identity material based on a certificate chain and a private key
from the filesystem and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(String identityPath)
Loads the identity material based on a combined file containing the certificate chain and the private key
from the classpath and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(String identityPath,
char[] keyPassword)
Loads the identity material based on a combined file containing the certificate chain and the private key
from the classpath and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(String certificateChainPath,
String privateKeyPath)
Loads the identity material based on a certificate chain and a private key
from the classpath and maps it to an instance of
X509ExtendedKeyManager |
static X509ExtendedKeyManager |
loadIdentityMaterial(String certificateChainPath,
String privateKeyPath,
char[] keyPassword)
Loads the identity material based on a certificate chain and a private key from
the classpath and maps it to an instance of
X509ExtendedKeyManager |
static PrivateKey |
loadPrivateKey(InputStream identityStream)
Loads the private key from an InputStream and maps it to an instance of
PrivateKey |
static PrivateKey |
loadPrivateKey(InputStream identityStream,
char[] keyPassword)
Loads the private key from an InputStream and maps it to an instance of
PrivateKey |
static PrivateKey |
loadPrivateKey(Path identityPath)
Loads the private key from the filesystem and maps it to an instance of
PrivateKey |
static PrivateKey |
loadPrivateKey(Path identityPath,
char[] keyPassword)
Loads the private key from the filesystem and maps it to an instance of
PrivateKey |
static PrivateKey |
loadPrivateKey(String identityPath)
Loads the private key from the classpath and maps it to an instance of
PrivateKey |
static PrivateKey |
loadPrivateKey(String identityPath,
char[] keyPassword)
Loads the private key from the classpath and maps it to an instance of
PrivateKey |
static X509ExtendedTrustManager |
loadTrustMaterial(InputStream... certificateStreams)
Loads certificates from multiple InputStreams and maps it to an instance of
X509ExtendedTrustManager |
static X509ExtendedTrustManager |
loadTrustMaterial(Path... certificatePaths)
Loads certificates from the filesystem and maps it to an instance of
X509ExtendedTrustManager |
static X509ExtendedTrustManager |
loadTrustMaterial(String... certificatePaths)
Loads certificates from the classpath and maps it to an instance of
X509ExtendedTrustManager |
static List<X509Certificate> |
parseCertificate(String certContent) |
static X509ExtendedKeyManager |
parseIdentityMaterial(String identityContent,
char[] keyPassword)
Parses the identity material based on a string representation containing the certificate chain and the private key
and maps it to an instance of
X509ExtendedTrustManager |
static X509ExtendedKeyManager |
parseIdentityMaterial(String certificateChainContent,
String privateKeyContent,
char[] keyPassword)
Parses the identity material based on a string representation of the certificate chain and the private key
and maps it to an instance of
X509ExtendedTrustManager |
static PrivateKey |
parsePrivateKey(String identityContent)
Parses the private key based on a string representation of the private key
and maps it to an instance of
PrivateKey |
static PrivateKey |
parsePrivateKey(String identityContent,
char[] keyPassword)
Parses the private key based on a string representation of the private key
and maps it to an instance of
PrivateKey. |
static X509ExtendedTrustManager |
parseTrustMaterial(String... certificateContents)
Parses one or more certificates as a string representation
and maps it to an instance of
X509ExtendedTrustManager |
public static X509ExtendedTrustManager loadTrustMaterial(String... certificatePaths)
X509ExtendedTrustManagerpublic static X509ExtendedTrustManager loadTrustMaterial(Path... certificatePaths)
X509ExtendedTrustManagerpublic static X509ExtendedTrustManager loadTrustMaterial(InputStream... certificateStreams)
X509ExtendedTrustManagerpublic static List<X509Certificate> loadCertificate(String... certificatePaths)
X509Certificatepublic static List<X509Certificate> loadCertificate(Path... certificatePaths)
X509Certificatepublic static List<X509Certificate> loadCertificate(InputStream... certificateStreams)
X509Certificatepublic static List<X509Certificate> parseCertificate(String certContent)
public static X509ExtendedTrustManager parseTrustMaterial(String... certificateContents)
X509ExtendedTrustManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(String certificateChainPath, String privateKeyPath)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(String certificateChainPath, String privateKeyPath, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(InputStream certificateChainStream, InputStream privateKeyStream)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(InputStream certificateChainStream, InputStream privateKeyStream, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(Path certificateChainPath, Path privateKeyPath)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(Path certificateChainPath, Path privateKeyPath, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(String identityPath)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(String identityPath, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(Path identityPath)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(Path identityPath, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(InputStream identityStream)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager loadIdentityMaterial(InputStream identityStream, char[] keyPassword)
X509ExtendedKeyManagerpublic static X509ExtendedKeyManager parseIdentityMaterial(String identityContent, char[] keyPassword)
X509ExtendedTrustManagerpublic static X509ExtendedKeyManager parseIdentityMaterial(String certificateChainContent, String privateKeyContent, char[] keyPassword)
X509ExtendedTrustManagerpublic static PrivateKey loadPrivateKey(String identityPath)
PrivateKeypublic static PrivateKey loadPrivateKey(String identityPath, char[] keyPassword)
PrivateKeypublic static PrivateKey loadPrivateKey(Path identityPath)
PrivateKeypublic static PrivateKey loadPrivateKey(Path identityPath, char[] keyPassword)
PrivateKeypublic static PrivateKey loadPrivateKey(InputStream identityStream)
PrivateKeypublic static PrivateKey loadPrivateKey(InputStream identityStream, char[] keyPassword)
PrivateKeypublic static PrivateKey parsePrivateKey(String identityContent)
PrivateKeypublic static PrivateKey parsePrivateKey(String identityContent, char[] keyPassword)
PrivateKey. If the identity content
contains multiple private keys it will use only the first one.Copyright © 2022. All rights reserved.