Android Keystore System
Android Keystore System 是什么?
Android Keystore SystemAndroid's hardware-backed key container that confines cryptographic key material to a Trusted Execution Environment or StrongBox, exposing keys only by reference and enforcing per-key access policies such as biometric or device-credential gating.
The Android Keystore System is Android's primary API for hardware-protected key material, available via `android.security.keystore` and `KeyGenParameterSpec`. When the device supports it, keys are generated and stored inside a Trusted Execution Environment (TEE — typically ARM TrustZone) or, on devices with a discrete StrongBox security chip (e.g. Pixel Titan M), inside that chip. Application code receives only opaque key references; the actual key material never enters the Android Linux kernel or app memory. Per-key policies enforced by the keystore include user-authentication-required (biometric or device credential), validity duration after authentication, attestation-required, and unlocked-device-required. Key Attestation (`KeyMint`/`Keymaster`) lets a server verify that a given public key was generated inside a real TEE/StrongBox on a Google-attested device, which is the basis for hardware-bound mobile FIDO2 / WebAuthn passkeys. Common AppSec issues include not setting `setUserAuthenticationRequired` for sensitive keys, not setting `setInvalidatedByBiometricEnrollment(true)` (so enrolling a new fingerprint silently keeps the key valid), and bypassing the keystore entirely by holding raw keys in SharedPreferences.
● 示例
- 01
A FIDO2 passkey app generates an EC P-256 key in StrongBox with `setUserAuthenticationRequired(true)` and presents the resulting attestation chain to its server.
- 02
A code review flags an Android app deriving an AES key with PBKDF2 at runtime and storing it in SharedPreferences, instead of generating it inside the Keystore.
● 常见问题
Android Keystore System 是什么?
Android's hardware-backed key container that confines cryptographic key material to a Trusted Execution Environment or StrongBox, exposing keys only by reference and enforcing per-key access policies such as biometric or device-credential gating. 它属于网络安全的 移动安全 分类。
Android Keystore System 是什么意思?
Android's hardware-backed key container that confines cryptographic key material to a Trusted Execution Environment or StrongBox, exposing keys only by reference and enforcing per-key access policies such as biometric or device-credential gating.
Android Keystore System 是如何工作的?
The Android Keystore System is Android's primary API for hardware-protected key material, available via `android.security.keystore` and `KeyGenParameterSpec`. When the device supports it, keys are generated and stored inside a Trusted Execution Environment (TEE — typically ARM TrustZone) or, on devices with a discrete StrongBox security chip (e.g. Pixel Titan M), inside that chip. Application code receives only opaque key references; the actual key material never enters the Android Linux kernel or app memory. Per-key policies enforced by the keystore include user-authentication-required (biometric or device credential), validity duration after authentication, attestation-required, and unlocked-device-required. Key Attestation (`KeyMint`/`Keymaster`) lets a server verify that a given public key was generated inside a real TEE/StrongBox on a Google-attested device, which is the basis for hardware-bound mobile FIDO2 / WebAuthn passkeys. Common AppSec issues include not setting `setUserAuthenticationRequired` for sensitive keys, not setting `setInvalidatedByBiometricEnrollment(true)` (so enrolling a new fingerprint silently keeps the key valid), and bypassing the keystore entirely by holding raw keys in SharedPreferences.
如何防御 Android Keystore System?
针对 Android Keystore System 的防御通常结合技术控制与运营实践,详见上方完整定义。
Android Keystore System 还有哪些其他名称?
常见的别称包括: AndroidKeystore, KeyStore (Android)。
● 相关术语
- mobile-security№ 612
iOS Keychain
Apple's encrypted credential store on iOS, iPadOS, and macOS, backed by the Secure Enclave and graded by per-item accessibility classes that bind decryption to device unlock, passcode, biometric, or hardware-bound state.
- mobile-security№ 772
移动应用安全
通过设计、开发和测试 iOS 与 Android 应用来保护用户数据、防止逆向工程并抵御运行时篡改的实践。
- compliance№ 871
OWASP MASVS
OWASP 移动应用安全验证标准,为 iOS 与 Android 移动应用提供可测试的安全需求基线。
- identity-access№ 458
FIDO2
FIDO 联盟推出的开放认证标准,结合 WebAuthn(浏览器 API)和 CTAP(认证器协议),实现抗钓鱼的无密码登录。
- cloud-security№ 1300
可信执行环境 (TEE)
处理器中一种安全、隔离的执行环境,代码和数据在其中获得机密性与完整性保护,主机操作系统和虚拟化层也无法访问。
- identity-access№ 112
生物特征认证
根据指纹、人脸、虹膜或声纹等独特的生理特征来验证身份的认证方式。