forCurrentPlatform

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

Creates a certificate 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): CertificateStore(source)

Creates a certificate store isolated by both serviceName and accountName. Desktop JVM keeps identities in the macOS login keychain, the Windows current-user certificate store, or Linux Secret Service. Android callers must use the Context-taking overload instead; this overload returns a store that throws KeychainUnavailableException on Android. Apple platforms store identities in the data-protection keychain, which needs an app with keychain entitlements (unsigned macOS processes get reason Unsupported) and macOS 15 or later on macOS. One identity can be stored under only one alias per keychain.

Parameters

serviceName

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

accountName

identifies the certificate owner. Same validity rules as serviceName.

options

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

Throws

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