public static class GrpcServerProperties.Security extends Object
Constructor and Description |
---|
Security() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Resource |
getCertificateChain()
The resource containing the SSL certificate chain.
|
List<String> |
getCiphers()
Specifies the cipher suite.
|
ClientAuth |
getClientAuth()
Whether the client has to authenticate himself via certificates.
|
Resource |
getKeyStore()
The resource containing the key store.
|
String |
getKeyStoreFormat()
The format of the
keyStore . |
String |
getKeyStorePassword()
Password for the key store.
|
Resource |
getPrivateKey()
The resource containing the private key.
|
String |
getPrivateKeyPassword()
Password for the private key.
|
String[] |
getProtocols()
Specifies the protocols accepted for secure connections.
|
Resource |
getTrustCertCollection()
The resource containing the trusted certificate collection.
|
Resource |
getTrustStore()
The resource containing the trust store.
|
String |
getTrustStoreFormat()
The format of the
trustStore . |
String |
getTrustStorePassword()
Password for the trust store.
|
int |
hashCode() |
boolean |
isEnabled()
Flag that controls whether transport security is used.
|
void |
setCertificateChain(Resource certificateChain)
The resource containing the SSL certificate chain.
|
void |
setCiphers(String ciphers) |
void |
setClientAuth(ClientAuth clientAuth)
Whether the client has to authenticate himself via certificates.
|
void |
setEnabled(boolean enabled)
Flag that controls whether transport security is used.
|
void |
setKeyStore(Resource keyStore)
The resource containing the key store.
|
void |
setKeyStoreFormat(String keyStoreFormat)
The format of the
keyStore . |
void |
setKeyStorePassword(String keyStorePassword)
Password for the key store.
|
void |
setPrivateKey(Resource privateKey)
The resource containing the private key.
|
void |
setPrivateKeyPassword(String privateKeyPassword)
Password for the private key.
|
void |
setProtocols(String protocols) |
void |
setTrustCertCollection(Resource trustCertCollection)
The resource containing the trusted certificate collection.
|
void |
setTrustStore(Resource trustStore)
The resource containing the trust store.
|
void |
setTrustStoreFormat(String trustStoreFormat)
The format of the
trustStore . |
void |
setTrustStorePassword(String trustStorePassword)
Password for the trust store.
|
String |
toString() |
public void setCiphers(String ciphers)
public void setProtocols(String protocols)
public boolean isEnabled()
false
. If true
, either set
certificateChain
and privateKey
, or keyStore
.public Resource getCertificateChain()
privateKey
. Cannot be
used in conjunction with keyStore
.GrpcSslContexts.forServer(InputStream, InputStream, String)
public Resource getPrivateKey()
certificateChain
. Cannot be used in
conjunction with keyStore
.GrpcSslContexts.forServer(InputStream, InputStream, String)
public String getPrivateKeyPassword()
privateKey
.GrpcSslContexts.forServer(File, File, String)
public String getKeyStoreFormat()
keyStore
.
Possible values includes:
AUTODETECT
(default)JKS
(.jks
)PKCS12
(.p12
)KeyStore
formatKeyStore#getDefaultType()
public Resource getKeyStore()
privateKey
.public String getKeyStorePassword()
keyStore
.public ClientAuth getClientAuth()
NONE
, OPTIONAL
or REQUIRE
. Defaults to
ClientAuth.NONE
.SslContextBuilder#clientAuth(ClientAuth)
public Resource getTrustCertCollection()
trustStore
. If neither this nor trustCertCollection
is set then the system's trust store
will be used.SslContextBuilder.trustManager(InputStream)
public String getTrustStoreFormat()
trustStore
.
Possible values includes:
AUTODETECT
(default)JKS
(.jks
)PKCS12
(.p12
)KeyStore
formatKeyStore#getDefaultType()
public Resource getTrustStore()
trustCertCollection
. If
neither this nor trustCertCollection
is set then the system's trust store will be used.public String getTrustStorePassword()
trustStore
.public List<String> getCiphers()
null
or empty it will use the system's default cipher suite.public String[] getProtocols()
null
or empty it will use the system's
default (all supported) protocols.public void setEnabled(boolean enabled)
false
. If true
, either set
certificateChain
and privateKey
, or keyStore
.enabled
- Whether transport security should be enabled.public void setCertificateChain(Resource certificateChain)
privateKey
. Cannot be
used in conjunction with keyStore
.certificateChain
- The certificate chain resource.GrpcSslContexts.forServer(InputStream, InputStream, String)
public void setPrivateKey(Resource privateKey)
certificateChain
. Cannot be used in
conjunction with keyStore
.privateKey
- The private key resource.GrpcSslContexts.forServer(InputStream, InputStream, String)
public void setPrivateKeyPassword(String privateKeyPassword)
privateKey
.privateKeyPassword
- The password for the private key.GrpcSslContexts.forServer(File, File, String)
public void setKeyStoreFormat(String keyStoreFormat)
keyStore
.
Possible values includes:
AUTODETECT
(default)JKS
(.jks
)PKCS12
(.p12
)KeyStore
formatKeyStore#getDefaultType()
keyStoreFormat
- The trust store format to use.public void setKeyStore(Resource keyStore)
privateKey
.keyStore
- The key store resource.public void setKeyStorePassword(String keyStorePassword)
keyStore
.keyStorePassword
- The password for the key store.public void setClientAuth(ClientAuth clientAuth)
NONE
, OPTIONAL
or REQUIRE
. Defaults to
ClientAuth.NONE
.clientAuth
- Whether the client has to authenticate himself via certificates.SslContextBuilder#clientAuth(ClientAuth)
public void setTrustCertCollection(Resource trustCertCollection)
trustStore
. If neither this nor trustCertCollection
is set then the system's trust store
will be used.trustCertCollection
- The trusted certificate collection resource.SslContextBuilder.trustManager(InputStream)
public void setTrustStoreFormat(String trustStoreFormat)
trustStore
.
Possible values includes:
AUTODETECT
(default)JKS
(.jks
)PKCS12
(.p12
)KeyStore
formatKeyStore#getDefaultType()
trustStoreFormat
- The trust store format to use.public void setTrustStore(Resource trustStore)
trustCertCollection
. If
neither this nor trustCertCollection
is set then the system's trust store will be used.trustStore
- The trust store resource.public void setTrustStorePassword(String trustStorePassword)
trustStore
.trustStorePassword
- The password for the trust store.protected boolean canEqual(Object other)