1 /* 2 * Copyright 2020 The gRPC Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package io.grpc; 18 19 /** 20 * Represents a security configuration to be used for servers. There is no generic mechanism for 21 * processing arbitrary {@code ServerCredentials}; the consumer of the credential (the server) 22 * must support each implementation explicitly and separately. Consumers are not required to support 23 * all types or even all possible configurations for types that are partially supported, but they 24 * <em>must</em> at least fully support {@link ChoiceServerCredentials}. 25 * 26 * <p>A {@code ServerCredential} provides server identity. They can also influence types of 27 * encryption used and similar security configuration. 28 * 29 * <p>The concrete credential type should not be relevant to most users of the API and may be an 30 * implementation decision. Users should generally use the {@code ServerCredentials} type for 31 * variables instead of the concrete type. Freshly-constructed credentials should be returned as 32 * {@code ServerCredentials} instead of a concrete type to encourage this pattern. Concrete types 33 * would only be used after {@code instanceof} checks (which must consider 34 * {@code ChoiceServerCredentials}!). 35 */ 36 public abstract class ServerCredentials {} 37