Class CredentialsHelper
- java.lang.Object
-
- com.oracle.coherence.grpc.CredentialsHelper
-
public class CredentialsHelper extends Object
A helper class to resolve gRPC credentials.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROP_CREDENTIALSThe system property to use to set the type of credentials to use.static StringPROP_TLS_CAThe system property that sets the location of the TLS CA file.static StringPROP_TLS_CERTThe system property that sets the location of the TLS cert file.static StringPROP_TLS_KEYThe system property that sets the location of the TLS key file.static StringPROP_TLS_KEYPASSThe system property that sets the password for the TLS key file.static StringPROP_TLS_KEYPASS_URIThe system property that sets the URI of a file to read to obtain the password for the TLS key file.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static io.grpc.ChannelCredentialscreateChannelCredentials(String sChannelName)Deprecated.server credentials are configured by the socket provider for a gRPC channel, seecreateChannelCredentials(String, SocketProviderBuilder)static io.grpc.ChannelCredentialscreateChannelCredentials(String sChannelName, SocketProviderBuilder socketBuilder)Create theChannelCredentialsto use for the client channel.static io.grpc.ServerCredentialscreateServerCredentials()Deprecated.server credentials are configured by the socket provider for a gRPC proxy service, seecreateServerCredentials(SocketProviderBuilder)static io.grpc.ServerCredentialscreateServerCredentials(SocketProviderBuilder socketBuilder)Create theServerCredentialsto use for the gRPC Proxy.
-
-
-
Field Detail
-
PROP_TLS_KEY
public static final String PROP_TLS_KEY
The system property that sets the location of the TLS key file.- See Also:
- Constant Field Values
-
PROP_TLS_KEYPASS
public static final String PROP_TLS_KEYPASS
The system property that sets the password for the TLS key file.- See Also:
- Constant Field Values
-
PROP_TLS_KEYPASS_URI
public static final String PROP_TLS_KEYPASS_URI
The system property that sets the URI of a file to read to obtain the password for the TLS key file.- See Also:
- Constant Field Values
-
PROP_TLS_CERT
public static final String PROP_TLS_CERT
The system property that sets the location of the TLS cert file.- See Also:
- Constant Field Values
-
PROP_TLS_CA
public static final String PROP_TLS_CA
The system property that sets the location of the TLS CA file.- See Also:
- Constant Field Values
-
PROP_CREDENTIALS
public static final String PROP_CREDENTIALS
The system property to use to set the type of credentials to use.- See Also:
- Constant Field Values
-
-
Method Detail
-
createServerCredentials
@Deprecated(since="22.06.2") public static io.grpc.ServerCredentials createServerCredentials()
Deprecated.server credentials are configured by the socket provider for a gRPC proxy service, seecreateServerCredentials(SocketProviderBuilder)Create theServerCredentialsto use for the gRPC Proxy.- Returns:
- the
ServerCredentialsto use for the gRPC Proxy
-
createServerCredentials
public static io.grpc.ServerCredentials createServerCredentials(SocketProviderBuilder socketBuilder)
Create theServerCredentialsto use for the gRPC Proxy.- Parameters:
socketBuilder- the optionalSocketProviderBuilderto use to provide the TLS configuration- Returns:
- the
ServerCredentialsto use for the gRPC Proxy
-
createChannelCredentials
@Deprecated(since="22.06.2") public static io.grpc.ChannelCredentials createChannelCredentials(String sChannelName)
Deprecated.server credentials are configured by the socket provider for a gRPC channel, seecreateChannelCredentials(String, SocketProviderBuilder)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:
sChannelName- the name of the channel- Returns:
- the
ChannelCredentialsto use for the client channel.
-
createChannelCredentials
public static io.grpc.ChannelCredentials createChannelCredentials(String sChannelName, 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:
sChannelName- the name of the channel- Returns:
- the
ChannelCredentialsto use for the client channel.
-
-