Package org.apache.synapse.transport.nhttp.config

# Class AliasBasedKeyManager

java.lang.Object
javax.net.ssl.X509ExtendedKeyManager
org.apache.synapse.transport.nhttp.config.AliasBasedKeyManager

All Implemented Interfaces:
  `KeyManager`, `X509KeyManager`

public class AliasBasedKeyManager extends X509ExtendedKeyManager
Custom X509KeyManager that selects a specific alias for client and server certificates

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AliasBasedKeyManager(X509KeyManager keyManager, String preferredKeyAlias)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)`
  `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 javax.net.ssl.X509ExtendedKeyManager

  `chooseEngineClientAlias`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### AliasBasedKeyManager

    public AliasBasedKeyManager(X509KeyManager keyManager, String preferredKeyAlias)

- ## Method Details

  - ### getClientAliases

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

  - ### chooseClientAlias

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

  - ### 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`

  - ### getCertificateChain

    public X509Certificate[] getCertificateChain(String alias)

  - ### getPrivateKey

    public PrivateKey getPrivateKey(String alias)