Package com.sap.cloud.security.mtls
Class SSLContextFactory
java.lang.Object
com.sap.cloud.security.mtls.SSLContextFactory
Creates a SSLContext (without Bouncy Castle crypto lib).
-
Method Summary
Modifier and TypeMethodDescriptioncreate(ClientIdentity clientIdentity) Creates a SSLContext which can be used to parameterize your Rest client, in order to support mutual TLS.Creates a SSLContext which can be used to parameterize your Rest client, in order to support mutual TLS.createKeyStore(ClientIdentity clientIdentity) Initializes a KeyStore which can be used to parameterize your Rest client, in order to support mutual TLS.static SSLContextFactory
-
Method Details
-
getInstance
-
create
public SSLContext create(String x509Certificates, String rsaPrivateKey) throws GeneralSecurityException, IOException Creates a SSLContext which can be used to parameterize your Rest client, in order to support mutual TLS.- Parameters:
x509Certificates- you can get from your Service ConfigurationOAuth2ServiceConfiguration.getClientIdentity()rsaPrivateKey- you can get from your Service ConfigurationOAuth2ServiceConfiguration.getClientIdentity()- Returns:
- a new SSLContext instance
- Throws:
GeneralSecurityException- in case of key parsing errorsIOException- in case of KeyStore initialization errors
-
create
public SSLContext create(ClientIdentity clientIdentity) throws GeneralSecurityException, IOException Creates a SSLContext which can be used to parameterize your Rest client, in order to support mutual TLS.- Parameters:
clientIdentity- you can get from your Service ConfigurationOAuth2ServiceConfiguration.getClientIdentity()- Returns:
- a new SSLContext instance
- Throws:
GeneralSecurityException- in case of key parsing errorsIOException- in case of KeyStore initialization errors
-
createKeyStore
public KeyStore createKeyStore(ClientIdentity clientIdentity) throws GeneralSecurityException, IOException Initializes a KeyStore which can be used to parameterize your Rest client, in order to support mutual TLS.- Parameters:
clientIdentity- you can get from your Service ConfigurationOAuth2ServiceConfiguration.getClientIdentity()- Returns:
- a new KeyStore instance
- Throws:
GeneralSecurityException- in case of key parsing errorsIOException- in case of KeyStore initialization errors
-