Package org.opensaml.security.x509.tls.impl

# Class StaticX509CredentialKeyManager

java.lang.Object
org.opensaml.security.x509.tls.impl.StaticX509CredentialKeyManager

All Implemented Interfaces:
  `KeyManager`, `X509KeyManager`

public class StaticX509CredentialKeyManager extends Object implements X509KeyManager
An implementation of `X509KeyManager` based on a single statically configured private key and certificate chain, supplied either directly or via an instance of `X509Credential`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private X509Certificate[]`
`certificateChain`
The certificate chain instance.
`private String`
`internalAlias`
The alias representing the supplied static credential.
`private org.slf4j.Logger`
`log`
Logger.
`private PrivateKey`
`privateKey`
The private key instance.

## Constructor Summary

Constructors
Constructor
Description
`StaticX509CredentialKeyManager(PrivateKey key, Collection<X509Certificate> chain)`
Constructor.
`StaticX509CredentialKeyManager(X509Credential credential)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`chooseClientAlias(String[] arg0, Principal[] arg1, Socket arg2)`
`String`
`chooseServerAlias(String arg0, Principal[] arg1, Socket arg2)`
`X509Certificate[]`
`getCertificateChain(String arg0)`
`String[]`
`getClientAliases(String arg0, Principal[] arg1)`
`PrivateKey`
`getPrivateKey(String arg0)`
`String[]`
`getServerAliases(String arg0, Principal[] arg1)`

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

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

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Logger.

### privateKey

@Nonnull private PrivateKey privateKey
The private key instance.

### certificateChain

@Nonnull private X509Certificate[] certificateChain
The certificate chain instance.

### internalAlias

@Nonnull private String internalAlias
The alias representing the supplied static credential.

## Constructor Details

### StaticX509CredentialKeyManager

public StaticX509CredentialKeyManager(X509Credential credential)
Constructor.

Parameters:
  `credential` - the static credential managed by this key manager

### StaticX509CredentialKeyManager

public StaticX509CredentialKeyManager(PrivateKey key, Collection<X509Certificate> chain)
Constructor.

Parameters:
  `key` - the private key managed by this key manager
  `chain` - the certificate chain managed by this key manager

## Method Details

### chooseClientAlias

public String chooseClientAlias(String[] arg0, Principal[] arg1, Socket arg2)

Specified by:
  `chooseClientAlias` in interface `X509KeyManager`

### getClientAliases

public String[] getClientAliases(String arg0, Principal[] arg1)

Specified by:
  `getClientAliases` in interface `X509KeyManager`

### getCertificateChain

public X509Certificate[] getCertificateChain(String arg0)

Specified by:
  `getCertificateChain` in interface `X509KeyManager`

### getPrivateKey

public PrivateKey getPrivateKey(String arg0)

Specified by:
  `getPrivateKey` in interface `X509KeyManager`

### chooseServerAlias

public String chooseServerAlias(String arg0, Principal[] arg1, Socket arg2)

Specified by:
  `chooseServerAlias` in interface `X509KeyManager`

### getServerAliases

public String[] getServerAliases(String arg0, Principal[] arg1)

Specified by:
  `getServerAliases` in interface `X509KeyManager`