Class TlsUtil
java.lang.Object
io.opentelemetry.exporter.internal.TlsUtil
Utilities for working with TLS.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final List<KeyFactory> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static byte[]decodePem(byte[] pem) (package private) static PrivateKeygeneratePrivateKey(PKCS8EncodedKeySpec keySpec, List<KeyFactory> keyFactories) static X509KeyManagerkeyManager(byte[] privateKeyPem, byte[] certificatePem) CreatesKeyManagerinitiated by keystore containing single private key with matching certificate chain.static X509TrustManagertrustManager(byte[] trustedCertificatesPem) Returns aTrustManagerfor the given trusted certificates.
-
Field Details
-
PEM_KEY_HEADER
- See Also:
-
PEM_KEY_FOOTER
- See Also:
-
SUPPORTED_KEY_FACTORIES
-
-
Constructor Details
-
TlsUtil
private TlsUtil()
-
-
Method Details
-
keyManager
public static X509KeyManager keyManager(byte[] privateKeyPem, byte[] certificatePem) throws SSLException CreatesKeyManagerinitiated by keystore containing single private key with matching certificate chain.- Throws:
SSLException
-
generatePrivateKey
static PrivateKey generatePrivateKey(PKCS8EncodedKeySpec keySpec, List<KeyFactory> keyFactories) throws SSLException - Throws:
SSLException
-
trustManager
Returns aTrustManagerfor the given trusted certificates.- Throws:
SSLException
-
decodePem
static byte[] decodePem(byte[] pem)
-