APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.ssl

pack-priv final Class SunX509KeyManagerImpl

extends X509KeyManagerCertChecking
Class Inheritance
Imports
java.net.Socket, java.security.AlgorithmConstraints, .Key, .KeyStore, .KeyStoreException, .NoSuchAlgorithmException, .Principal, .PrivateKey, .UnrecoverableKeyException, java.security.cert.Certificate, .X509Certificate, java.util.ArrayList, .Collections, .Enumeration, .HashMap, .List, .Map, .Set, javax.net.ssl.SNIServerName, .SSLEngine, javax.security.auth.x500.X500Principal

An implementation of X509KeyManager backed by a KeyStore.

The backing KeyStore is inspected when this object is constructed. All key entries containing a PrivateKey and a non-empty chain of X509Certificate are then copied into an internal store. This means that subsequent modifications of the KeyStore have no effect on the X509KeyManagerImpl object.

Note that this class assumes that all keys are protected by the same password.

Algorithm constraints and certificate checks can be disabled by setting "jdk.tls.SunX509KeyManager.certChecking" system property to "false" before calling a class constructor.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, SunX509KeyManagerImpl.X509Credentials>

Constructor Summary

AccessConstructor and Description
pack-priv
SunX509KeyManagerImpl(KeyStore ks, char[] password)

Method Summary

Modifier and TypeMethod and Description
private String
chooseAlias(List<X509KeyManagerCertChecking.KeyType> keyTypes, Principal[] issuers, X509KeyManagerCertChecking.CheckType checkType, AlgorithmConstraints constraints, List<SNIServerName> requestedServerNames, String idAlgorithm)

public String
chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket)

Implements javax.net.ssl.X509KeyManager.chooseClientAlias.

Choose an alias to authenticate the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

public String
chooseEngineClientAlias(String[] keyTypes, Principal[] issuers, SSLEngine engine)

Overrides javax.net.ssl.X509ExtendedKeyManager.chooseEngineClientAlias.

Choose an alias to authenticate the client side of an SSLEngine connection given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

public String
chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)

Overrides javax.net.ssl.X509ExtendedKeyManager.chooseEngineServerAlias.

Choose an alias to authenticate the server side of an SSLEngine connection given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

pack-priv String
pack-priv String
public String
chooseServerAlias(String keyType, Principal[] issuers, Socket socket)

Implements javax.net.ssl.X509KeyManager.chooseServerAlias.

Choose an alias to authenticate the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

private String[]
getAliases(List<X509KeyManagerCertChecking.KeyType> keyTypes, Principal[] issuers, X509KeyManagerCertChecking.CheckType checkType, AlgorithmConstraints constraints, List<SNIServerName> requestedServerNames, String idAlgorithm)

public X509Certificate[]
getCertificateChain(String alias)

Implements javax.net.ssl.X509KeyManager.getCertificateChain.

Returns the certificate chain associated with the given alias.

public String[]
getClientAliases(String keyType, Principal[] issuers)

Implements javax.net.ssl.X509KeyManager.getClientAliases.

Get the matching aliases for authenticating the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

public PrivateKey
getPrivateKey(String alias)

Implements javax.net.ssl.X509KeyManager.getPrivateKey.

Returns the key associated with the given alias.

public String[]
getServerAliases(String keyType, Principal[] issuers)

Implements javax.net.ssl.X509KeyManager.getServerAliases.

Get the matching aliases for authenticating the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

protected boolean
Inherited from sun.security.ssl.X509KeyManagerCertChecking:
checkAliasgetAlgorithmConstraintsgetAlgorithmConstraintsgetAlgorithmConstraintsgetIssuerSetgetKeyTypes

Field Detail

credentialsMapback to summary
private final Map<String, SunX509KeyManagerImpl.X509Credentials> credentialsMap

Constructor Detail

SunX509KeyManagerImplback to summary
pack-priv SunX509KeyManagerImpl(KeyStore ks, char[] password) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

Method Detail

chooseAliasback to summary
private String chooseAlias(List<X509KeyManagerCertChecking.KeyType> keyTypes, Principal[] issuers, X509KeyManagerCertChecking.CheckType checkType, AlgorithmConstraints constraints, List<SNIServerName> requestedServerNames, String idAlgorithm)
chooseClientAliasback to summary
public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket)

Implements javax.net.ssl.X509KeyManager.chooseClientAlias.

Doc from javax.net.ssl.X509KeyManager.chooseClientAlias.

Choose an alias to authenticate the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

Annotations
@Override
chooseEngineClientAliasback to summary
public String chooseEngineClientAlias(String[] keyTypes, Principal[] issuers, SSLEngine engine)

Overrides javax.net.ssl.X509ExtendedKeyManager.chooseEngineClientAlias.

Doc from javax.net.ssl.X509ExtendedKeyManager.chooseEngineClientAlias.

Choose an alias to authenticate the client side of an SSLEngine connection given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

The default implementation returns null.

Annotations
@Override
chooseEngineServerAliasback to summary
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)

Overrides javax.net.ssl.X509ExtendedKeyManager.chooseEngineServerAlias.

Doc from javax.net.ssl.X509ExtendedKeyManager.chooseEngineServerAlias.

Choose an alias to authenticate the server side of an SSLEngine connection given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

The default implementation returns null.

Annotations
@Override
chooseQuicClientAliasback to summary
pack-priv String chooseQuicClientAlias(String[] keyTypes, Principal[] issuers, QuicTLSEngineImpl quicTLSEngine)

Implements abstract sun.security.ssl.X509KeyManagerCertChecking.chooseQuicClientAlias.

Annotations
@Override
chooseQuicServerAliasback to summary
pack-priv String chooseQuicServerAlias(String keyType, X500Principal[] issuers, QuicTLSEngineImpl quicTLSEngine)

Implements abstract sun.security.ssl.X509KeyManagerCertChecking.chooseQuicServerAlias.

Annotations
@Override
chooseServerAliasback to summary
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)

Implements javax.net.ssl.X509KeyManager.chooseServerAlias.

Doc from javax.net.ssl.X509KeyManager.chooseServerAlias.

Choose an alias to authenticate the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

Annotations
@Override
getAliasesback to summary
private String[] getAliases(List<X509KeyManagerCertChecking.KeyType> keyTypes, Principal[] issuers, X509KeyManagerCertChecking.CheckType checkType, AlgorithmConstraints constraints, List<SNIServerName> requestedServerNames, String idAlgorithm)
getCertificateChainback to summary
public X509Certificate[] getCertificateChain(String alias)

Implements javax.net.ssl.X509KeyManager.getCertificateChain.

Doc from javax.net.ssl.X509KeyManager.getCertificateChain.

Returns the certificate chain associated with the given alias.

Annotations
@Override
getClientAliasesback to summary
public String[] getClientAliases(String keyType, Principal[] issuers)

Implements javax.net.ssl.X509KeyManager.getClientAliases.

Doc from javax.net.ssl.X509KeyManager.getClientAliases.

Get the matching aliases for authenticating the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

Annotations
@Override
getPrivateKeyback to summary
public PrivateKey getPrivateKey(String alias)

Implements javax.net.ssl.X509KeyManager.getPrivateKey.

Doc from javax.net.ssl.X509KeyManager.getPrivateKey.

Returns the key associated with the given alias.

Annotations
@Override
getServerAliasesback to summary
public String[] getServerAliases(String keyType, Principal[] issuers)

Implements javax.net.ssl.X509KeyManager.getServerAliases.

Doc from javax.net.ssl.X509KeyManager.getServerAliases.

Get the matching aliases for authenticating the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).

Annotations
@Override
isCheckingDisabledback to summary
protected boolean isCheckingDisabled()

Implements abstract sun.security.ssl.X509KeyManagerCertChecking.isCheckingDisabled.

Annotations
@Override
sun.security.ssl back to summary

private Class SunX509KeyManagerImpl.X509Credentials

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final X509Certificate[]
pack-priv final PrivateKey

Constructor Summary

AccessConstructor and Description
pack-priv
X509Credentials(PrivateKey privateKey, X509Certificate[] certificates)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certificatesback to summary
pack-priv final X509Certificate[] certificates
privateKeyback to summary
pack-priv final PrivateKey privateKey

Constructor Detail

X509Credentialsback to summary
pack-priv X509Credentials(PrivateKey privateKey, X509Certificate[] certificates)