Stay organized with collections
Save and categorize content based on your preferences.
KeyManagerFactorySpi
abstract class KeyManagerFactorySpi
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.
Summary
Protected methods |
abstract Array<KeyManager!>! |
Returns one key manager for each type of key material.
|
abstract Unit |
Initializes this factory with a source of key material.
|
abstract Unit |
Initializes this factory with a source of key material.
|
Public constructors
KeyManagerFactorySpi
KeyManagerFactorySpi()
Protected methods
engineGetKeyManagers
protected abstract fun engineGetKeyManagers(): Array<KeyManager!>!
Returns one key manager for each type of key material.
Exceptions |
java.lang.IllegalStateException |
if the KeyManagerFactorySpi is not initialized |
engineInit
protected abstract fun engineInit(
ks: KeyStore!,
password: CharArray!
): Unit
Initializes this factory with a source of key material.
Parameters |
ks |
KeyStore!: the key store or null |
password |
CharArray!: the password for recovering keys |
Exceptions |
java.security.KeyStoreException |
if this operation fails |
java.security.NoSuchAlgorithmException |
if the specified algorithm is not available from the specified provider. |
java.security.UnrecoverableKeyException |
if the key cannot be recovered |
engineInit
protected abstract fun engineInit(spec: ManagerFactoryParameters!): Unit
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.
Exceptions |
java.security.InvalidAlgorithmParameterException |
if there is problem with the parameters |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# KeyManagerFactorySpi\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nKeyManagerFactorySpi\n====================\n\n```\nabstract class KeyManagerFactorySpi\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.net.ssl.KeyManagerFactorySpi](#) |\n\nThis class defines the *Service Provider Interface* (**SPI** ) for the `KeyManagerFactory` class.\n\nAll 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.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------|---|\n| [KeyManagerFactorySpi](#KeyManagerFactorySpi())`()` \u003cbr /\u003e |\n\n| Protected methods ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\\\u003c[KeyManager](/reference/kotlin/javax/net/ssl/KeyManager)!\\\u003e! | [engineGetKeyManagers](#engineGetKeyManagers())`()` Returns one key manager for each type of key material. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [engineInit](#engineInit(java.security.KeyStore,%20kotlin.CharArray))`(`ks:` `[KeyStore](../../../java/security/KeyStore.html#)!`, `password:` `[CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!`)` Initializes this factory with a source of key material. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [engineInit](#engineInit(javax.net.ssl.ManagerFactoryParameters))`(`spec:` `[ManagerFactoryParameters](/reference/kotlin/javax/net/ssl/ManagerFactoryParameters)!`)` Initializes this factory with a source of key material. |\n\nPublic constructors\n-------------------\n\n### KeyManagerFactorySpi\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nKeyManagerFactorySpi()\n```\n\nProtected methods\n-----------------\n\n### engineGetKeyManagers\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected abstract fun engineGetKeyManagers(): Array\u003cKeyManager!\u003e!\n```\n\nReturns one key manager for each type of key material.\n\n| Return ||\n|--------------------------------------------------------------------------------------------------------------------------------------------|------------------|\n| [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\u003c[KeyManager](/reference/kotlin/javax/net/ssl/KeyManager)!\u003e! | the key managers |\n\n| Exceptions ||\n|-----------------------------------|------------------------------------------------|\n| `java.lang.IllegalStateException` | if the KeyManagerFactorySpi is not initialized |\n\n### engineInit\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected abstract fun engineInit(\n ks: KeyStore!, \n password: CharArray!\n): Unit\n```\n\nInitializes this factory with a source of key material.\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------------------------------------------------|\n| `ks` | [KeyStore](../../../java/security/KeyStore.html#)!: the key store or null |\n| `password` | [CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!: the password for recovering keys |\n\n| Exceptions ||\n|-------------------------------------------|--------------------------------------------------------------------------|\n| `java.security.KeyStoreException` | if this operation fails |\n| `java.security.NoSuchAlgorithmException` | if the specified algorithm is not available from the specified provider. |\n| `java.security.UnrecoverableKeyException` | if the key cannot be recovered |\n\n**See Also**\n\n- [javax.net.ssl.KeyManagerFactory#init(KeyStore, char[])](/reference/kotlin/javax/net/ssl/KeyManagerFactory#init(java.security.KeyStore,%20kotlin.CharArray)) \n\n### engineInit\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected abstract fun engineInit(spec: ManagerFactoryParameters!): Unit\n```\n\nInitializes this factory with a source of key material.\n\nIn 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.\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spec` | [ManagerFactoryParameters](/reference/kotlin/javax/net/ssl/ManagerFactoryParameters)!: an implementation of a provider-specific parameter specification |\n\n| Exceptions ||\n|----------------------------------------------------|-----------------------------------------|\n| `java.security.InvalidAlgorithmParameterException` | if there is problem with the parameters |\n\n**See Also**\n\n- [javax.net.ssl.KeyManagerFactory#init(ManagerFactoryParameters spec)](/reference/kotlin/javax/net/ssl/KeyManagerFactory#init(javax.net.ssl.ManagerFactoryParameters))"]]