Package io.grpc
Enum TlsServerCredentials.Feature
- java.lang.Object
-
- java.lang.Enum<TlsServerCredentials.Feature>
-
- io.grpc.TlsServerCredentials.Feature
-
- All Implemented Interfaces:
Serializable
,Comparable<TlsServerCredentials.Feature>
- Enclosing class:
- TlsServerCredentials
public static enum TlsServerCredentials.Feature extends Enum<TlsServerCredentials.Feature>
Features to understand TLS configuration. Additional enum values may be added in the future.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CUSTOM_MANAGERS
Key managers and trust managers may be specified asKeyManager
andTrustManager
objects.FAKE
A feature that no consumer should understand.MTLS
Client certificates may be requested and verified.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TlsServerCredentials.Feature
valueOf(String name)
Returns the enum constant of this type with the specified name.static TlsServerCredentials.Feature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FAKE
public static final TlsServerCredentials.Feature FAKE
A feature that no consumer should understand. It should be used for unit testing to confirm a call toincomprehensible()
is implemented properly.
-
MTLS
public static final TlsServerCredentials.Feature MTLS
Client certificates may be requested and verified. This feature requires observingTlsServerCredentials.getRootCertificates()
andTlsServerCredentials.getClientAuth()
. The root certificates are used to configure a trust manager for verifying the client's identity. If no root certificates are provided the trust manager will default to the system's root certificates.
-
CUSTOM_MANAGERS
public static final TlsServerCredentials.Feature CUSTOM_MANAGERS
Key managers and trust managers may be specified asKeyManager
andTrustManager
objects. This feature by itself only impliesTlsServerCredentials.getKeyManagers()
needs to be observed. But along withMTLS
, thenTlsServerCredentials.getTrustManagers()
needs to be observed as well. 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 likeTlsServerCredentials.getCertificateChain()
orTlsServerCredentials.getPrivateKey()
(ifKeyManager
is available), orTlsServerCredentials.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 usingTlsServerCredentials.incomprehensible(java.util.Set<io.grpc.TlsServerCredentials.Feature>)
without theCUSTOM_MANAGERS
feature.
-
-
Method Detail
-
values
public static TlsServerCredentials.Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TlsServerCredentials.Feature c : TlsServerCredentials.Feature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TlsServerCredentials.Feature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
-