forCurrentPlatform

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

Creates a password 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): PasswordStore(source)

Creates a password store isolated by both serviceName and accountName.

Android callers must use the Context-taking overload instead; this overload always returns a store that throws KeychainUnavailableException on Android.

Parameters

serviceName

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

accountName

identifies the credential owner. Same validity rules as serviceName.

options

platform-specific behavior; options that don't apply to the current platform are ignored.

Throws

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