1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
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  * A copy of the License is located at
7  *
8  *  http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 package software.amazon.awssdk.http;
17 
18 import javax.net.ssl.KeyManager;
19 import software.amazon.awssdk.annotations.SdkPublicApi;
20 import software.amazon.awssdk.internal.http.NoneTlsKeyManagersProvider;
21 
22 /**
23  * Provider for the {@link KeyManager key managers} to be used by the SDK when
24  * creating the SSL context. Key managers are used when the client is required
25  * to authenticate with the remote TLS peer, such as an HTTP proxy.
26  */
27 @SdkPublicApi
28 @FunctionalInterface
29 public interface TlsKeyManagersProvider {
30 
31     /**
32      * @return The {@link KeyManager}s, or {@code null}.
33      */
keyManagers()34     KeyManager[] keyManagers();
35 
36     /**
37      * @return A provider that returns a {@code null} array of {@link KeyManager}s.
38      */
noneProvider()39     static TlsKeyManagersProvider noneProvider() {
40         return NoneTlsKeyManagersProvider.getInstance();
41     }
42 }
43