Package io.grpc
Enum Class TlsChannelCredentials.Feature
- All Implemented Interfaces:
Serializable
,Comparable<TlsChannelCredentials.Feature>
,Constable
- Enclosing class:
TlsChannelCredentials
Features to understand TLS configuration. Additional enum values may be added in the future.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionKey managers and trust managers may be specified asKeyManager
andTrustManager
objects.A feature that no consumer should understand.Client identity may be provided and server verification can be tuned. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static TlsChannelCredentials.Feature[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FAKE
A feature that no consumer should understand. It should be used for unit testing to confirm a call toincomprehensible()
is implemented properly. -
MTLS
Client identity may be provided and server verification can be tuned. This feature requires observingTlsChannelCredentials.getCertificateChain()
,TlsChannelCredentials.getPrivateKey()
, andTlsChannelCredentials.getPrivateKeyPassword()
as well asTlsChannelCredentials.getRootCertificates()
. The certificate chain and private key are used to configure a key manager to provide the client's identity. If no certificate chain and private key are provided the client will have no identity. The root certificates are used to configure a trust manager for verifying the server's identity. If no root certificates are provided the trust manager will default to the system's root certificates. -
CUSTOM_MANAGERS
Key managers and trust managers may be specified asKeyManager
andTrustManager
objects. This feature requires observingTlsChannelCredentials.getKeyManagers()
andTlsChannelCredentials.getTrustManagers()
. GenerallyMTLS
should also be supported, as that is the more common method of configuration. When a manager is non-null
, then it is wholly responsible for key or trust material and usage; there is no need to check other manager sources likeTlsChannelCredentials.getCertificateChain()
orTlsChannelCredentials.getPrivateKey()
(ifKeyManager
is available), orTlsChannelCredentials.getRootCertificates()
(ifTrustManager
is available).If other manager sources are available (e.g.,
getPrivateKey() != null
), then they may be alternative representations of the same configuration and the consumer is free to use those alternative representations if it prefers. But before doing so it must first check that it understands that alternative representation by usingTlsChannelCredentials.incomprehensible(java.util.Set<io.grpc.TlsChannelCredentials.Feature>)
without theCUSTOM_MANAGERS
feature.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-