1 17 18 package org.apache.tomcat.util.net.jsse; 19 20 import java.net.Socket ; 21 import java.security.Principal ; 22 import java.security.PrivateKey ; 23 import java.security.cert.X509Certificate ; 24 import javax.net.ssl.X509KeyManager; 25 26 33 public final class JSSEKeyManager implements X509KeyManager { 34 35 private X509KeyManager delegate; 36 private String serverKeyAlias; 37 38 45 public JSSEKeyManager(X509KeyManager mgr, String serverKeyAlias) { 46 this.delegate = mgr; 47 this.serverKeyAlias = serverKeyAlias; 48 } 49 50 66 public String chooseClientAlias(String [] keyType, Principal [] issuers, 67 Socket socket) { 68 return delegate.chooseClientAlias(keyType, issuers, socket); 69 } 70 71 84 public String chooseServerAlias(String keyType, Principal [] issuers, 85 Socket socket) { 86 return serverKeyAlias; 87 } 88 89 98 public X509Certificate [] getCertificateChain(String alias) { 99 return delegate.getCertificateChain(alias); 100 } 101 102 114 public String [] getClientAliases(String keyType, Principal [] issuers) { 115 return delegate.getClientAliases(keyType, issuers); 116 } 117 118 130 public String [] getServerAliases(String keyType, Principal [] issuers) { 131 return delegate.getServerAliases(keyType, issuers); 132 } 133 134 141 public PrivateKey getPrivateKey(String alias) { 142 return delegate.getPrivateKey(alias); 143 } 144 } 145 | Popular Tags |