forCurrentPlatform

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

Creates a store isolated by both 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): CredentialKeychain(source)

Creates a store isolated by both serviceName and accountName — two calls with different values for either parameter address disjoint sets of entries, so one process can keep separate stores per app, environment, or signed-in user.

Android callers must use the Context-taking overload declared alongside AndroidKeychain 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 (for example, a signed-in user id). 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.