Package com.oracle.coherence.grpc
Class CredentialsHelper
java.lang.Object
com.oracle.coherence.grpc.CredentialsHelper
A helper class to resolve gRPC credentials.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe system property to use to set the type of credentials to use.static final StringThe system property that sets the location of the TLS CA file.static final StringThe system property that sets the location of the TLS cert file.static final StringThe system property that sets the location of the TLS key file.static final StringThe system property that sets the password for the TLS key file.static final StringThe system property that sets the URI of a file to read to obtain the password for the TLS key file.
- 
Method SummaryModifier and TypeMethodDescriptionstatic io.grpc.ChannelCredentialscreateChannelCredentials(SocketProviderBuilder socketBuilder) Create theChannelCredentialsto use for the client channel.static io.grpc.ServerCredentialscreateServerCredentials(SocketProviderBuilder socketBuilder) Create theServerCredentialsto use for the gRPC Proxy.
- 
Field Details- 
PROP_TLS_KEYThe system property that sets the location of the TLS key file.- See Also:
 
- 
PROP_TLS_KEYPASSThe system property that sets the password for the TLS key file.- See Also:
 
- 
PROP_TLS_KEYPASS_URIThe system property that sets the URI of a file to read to obtain the password for the TLS key file.- See Also:
 
- 
PROP_TLS_CERTThe system property that sets the location of the TLS cert file.- See Also:
 
- 
PROP_TLS_CAThe system property that sets the location of the TLS CA file.- See Also:
 
- 
PROP_CREDENTIALSThe system property to use to set the type of credentials to use.- See Also:
 
 
- 
- 
Method Details- 
createServerCredentialspublic static io.grpc.ServerCredentials createServerCredentials(SocketProviderBuilder socketBuilder) Create theServerCredentialsto use for the gRPC Proxy.- Parameters:
- socketBuilder- the optional- SocketProviderBuilderto use to provide the TLS configuration
- Returns:
- the ServerCredentialsto use for the gRPC Proxy
 
- 
createChannelCredentialspublic static io.grpc.ChannelCredentials createChannelCredentials(SocketProviderBuilder socketBuilder) Create theChannelCredentialsto use for the client channel.If the property PROP_CREDENTIALSis "plaintext" then a non-TLS credentials will be created.If the property PROP_CREDENTIALSis "insecure" then TLS credentials will be created using an insecure trust manager that will not verify the server certs.If the property PROP_CREDENTIALSis "tls" then TLS credentials will be created using a specified key (from thePROP_TLS_KEY) and cert from (from thePROP_TLS_CERT). Optionally a key password (from thePROP_TLS_KEYPASS) and a CA (from thePROP_TLS_CA) may also be provided.If the property PROP_CREDENTIALSis not set, "plaintext" will be used.- Parameters:
- socketBuilder- the channel- SocketProviderBuilder
- Returns:
- the ChannelCredentialsto use for the client channel.
 
 
-