public class X509SSLContextInitializer extends AbstractSSLContextInitializer
| Modifier and Type | Field and Description |
|---|---|
private X509Certificate |
authenticationCert
Certificate used to create key managers.
|
private PrivateKey |
authenticationKey
Private key used to create key managers.
|
private X509Certificate[] |
trustCerts
Certificates used to create trust managers.
|
hostnameVerifierConfig, logger, trustManagers| Constructor and Description |
|---|
X509SSLContextInitializer() |
| Modifier and Type | Method and Description |
|---|---|
protected TrustManager[] |
createTrustManagers()
Creates any trust managers specific to this context initializer.
|
X509Certificate |
getAuthenticationCertificate()
Returns the certificate to use for creating the key managers.
|
PrivateKey |
getAuthenticationKey()
Returns the private key associated with the authentication certificate.
|
protected KeyManagerFactory |
getKeyManagerFactory(X509Certificate cert,
PrivateKey key)
Creates a new key manager factory.
|
KeyManager[] |
getKeyManagers()
Returns the key managers used when creating SSL contexts.
|
X509Certificate[] |
getTrustCertificates()
Returns the certificates to use for creating the trust managers.
|
protected TrustManagerFactory |
getTrustManagerFactory(X509Certificate[] certs)
Creates a new trust manager factory.
|
void |
setAuthenticationCertificate(X509Certificate cert)
Sets the certificate to use for creating the key managers.
|
void |
setAuthenticationKey(PrivateKey key)
Sets the private key associated with the authentication certificate.
|
void |
setTrustCertificates(X509Certificate... certs)
Sets the certificates to use for creating the trust managers.
|
String |
toString() |
aggregateTrustManagers, getHostnameVerifierConfig, getTrustManagers, initSSLContext, setHostnameVerifierConfig, setTrustManagersprivate X509Certificate[] trustCerts
private X509Certificate authenticationCert
private PrivateKey authenticationKey
public X509Certificate[] getTrustCertificates()
public void setTrustCertificates(X509Certificate... certs)
certs - X.509 certificatespublic X509Certificate getAuthenticationCertificate()
public void setAuthenticationCertificate(X509Certificate cert)
cert - X.509 certificatepublic PrivateKey getAuthenticationKey()
public void setAuthenticationKey(PrivateKey key)
key - private keyprotected TrustManager[] createTrustManagers() throws GeneralSecurityException
AbstractSSLContextInitializercreateTrustManagers in class AbstractSSLContextInitializerGeneralSecurityException - if an errors occurs while loading the TrustManagersprotected TrustManagerFactory getTrustManagerFactory(X509Certificate[] certs) throws GeneralSecurityException
certs - to add as trusted materialGeneralSecurityException - if the trust manager factory cannot be initializedpublic KeyManager[] getKeyManagers() throws GeneralSecurityException
SSLContextInitializerGeneralSecurityException - if an errors occurs while loading the KeyManagersprotected KeyManagerFactory getKeyManagerFactory(X509Certificate cert, PrivateKey key) throws GeneralSecurityException
cert - to initialize the key manager factorykey - to initialize the key manager factoryGeneralSecurityException - if the key manager factory cannot be initializedCopyright © 2003-2019 Virginia Tech. All Rights Reserved.