Package io.grpc
Class ServerCredentials
- java.lang.Object
-
- io.grpc.ServerCredentials
-
- Direct Known Subclasses:
ChoiceServerCredentials
,InsecureServerCredentials
,TlsServerCredentials
public abstract class ServerCredentials extends Object
Represents a security configuration to be used for servers. There is no generic mechanism for processing arbitraryServerCredentials
; the consumer of the credential (the server) must support each implementation explicitly and separately. Consumers are not required to support all types or even all possible configurations for types that are partially supported, but they must at least fully supportChoiceServerCredentials
.A
ServerCredential
provides server identity. They can also influence types of encryption used and similar security configuration.The concrete credential type should not be relevant to most users of the API and may be an implementation decision. Users should generally use the
ServerCredentials
type for variables instead of the concrete type. Freshly-constructed credentials should be returned asServerCredentials
instead of a concrete type to encourage this pattern. Concrete types would only be used afterinstanceof
checks (which must considerChoiceServerCredentials
!).