Class DefaultSSLContextFactoryService
- java.lang.Object
-
- de.hybris.platform.kymaintegrationservices.services.impl.DefaultSSLContextFactoryService
-
- All Implemented Interfaces:
SSLContextFactoryService
public class DefaultSSLContextFactoryService extends java.lang.Object implements SSLContextFactoryService
Default implementation ofSSLContextFactoryService
.
-
-
Constructor Summary
Constructors Constructor Description DefaultSSLContextFactoryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.net.ssl.KeyManager[]
createKeyManagerFactory(byte[] certBytes, byte[] keyBytes)
Creates the array of key managers.java.security.SecureRandom
createSecureRandom()
Creates aSecureRandom
javax.net.ssl.SSLContext
createSSLContext(byte[] certBytes, byte[] keyBytes)
Creates the ssl contextjavax.net.ssl.TrustManager[]
createTrustManagerFactory()
Creates the array of Trust managers.
-
-
-
Method Detail
-
createSSLContext
public javax.net.ssl.SSLContext createSSLContext(byte[] certBytes, byte[] keyBytes) throws SSLContextFactoryCreationException
Description copied from interface:SSLContextFactoryService
Creates the ssl context- Specified by:
createSSLContext
in interfaceSSLContextFactoryService
- Parameters:
certBytes
- byte array of the client certificate datakeyBytes
- byte array of the private key- Returns:
- SSL context which is initialized with key managers and Trust managers
- Throws:
SSLContextFactoryCreationException
- thrown when there is a problem in forming Key managers, Trust mangers or SSL context
-
createKeyManagerFactory
public javax.net.ssl.KeyManager[] createKeyManagerFactory(byte[] certBytes, byte[] keyBytes) throws SSLContextFactoryCreationException
Description copied from interface:SSLContextFactoryService
Creates the array of key managers. Used keystore type is "JKS" and key manager factory algorithm is "SunX509"- Specified by:
createKeyManagerFactory
in interfaceSSLContextFactoryService
- Parameters:
certBytes
- byte array of the client certificate datakeyBytes
- byte array of the private key- Returns:
- the array of KeyManagers
- Throws:
SSLContextFactoryCreationException
- thrown when there is a problem in forming Key managers
-
createTrustManagerFactory
public javax.net.ssl.TrustManager[] createTrustManagerFactory() throws SSLContextFactoryCreationException
Description copied from interface:SSLContextFactoryService
Creates the array of Trust managers. In order to check the revocation status of the certificate, either java.home or customised path to the cacerts must be set. In case both of them are present then the customised path is considered. If neither is set then the certificate revocation check is not performed.- Specified by:
createTrustManagerFactory
in interfaceSSLContextFactoryService
- Returns:
- array of TrustManagers, returns an empty array in case either java.home or customised path to the truststore cacerts is not configured.
- Throws:
SSLContextFactoryCreationException
- thrown when there is a problem in forming trust managers
-
createSecureRandom
public java.security.SecureRandom createSecureRandom()
Description copied from interface:SSLContextFactoryService
Creates aSecureRandom
- Specified by:
createSecureRandom
in interfaceSSLContextFactoryService
- Returns:
- newly created
SecureRandom
-
-