Class TlsUtil
- java.lang.Object
-
- io.opentelemetry.exporter.internal.TlsUtil
-
public final class TlsUtil extends java.lang.ObjectUtilities 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
Fields Modifier and Type Field Description private static java.lang.StringPEM_KEY_FOOTERprivate static java.lang.StringPEM_KEY_HEADERprivate static java.util.List<java.security.KeyFactory>SUPPORTED_KEY_FACTORIES
-
Constructor Summary
Constructors Modifier Constructor Description privateTlsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static byte[]decodePem(byte[] pem)(package private) static java.security.PrivateKeygeneratePrivateKey(java.security.spec.PKCS8EncodedKeySpec keySpec, java.util.List<java.security.KeyFactory> keyFactories)static javax.net.ssl.X509KeyManagerkeyManager(byte[] privateKeyPem, byte[] certificatePem)CreatesKeyManagerinitiated by keystore containing single private key with matching certificate chain.static javax.net.ssl.X509TrustManagertrustManager(byte[] trustedCertificatesPem)Returns aTrustManagerfor the given trusted certificates.
-
-
-
Field Detail
-
PEM_KEY_HEADER
private static final java.lang.String PEM_KEY_HEADER
- See Also:
- Constant Field Values
-
PEM_KEY_FOOTER
private static final java.lang.String PEM_KEY_FOOTER
- See Also:
- Constant Field Values
-
SUPPORTED_KEY_FACTORIES
private static final java.util.List<java.security.KeyFactory> SUPPORTED_KEY_FACTORIES
-
-
Method Detail
-
keyManager
public static javax.net.ssl.X509KeyManager keyManager(byte[] privateKeyPem, byte[] certificatePem) throws javax.net.ssl.SSLExceptionCreatesKeyManagerinitiated by keystore containing single private key with matching certificate chain.- Throws:
javax.net.ssl.SSLException
-
generatePrivateKey
static java.security.PrivateKey generatePrivateKey(java.security.spec.PKCS8EncodedKeySpec keySpec, java.util.List<java.security.KeyFactory> keyFactories) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
trustManager
public static javax.net.ssl.X509TrustManager trustManager(byte[] trustedCertificatesPem) throws javax.net.ssl.SSLExceptionReturns aTrustManagerfor the given trusted certificates.- Throws:
javax.net.ssl.SSLException
-
decodePem
static byte[] decodePem(byte[] pem)
-
-