{"id":25352658,"url":"https://github.com/mutkuensert/androidsignatureexample","last_synced_at":"2026-05-01T13:31:12.663Z","repository":{"id":246029367,"uuid":"819867806","full_name":"mutkuensert/AndroidSignatureExample","owner":"mutkuensert","description":"An example Android app for generating key pairs in trusted execution environment to sign data requiring biometric authentication using Android keystore.","archived":false,"fork":false,"pushed_at":"2025-03-15T13:17:00.000Z","size":7077,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T00:46:56.626Z","etag":null,"topics":["android","androidkeystore","biometric-authentication","cryptography","digital-signature","digital-signature-algorithm","dsa-algorithm","ecdsa","elliptic-curve","keypair","keystore","secure-enclave","security","tee","trusted-execution-environment"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutkuensert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T10:39:51.000Z","updated_at":"2025-03-15T13:17:04.000Z","dependencies_parsed_at":"2025-02-25T09:29:06.807Z","dependency_job_id":null,"html_url":"https://github.com/mutkuensert/AndroidSignatureExample","commit_stats":null,"previous_names":["mutkuensert/androidkeystoreexample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mutkuensert/AndroidSignatureExample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroidSignatureExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroidSignatureExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroidSignatureExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroidSignatureExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutkuensert","download_url":"https://codeload.github.com/mutkuensert/AndroidSignatureExample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroidSignatureExample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32499681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","androidkeystore","biometric-authentication","cryptography","digital-signature","digital-signature-algorithm","dsa-algorithm","ecdsa","elliptic-curve","keypair","keystore","secure-enclave","security","tee","trusted-execution-environment"],"created_at":"2025-02-14T18:57:11.454Z","updated_at":"2026-05-01T13:31:12.635Z","avatar_url":"https://github.com/mutkuensert.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Signature Example\n\nhttps://github.com/mutkuensert/AndroidKeyStoreExample/assets/97624869/551f58b1-a1da-4960-a878-28fc408d3c37\n\n## Overview\n\nAndroidSignatureExample is a demonstration project that shows how to implement secure digital signatures in Android applications using the Android KeyStore system. This project provides a complete implementation of generating cryptographic key pairs, signing data, and verifying signatures with support for hardware-backed keys and biometric authentication.\n\n## Features\n\n- **Hardware-backed Key Pair Generation:** Create cryptographically secure key pairs stored in Android's hardware security module\n- **Biometric Authentication:** Restrict access to private keys with strong biometric authentication\n- **ECDSA Digital Signatures:** Implement industry-standard signature algorithms (SHA384/SHA256 with ECDSA)\n- **Signature Verification:** Verify signatures using stored or externally provided public keys\n- **StrongBox Support:** Optional secure hardware integration where available (StrongBox doesn't support 384 bit key size)\n- **Emulator Compatibility:** Graceful handling of hardware security features in emulator environments\n\n## Technical Details\n\nThis project demonstrates several best practices for implementing cryptographic operations in Android:\n\n- **Android KeyStore:** Uses the system-provided KeyStore for secure key storage\n- **Hardware Security:** Generates keys in hardware security modules where available\n- **ECDSA with P-384/P-256:** Implements elliptic curves\n- **Biometric Prompt API:** Integrates with the latest biometric authentication APIs\n- **Jetpack Compose UI:** Modern UI implementation with full state management\n\n## Getting Started\n\n### Prerequisites\n\n- Android Studio Hedgehog or newer\n- Android SDK 35 or higher (minimum SDK 24)\n- Device with biometric hardware or emulator\n\n### Setup\n\n1. Clone the repository\n2. Open the project in Android Studio\n3. Choose either the 'emulator' or 'production' build variant\n4. Build and run the application\n\n## Usage Example\n\nThe application provides a simple UI to demonstrate key concepts:\n\n1. **Create Key Pair:** Generates a cryptographic key pair (public/private) secured in hardware and protected with biometric authentication\n2. **Sign Data:** Enter data and create a digital signature using the private key\n3. **Verify Signature:** Verify that a signature is valid for given data using a provided public key\n\nExample code for key generation:\n\n```kotlin\nval keyPairManager = BiometricAuthRestrictedKeyPairManager(\"myKeyAlias\")\nval keyPair = keyPairManager.generateHardwareBackedKeyPair(activity)\nval publicKey = keyPair.public.base64Encoded\n```\n\nExample code for signing data:\n\n```kotlin\nkeyPairManager.authenticateAndSignData(\n    \"Data to be signed\",\n    activity\n) { signedData -\u003e\n    // Use the signature in signedData.signature\n}\n```\n\n## Project Structure\n\n- `signature/`: Core cryptographic operations and key management\n    - `KeyPairManager.kt`: Base class for managing cryptographic key pairs\n    - `biometric/`: Biometric authentication integration\n    - `algorithm/`: Signature algorithm implementations\n- `ui/`: Jetpack Compose UI components\n\n## Kdoc\n\nKdoc is available at [https://mutkuensert.github.io/AndroidSignatureExample/](https://mutkuensert.github.io/AndroidSignatureExample/)\n\nThe documentation includes API reference.\n\n## Security Considerations\n\n- This application follows OWASP recommendations for cryptographic implementations\n- Uses P-384 curve by default for ECDSA operations (as recommended by security best practices)\n- Properly handles key storage in hardware security modules\n- Implements biometric authentication with strong security requirements\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutkuensert%2Fandroidsignatureexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutkuensert%2Fandroidsignatureexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutkuensert%2Fandroidsignatureexample/lists"}