# KeyManagerFactorySpi

public abstract class **KeyManagerFactorySpi** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
This class defines the *Service Provider Interface* (**SPI** )
for the `KeyManagerFactory` class.

All the abstract methods in this class must be implemented by each
cryptographic service provider who wishes to supply the implementation
of a particular key manager factory.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactory.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManager.html`

### Public Constructor Summary

|---|---|
|   | [KeyManagerFactorySpi](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactorySpi.html#KeyManagerFactorySpi())() |

### Protected Method Summary

|---|---|
| abstract [KeyManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManager.html) | [engineGetKeyManagers](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactorySpi.html#engineGetKeyManagers())() Returns one key manager for each type of key material. |
| abstract void | [engineInit](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactorySpi.html#engineInit(javax.net.ssl.ManagerFactoryParameters))([ManagerFactoryParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/ManagerFactoryParameters.html) spec) Initializes this factory with a source of key material. |
| abstract void | [engineInit](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactorySpi.html#engineInit(java.security.KeyStore,%20char[]))([KeyStore](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStore.html) ks, char\[\] password) Initializes this factory with a source of key material. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**KeyManagerFactorySpi**
()

<br />

## Protected Methods

#### protected abstract [KeyManager\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManager.html)
**engineGetKeyManagers**
()

Returns one key manager for each type of key material.

##### Returns

- the key managers

##### Throws

| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if the KeyManagerFactorySpi is not initialized |
|---|---|

#### protected abstract void
**engineInit**
([ManagerFactoryParameters](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/ManagerFactoryParameters.html) spec)

Initializes this factory with a source of key material.


In some cases, initialization parameters other than a keystore
and password may be needed by a provider. Users of that
particular provider are expected to pass an implementation of
the appropriate `ManagerFactoryParameters` as
defined by the provider. The provider can then call the
specified methods in the ManagerFactoryParameters
implementation to obtain the needed information.

##### Parameters

| spec | an implementation of a provider-specific parameter specification |
|---|---|

##### Throws

| [InvalidAlgorithmParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidAlgorithmParameterException.html) | if there is problem with the parameters |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactory.html#init(javax.net.ssl.ManagerFactoryParameters)`

#### protected abstract void
**engineInit**
([KeyStore](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStore.html) ks, char\[\] password)

Initializes this factory with a source of key material.

##### Parameters

| ks | the key store or null |
| password | the password for recovering keys |
|---|---|

##### Throws

| [KeyStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStoreException.html) | if this operation fails |
| [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | if the specified algorithm is not available from the specified provider. |
| [UnrecoverableKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableKeyException.html) | if the key cannot be recovered |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/KeyManagerFactory.html#init(java.security.KeyStore,%20char[])`