public interface SslManagerService
Modifier and Type | Method and Description |
---|---|
void |
deleteTrustCertificate(String alias)
Deletes the X509 certificate with the specified Common Name (cn) from the currently configured trust store.
|
SSLSocketFactory |
getSSLSocketFactory()
Returns an SSLSocketFactory based on the current configuration of the SslManagerService and applying
best practices like Hostname Verification and disables the legacy SSL-2.0-compatible Client Hello.
If the SslManagerService configuration contains a path to a custom Trust store, then it will be used. |
SSLSocketFactory |
getSSLSocketFactory(String keyAlias)
Returns an SSLSocketFactory based on the current configuration of the SslManagerService and applying
best practices like Hostname Verification and disables the legacy SSL-2.0-compatible Client Hello.
If the SslManagerService configuration contains a path to a custom Trust store, then it will be used. |
SSLSocketFactory |
getSSLSocketFactory(String protocol,
String cipherSuites,
String trustStorePath,
String keyStorePath,
char[] keyStorePassword,
String keyAlias)
Returns an SSLSocketFactory based on the specified parameters and applying best practices
like Hostname Verification and disables the legacy SSL-2.0-compatible Client Hello.
|
X509Certificate[] |
getTrustCertificates()
Returns the X509 Certificates installed in the currently configured trust store.
|
void |
installTrustCertificate(String alias,
X509Certificate x509crt)
Installs the specified X509 certificate in the currently configured trust store.
|
SSLSocketFactory getSSLSocketFactory() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
SSLSocketFactory getSSLSocketFactory(String keyAlias) throws GeneralSecurityException, IOException
keyAlias
- alias of the entry in the KeyStore to be used for the returned SSLSocketFactoryGeneralSecurityException
IOException
SSLSocketFactory getSSLSocketFactory(String protocol, String cipherSuites, String trustStorePath, String keyStorePath, char[] keyStorePassword, String keyAlias) throws GeneralSecurityException, IOException
protocol
- the protocol to use to initialize the SSLContext - e.g. TLSv1.2cipherSuites
- allowed cipher suites for the returned SSLSocketFactorytrustStorePath
- Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store). Key store type is expected to be JKS.keyStorePath
- Location of the Java keystore file containing an application process's own certificate and private key. Key store type is expected to be JKS.keyStorePassword
- Password to access the private key from the keystore file.keyAlias
- alias of the entry in the KeyStore to be used for the returned SSLSocketFactoryGeneralSecurityException
IOException
X509Certificate[] getTrustCertificates() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
void installTrustCertificate(String alias, X509Certificate x509crt) throws GeneralSecurityException, IOException
x509crt
- certificate to be installedGeneralSecurityException
IOException
void deleteTrustCertificate(String alias) throws GeneralSecurityException, IOException
cn
- GeneralSecurityException
IOException
Copyright © 2014. All Rights Reserved.