# Class MariaDbX509KeyManager

java.lang.Object
javax.net.ssl.X509ExtendedKeyManager
org.mariadb.jdbc.internal.protocol.tls.MariaDbX509KeyManager

All Implemented Interfaces:
  `KeyManager, X509KeyManager`

public class MariaDbX509KeyManager extends X509ExtendedKeyManager
Key manager implementation that implement only client verification and rely only on private key for mutual authentication, without Server Name Indication (SNI) verification.

## Constructor Summary

Constructors
Constructor
Description
`MariaDbX509KeyManager(KeyStore keyStore, char[] pwd)`
Creates Key manager.

## Method Summary

Modifier and Type
Method
Description
`String`
`chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)`
`String`
`chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)`
`String`
`chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)`
`String`
`chooseServerAlias(String keyType, Principal[] issuers, Socket socket)`
`X509Certificate[]`
`getCertificateChain(String alias)`
`String[]`
`getClientAliases(String keyType, Principal[] issuers)`
`PrivateKey`
`getPrivateKey(String alias)`
`String[]`
`getServerAliases(String keyType, Principal[] issuers)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MariaDbX509KeyManager

public MariaDbX509KeyManager(KeyStore keyStore, char[] pwd) throws KeyStoreException
Creates Key manager.

Parameters:
  `keyStore` - keyStore (must have been initialized)
  `pwd` - keyStore password
Throws:
  `KeyStoreException` - if keyStore hasn't been initialized.

## Method Details

### getClientAliases

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

### chooseClientAlias

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

### getCertificateChain

public X509Certificate[] getCertificateChain(String alias)

### chooseEngineClientAlias

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

Overrides:
  `chooseEngineClientAlias` in class `X509ExtendedKeyManager`

### getPrivateKey

public PrivateKey getPrivateKey(String alias)

### getServerAliases

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

### chooseServerAlias

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

### chooseEngineServerAlias

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

Overrides:
  `chooseEngineServerAlias` in class `X509ExtendedKeyManager`