forCurrentPlatform

fun forCurrentPlatform(serviceName: String, accountName: String = serviceName): HardwareKeyStore(source)

Creates a key store isolated by serviceName and accountName using default KeychainOptions. See the three-argument overload for details.

Throws

if serviceName or accountName is blank or contains NUL, CR, or LF.


fun forCurrentPlatform(serviceName: String, accountName: String, options: KeychainOptions): HardwareKeyStore(source)

Creates a key store isolated by both serviceName and accountName. Unlike the other stores, Android needs no Context: keys live only in Android Keystore. Desktop JVM returns a store whose operations throw KeychainUnavailableException with reason Unsupported.

Parameters

serviceName

identifies the calling application or integration; must be nonblank and free of NUL/CR/LF.

accountName

identifies the key owner. Same validity rules as serviceName.

options

platform-specific behavior; KeychainOptions.appleAccessibility controls when Apple keys can sign.

Throws

if serviceName or accountName is blank or contains NUL, CR, or LF.