IosPlatformKeyProvider

class IosPlatformKeyProvider(useSecureElement: Boolean = true) : PlatformKeyProvider

PlatformKeyProvider implementation backed by iOS Keychain and Secure Enclave.

Parameters

useSecureElement

When true, P-256 keys are created in Secure Enclave where available.

Constructors

Link copied to clipboard
constructor(useSecureElement: Boolean = true)

Properties

Link copied to clipboard

Whether the current device and provider can use platform-backed storage.

Link copied to clipboard
open override val supportedPlatformKeyTypes: Set<KeyType>

iOS platform-backed key types supported by this provider.

Functions

Link copied to clipboard
open suspend override fun deleteKey(keyId: String, keyType: KeyType): Boolean

Deletes an iOS key by identifier and expected key type.

Link copied to clipboard
open suspend override fun exportSoftwareKeyMaterial(key: Key): ByteArray

Exports serialized JWK material from an iOS software key.

Link copied to clipboard
open suspend override fun generateKey(keyType: KeyType, keyId: String? = null): Key

Generates an iOS platform-backed key for supported types, otherwise a software key.

Link copied to clipboard
open fun isPlatformBacked(keyType: KeyType): Boolean

Returns whether keyType is created with platform-backed storage by this provider.

Link copied to clipboard
open suspend override fun loadKey(keyId: String, keyType: KeyType): Key?

Loads an iOS key by identifier and expected key type.

Link copied to clipboard
open suspend override fun loadSoftwareKey(keyId: String, keyType: KeyType, jwkMaterial: ByteArray): Key?

Loads an iOS software key from serialized JWK material.