-
Notifications
You must be signed in to change notification settings - Fork 5
Key Management
Welcome to the Key Management wiki of eSIM Wallet. This wiki is documented with the motivation of breaking down Key Management of eSIM Wallet for everyone to understand.
The below diagram explains a non-custodial key management approach of eSIM Wallet where end users' private key is generated and stored in their respective mobile device within an secure environment.

-
EC Key Manager deals with the generation and management of ECDSA keys, To generate Ethereum keys, uses Web3j and BouncyCastle libraries, The EC key pair is generated using the
secp256k1EC.
note : android keystore doesn't support secp256k1
- The security of eSIM wallet inherits android's Android Keystore System.
Here's a brief on Android Keystore:
- Securely store cryptographic keys in a container to limit extraction from the device.
- Use stored keys for cryptographic functions without exposing key material.
- External Protection: Prevents key material extraction from both apps and the device.
- Internal Restrictions: Enforces specified key usages within the device, restricting unauthorized internal uses.
- Application Isolation: Key material does not enter the app process, safeguarding against compromised apps.
- Hardware Binding: Key material may be tied to device's secure hardware like TEE or SE, preventing key extraction even if the OS is compromised.
- StrongBox Keymaster: Available on devices with Android 9 or higher, offers enhanced security with its own CPU, secure storage, and resistance to tampering.
- Algorithm Support: Includes RSA, AES, ECDSA, and more, with preference for StrongBox via
setIsStrongBoxBacked()method.
- Cryptographic Restrictions: Keys are limited to specific algorithms, operations, and cryptographic parameters.
- Temporal Limits: Keys can be restricted to operate only within certain time frames.
- User Authentication: Keys require recent user authentication to be used, with some conditions enforceable by secure hardware.
On a suitable processor, the secure world runs a trusted execution environment (TEE) with a small operating system.
On reasonable modern Android versions, the keys of the Android keymaster are stored in the TEE, Android (even fully rooted) does not have direct access to them.
There are phones where the device encryption key resides inside the TEE, but this isn't always the case.