Package-level declarations
The shared credential storage interface, platform factories, options, and failure type.
com.maniramezan.credentialkeychain.CredentialKeychain — the storage interface plus the
forCurrentPlatformfactories on its companion object (Android adds aContext-taking overload of the same name in this package).com.maniramezan.credentialkeychain.PasswordStore and com.maniramezan.credentialkeychain.PasswordCredential — username/password storage per server, with the same factories (and the same Android
Context-taking overload).com.maniramezan.credentialkeychain.HardwareKeyStore, com.maniramezan.credentialkeychain.HardwareKeySpec, com.maniramezan.credentialkeychain.HardwareKeyInfo, and com.maniramezan.credentialkeychain.SecurityLevel — non-exportable ECDSA P-256 signing keys in StrongBox, the Android TEE, or the Apple Secure Enclave (no
Contextneeded on Android).com.maniramezan.credentialkeychain.CertificateStore and com.maniramezan.credentialkeychain.CertificateInfo — X.509 certificates and PKCS#12 identities with natively stored private keys on desktop JVM, Android (
Context-taking overload), and Apple platforms (data-protection keychain; apps need keychain entitlements). Stored identities are usable throughCertificateStore.privateKeyEntryon Android and desktop JVM andCertificateStore.secIdentityon Apple platforms.com.maniramezan.credentialkeychain.KeychainOptions — Apple accessibility and desktop command timeout.
com.maniramezan.credentialkeychain.KeychainUnavailableException — thrown for every unavailable-backend or operational failure, never for "key not found".
The shared credential storage interface, platform factories, options, and failure type.
com.maniramezan.credentialkeychain.CredentialKeychain — the storage interface plus the
forCurrentPlatformfactories on its companion object (Android adds aContext-taking overload of the same name in this package).com.maniramezan.credentialkeychain.PasswordStore and com.maniramezan.credentialkeychain.PasswordCredential — username/password storage per server, with the same factories (and the same Android
Context-taking overload).com.maniramezan.credentialkeychain.HardwareKeyStore, com.maniramezan.credentialkeychain.HardwareKeySpec, com.maniramezan.credentialkeychain.HardwareKeyInfo, and com.maniramezan.credentialkeychain.SecurityLevel — non-exportable ECDSA P-256 signing keys in StrongBox, the Android TEE, or the Apple Secure Enclave (no
Contextneeded on Android).com.maniramezan.credentialkeychain.CertificateStore and com.maniramezan.credentialkeychain.CertificateInfo — X.509 certificates and PKCS#12 identities with natively stored private keys on desktop JVM, Android (
Context-taking overload), and Apple platforms (data-protection keychain; apps need keychain entitlements). Stored identities are usable throughCertificateStore.privateKeyEntryon Android and desktop JVM andCertificateStore.secIdentityon Apple platforms.com.maniramezan.credentialkeychain.KeychainOptions — Apple accessibility and desktop command timeout.
com.maniramezan.credentialkeychain.KeychainUnavailableException — thrown for every unavailable-backend or operational failure, never for "key not found".
The shared credential storage interface, platform factories, options, and failure type.
com.maniramezan.credentialkeychain.CredentialKeychain — the storage interface plus the
forCurrentPlatformfactories on its companion object (Android adds aContext-taking overload of the same name in this package).com.maniramezan.credentialkeychain.PasswordStore and com.maniramezan.credentialkeychain.PasswordCredential — username/password storage per server, with the same factories (and the same Android
Context-taking overload).com.maniramezan.credentialkeychain.HardwareKeyStore, com.maniramezan.credentialkeychain.HardwareKeySpec, com.maniramezan.credentialkeychain.HardwareKeyInfo, and com.maniramezan.credentialkeychain.SecurityLevel — non-exportable ECDSA P-256 signing keys in StrongBox, the Android TEE, or the Apple Secure Enclave (no
Contextneeded on Android).com.maniramezan.credentialkeychain.CertificateStore and com.maniramezan.credentialkeychain.CertificateInfo — X.509 certificates and PKCS#12 identities with natively stored private keys on desktop JVM, Android (
Context-taking overload), and Apple platforms (data-protection keychain; apps need keychain entitlements). Stored identities are usable throughCertificateStore.privateKeyEntryon Android and desktop JVM andCertificateStore.secIdentityon Apple platforms.com.maniramezan.credentialkeychain.KeychainOptions — Apple accessibility and desktop command timeout.
com.maniramezan.credentialkeychain.KeychainUnavailableException — thrown for every unavailable-backend or operational failure, never for "key not found".
The shared credential storage interface, platform factories, options, and failure type.
com.maniramezan.credentialkeychain.CredentialKeychain — the storage interface plus the
forCurrentPlatformfactories on its companion object (Android adds aContext-taking overload of the same name in this package).com.maniramezan.credentialkeychain.PasswordStore and com.maniramezan.credentialkeychain.PasswordCredential — username/password storage per server, with the same factories (and the same Android
Context-taking overload).com.maniramezan.credentialkeychain.HardwareKeyStore, com.maniramezan.credentialkeychain.HardwareKeySpec, com.maniramezan.credentialkeychain.HardwareKeyInfo, and com.maniramezan.credentialkeychain.SecurityLevel — non-exportable ECDSA P-256 signing keys in StrongBox, the Android TEE, or the Apple Secure Enclave (no
Contextneeded on Android).com.maniramezan.credentialkeychain.CertificateStore and com.maniramezan.credentialkeychain.CertificateInfo — X.509 certificates and PKCS#12 identities with natively stored private keys on desktop JVM, Android (
Context-taking overload), and Apple platforms (data-protection keychain; apps need keychain entitlements). Stored identities are usable throughCertificateStore.privateKeyEntryon Android and desktop JVM andCertificateStore.secIdentityon Apple platforms.com.maniramezan.credentialkeychain.KeychainOptions — Apple accessibility and desktop command timeout.
com.maniramezan.credentialkeychain.KeychainUnavailableException — thrown for every unavailable-backend or operational failure, never for "key not found".
Types
When a native Apple Keychain entry can be read. Every option is device-only: entries are never synchronized to iCloud Keychain or restored onto another device.
A certificate chain stored in a CertificateStore, leaf certificate first.
X.509 certificates and identities (a certificate chain plus its private key), stored with the platform's native protection. PKCS#12 identities keep their private key in native key storage; certificate chains and the alias index are kept in the platform's secure secret storage.
Synchronous secure credential storage, backed by the current platform's native secure storage (Android Keystore, Apple Keychain, macOS Keychain, Linux Secret Service, or Windows DPAPI). Call from a worker thread: native stores may block or prompt the user. Implementations never persist plaintext as a fallback — an unavailable or failing backend throws KeychainUnavailableException instead.
Public information about a key in a HardwareKeyStore.
Options for HardwareKeyStore.generate.
Non-exportable ECDSA P-256 signing keys generated inside the platform's secure hardware: StrongBox or the trusted execution environment on Android, and the Secure Enclave on Apple platforms. Private keys never leave the hardware; callers receive the public key and signatures only.
Platform-specific store configuration. Each option only affects the platforms named in its documentation and is ignored elsewhere.
Secure persistence failed or is unavailable for the current platform, session, or environment (for example: a headless Linux session with no Secret Service, or an Android call made without a Context). Error messages never include credentials.
A username and password for a server. toString never includes the password.
Username/password credentials for servers, backed by the current platform's native password storage: Keystore-encrypted files on Android, internet-password items in the Apple Keychain and the macOS login keychain, Secret Service on Linux, or Credential Manager on Windows.
Where a HardwareKeyStore private key lives.
Functions
Creates a certificate store isolated by serviceName and accountName. Private keys of imported identities are moved into Android Keystore, where they cannot be exported; certificate chains and the alias index are kept in the same encrypted, non-backed-up files as CredentialKeychain, under a separate namespace.
Creates app-private storage isolated by serviceName and accountName, encrypted with a non-exportable Android Keystore AES-256-GCM key. Ciphertext is written to a file under Context.getNoBackupFilesDir, so entries are excluded from Auto Backup — Keystore keys are hardware/OS-bound and cannot be restored onto another device or after a factory reset.
Creates an app-private password store isolated by serviceName and accountName, encrypted with its own non-exportable Android Keystore AES-256-GCM key. Like the CredentialKeychain overload, ciphertext lives under Context.getNoBackupFilesDir and is excluded from backup.
Returns the Android Keystore entry of the identity stored under alias, for use with Signature, KeyManagerFactory, or an SSLContext. The private key stays inside Android Keystore.
Returns the private key and certificate chain of the identity stored under alias, for use with Signature, KeyManagerFactory, or an SSLContext.
Returns the keychain identity stored under alias, for use with URLSession client authentication or SecIdentityCopyPrivateKey. The reference is retained: release it with CFRelease when done.