public class SslDomainImpl extends java.lang.Object implements SslDomain, ProtonSslEngineProvider, ProtonJSslDomain
SslDomain.Factory, SslDomain.Mode, SslDomain.VerifyMode| Constructor and Description |
|---|
SslDomainImpl()
Application code should use
SslDomain.Factory.create() instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowUnsecuredClient() |
void |
allowUnsecuredClient(boolean allowUnsecured)
Permit a server to accept connection requests from non-SSL clients.
|
ProtonSslEngine |
createSslEngine(SslPeerDetails peerDetails)
Returns an SSL engine.
|
java.lang.String |
getCertificateFile() |
SslDomain.Mode |
getMode() |
SslDomain.VerifyMode |
getPeerAuthentication() |
java.lang.String |
getPrivateKeyFile() |
java.lang.String |
getPrivateKeyPassword() |
javax.net.ssl.SSLContext |
getSslContext()
Returns the SSLContext set by
SslDomain.setSslContext(SSLContext). |
java.lang.String |
getTrustedCaDb() |
void |
init(SslDomain.Mode mode)
Initialize the ssl domain object.
|
void |
setCredentials(java.lang.String certificateFile,
java.lang.String privateKeyFile,
java.lang.String privateKeyPassword)
Set the certificate that identifies the local node to the remote.
|
void |
setPeerAuthentication(SslDomain.VerifyMode verifyMode)
Configure the level of verification used on the peer certificate.
|
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets an SSLContext for use when establishing SSL transport.
|
void |
setTrustedCaDb(java.lang.String certificateDb)
Configure the set of trusted CA certificates used by this node to verify peers.
|
java.lang.String |
toString() |
public SslDomainImpl()
SslDomain.Factory.create() instead.public void init(SslDomain.Mode mode)
SslDomainpublic SslDomain.Mode getMode()
public void setCredentials(java.lang.String certificateFile,
java.lang.String privateKeyFile,
java.lang.String privateKeyPassword)
SslDomainsetCredentials in interface SslDomaincertificateFile - path to file/database containing the identifying
certificate.privateKeyFile - path to file/database containing the private key used to
sign the certificateprivateKeyPassword - the password used to sign the key, else null if key is not
protected.public void setTrustedCaDb(java.lang.String certificateDb)
SslDomainsetTrustedCaDb in interface SslDomaincertificateDb - database of trusted CAs, used to authenticate the peer.public java.lang.String getTrustedCaDb()
getTrustedCaDb in interface SslDomainpublic void setSslContext(javax.net.ssl.SSLContext sslContext)
SslDomainsetSslContext in interface SslDomainsslContext - the context to usepublic javax.net.ssl.SSLContext getSslContext()
SslDomainSslDomain.setSslContext(SSLContext).getSslContext in interface SslDomainpublic void setPeerAuthentication(SslDomain.VerifyMode verifyMode)
SslDomainSslDomain.VerifyMode.ANONYMOUS_PEER).
Once certificates and trusted CAs are configured, peer verification can be enabled.
In order to verify a peer, a trusted CA must be configured. See
SslDomain.setTrustedCaDb(String).
NOTE: Servers must provide their own certificate when verifying a peer. See
SslDomain.setCredentials(String, String, String)).setPeerAuthentication in interface SslDomainverifyMode - the level of validation to apply to the peerpublic SslDomain.VerifyMode getPeerAuthentication()
getPeerAuthentication in interface SslDomainpublic java.lang.String getPrivateKeyFile()
getPrivateKeyFile in interface SslDomainpublic java.lang.String getPrivateKeyPassword()
getPrivateKeyPassword in interface SslDomainpublic java.lang.String getCertificateFile()
getCertificateFile in interface SslDomainpublic void allowUnsecuredClient(boolean allowUnsecured)
SslDomainallowUnsecuredClient in interface SslDomainpublic boolean allowUnsecuredClient()
allowUnsecuredClient in interface SslDomainpublic ProtonSslEngine createSslEngine(SslPeerDetails peerDetails)
ProtonSslEngineProvidercreateSslEngine in interface ProtonSslEngineProviderpeerDetails - the details of the remote peer. If non-null, may be used to assist SSL session resumption.public java.lang.String toString()
toString in class java.lang.Object