CryptoKey
Manages cryptographic key operations using the Android KeyStore system.
This class provides a secure abstraction for creating, storing, and accessing RSA key pairs within the Android KeyStore. It handles key generation with configurable security parameters, automatic key aliasing through hashing, and secure key lifecycle management.
Key features:
Automatic key alias generation using SHA-256 hashing of the key ID
RSA 2048-bit key pairs with signing, encryption, and decryption capabilities
Integration with Android KeyStore for hardware-backed security
Support for multiple digest algorithms (SHA-256, SHA-384, SHA-512)
Certificate chain access for attestation purposes
Lazy initialization for performance optimization
The class is designed to work with Android's hardware security features when available, providing enhanced protection for cryptographic keys.
Parameters
The unique identifier used to generate the key alias through hashing