View Javadoc
1   /*
2    * Copyright 2019 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://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, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  
17  package io.netty.handler.ssl.util;
18  
19  import java.net.Socket;
20  import java.security.Principal;
21  import java.security.PrivateKey;
22  import java.security.cert.X509Certificate;
23  import javax.net.ssl.SSLEngine;
24  import javax.net.ssl.X509ExtendedKeyManager;
25  import javax.net.ssl.X509KeyManager;
26  
27  import static io.netty.util.internal.ObjectUtil.checkNotNull;
28  
29  final class X509KeyManagerWrapper extends X509ExtendedKeyManager {
30  
31      private final X509KeyManager delegate;
32  
33      X509KeyManagerWrapper(X509KeyManager delegate) {
34          this.delegate = checkNotNull(delegate, "delegate");
35      }
36  
37      @Override
38      public String[] getClientAliases(String var1, Principal[] var2) {
39          return delegate.getClientAliases(var1, var2);
40      }
41  
42      @Override
43      public String chooseClientAlias(String[] var1, Principal[] var2, Socket var3) {
44          return delegate.chooseClientAlias(var1, var2, var3);
45      }
46  
47      @Override
48      public String[] getServerAliases(String var1, Principal[] var2) {
49          return delegate.getServerAliases(var1, var2);
50      }
51  
52      @Override
53      public String chooseServerAlias(String var1, Principal[] var2, Socket var3) {
54          return delegate.chooseServerAlias(var1, var2, var3);
55      }
56  
57      @Override
58      public X509Certificate[] getCertificateChain(String var1) {
59          return delegate.getCertificateChain(var1);
60      }
61  
62      @Override
63      public PrivateKey getPrivateKey(String var1) {
64          return delegate.getPrivateKey(var1);
65      }
66  
67      @Override
68      public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine) {
69          return delegate.chooseClientAlias(keyType, issuers, null);
70      }
71  
72      @Override
73      public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {
74          return delegate.chooseServerAlias(keyType, issuers, null);
75      }
76  }