Stay organized with collections
Save and categorize content based on your preferences.
TrustManagerFactorySpi
abstract class TrustManagerFactorySpi
This class defines the Service Provider Interface (SPI) for the TrustManagerFactory
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 trust manager factory.
Summary
Protected methods |
abstract Array<TrustManager!>! |
Returns one trust manager for each type of trust material.
|
abstract Unit |
Initializes this factory with a source of certificate authorities and related trust material.
|
abstract Unit |
Initializes this factory with a source of provider-specific key material.
|
Public constructors
TrustManagerFactorySpi
TrustManagerFactorySpi()
Protected methods
engineGetTrustManagers
protected abstract fun engineGetTrustManagers(): Array<TrustManager!>!
Returns one trust manager for each type of trust material.
Exceptions |
java.lang.IllegalStateException |
if the factory is not initialized. |
engineInit
protected abstract fun engineInit(ks: KeyStore!): Unit
Initializes this factory with a source of certificate authorities and related trust material.
Parameters |
ks |
KeyStore!: the key store or null |
Exceptions |
java.security.KeyStoreException |
if this operation fails |
engineInit
protected abstract fun engineInit(spec: ManagerFactoryParameters!): Unit
Initializes this factory with a source of provider-specific key material.
In some cases, initialization parameters other than a keystore 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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TrustManagerFactorySpi\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTrustManagerFactorySpi\n======================\n\n```\nabstract class TrustManagerFactorySpi\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.net.ssl.TrustManagerFactorySpi](#) |\n\nThis class defines the *Service Provider Interface* (**SPI** ) for the `TrustManagerFactory` 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 trust manager factory.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------|---|\n| [TrustManagerFactorySpi](#TrustManagerFactorySpi())`()` \u003cbr /\u003e |\n\n| Protected methods ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\\\u003c[TrustManager](/reference/kotlin/javax/net/ssl/TrustManager)!\\\u003e! | [engineGetTrustManagers](#engineGetTrustManagers())`()` Returns one trust manager for each type of trust material. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [engineInit](#engineInit(java.security.KeyStore))`(`ks:` `[KeyStore](../../../java/security/KeyStore.html#)!`)` Initializes this factory with a source of certificate authorities and related trust 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 provider-specific key material. |\n\nPublic constructors\n-------------------\n\n### TrustManagerFactorySpi\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nTrustManagerFactorySpi()\n```\n\nProtected methods\n-----------------\n\n### engineGetTrustManagers\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected abstract fun engineGetTrustManagers(): Array\u003cTrustManager!\u003e!\n```\n\nReturns one trust manager for each type of trust material.\n\n| Return ||\n|------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|\n| [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\u003c[TrustManager](/reference/kotlin/javax/net/ssl/TrustManager)!\u003e! | the trust managers |\n\n| Exceptions ||\n|-----------------------------------|------------------------------------|\n| `java.lang.IllegalStateException` | if the factory 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(ks: KeyStore!): Unit\n```\n\nInitializes this factory with a source of certificate authorities and related trust material.\n\n| Parameters ||\n|------|---------------------------------------------------------------------------|\n| `ks` | [KeyStore](../../../java/security/KeyStore.html#)!: the key store or null |\n\n| Exceptions ||\n|-----------------------------------|-------------------------|\n| `java.security.KeyStoreException` | if this operation fails |\n\n**See Also**\n\n- [javax.net.ssl.TrustManagerFactory#init(KeyStore)](/reference/kotlin/javax/net/ssl/TrustManagerFactory#init(java.security.KeyStore)) \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 provider-specific key material.\n\nIn some cases, initialization parameters other than a keystore 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.TrustManagerFactory#init(ManagerFactoryParameters spec)](/reference/kotlin/javax/net/ssl/TrustManagerFactory#init(javax.net.ssl.ManagerFactoryParameters))"]]