{"id":34519584,"url":"https://github.com/xprateek/aospgenkeybox","last_synced_at":"2026-05-22T06:02:49.403Z","repository":{"id":327672881,"uuid":"1108624532","full_name":"xprateek/AOSPGenKeyBox","owner":"xprateek","description":"Generates Android Keystore attestation keyboxes with proper CA hierarchy and ASN.1 KeyDescription extension.   (OID 1.3.6.1.4.1.11129.2.1.17)","archived":false,"fork":false,"pushed_at":"2026-04-11T02:48:14.000Z","size":26,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-11T04:29:50.751Z","etag":null,"topics":["android","aosp","keybox"],"latest_commit_sha":null,"homepage":"https://github.com/xprateek/AOSPGenKeyBox/wiki","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xprateek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-02T17:40:36.000Z","updated_at":"2026-04-10T15:19:53.000Z","dependencies_parsed_at":"2026-02-13T05:31:02.341Z","dependency_job_id":null,"html_url":"https://github.com/xprateek/AOSPGenKeyBox","commit_stats":null,"previous_names":["xprateek/aospgenkeybox"],"tags_count":131,"template":false,"template_full_name":null,"purl":"pkg:github/xprateek/AOSPGenKeyBox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xprateek%2FAOSPGenKeyBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xprateek%2FAOSPGenKeyBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xprateek%2FAOSPGenKeyBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xprateek%2FAOSPGenKeyBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xprateek","download_url":"https://codeload.github.com/xprateek/AOSPGenKeyBox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xprateek%2FAOSPGenKeyBox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","aosp","keybox"],"created_at":"2025-12-24T04:36:14.329Z","updated_at":"2026-04-14T05:01:05.735Z","avatar_url":"https://github.com/xprateek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AOSPGenKeyBox\n\n**AOSP-like Keybox Generator** - Generates Android Keystore attestation keyboxes with proper CA hierarchy and ASN.1 KeyDescription extension.  \n(OID 1.3.6.1.4.1.11129.2.1.17)\n\n## Features\n\n- Generates 1-, 2-, and 3-certificate chains  \n- Full CA hierarchy: Root → Intermediate → Leaf  \n- ECDSA (P-256) and RSA (2048) keypairs  \n- KeyDescription ASN.1 structure injection  \n- Timestamped UTC folders with minimal essential files only  \n- Comprehensive logging (`generation.log` per chain)  \n\n## Output Files (per chain)\n\n```\n202*-*-UTC-aosp-chainX/\n├── keybox.xml                 # Main attestation keybox\n├── ecPrivateKey.pem           # EC leaf private key\n├── rsaPrivateKey.pem          # RSA leaf private key  \n├── ecCert_1.pem               # EC leaf certificate\n├── ecCert_2.pem               # EC intermediate\n├── ecCert_3.pem               # EC root\n├── rsaCert_1.pem              # RSA leaf certificate\n├── rsaCert_2.pem              # RSA intermediate\n├── rsaCert_3.pem              # RSA root\n├── generation.log             # Detailed logs\n└── openssl_aosp.cnf           # Generated config\n```\n\n## Prerequisites\n\nInstall dependencies via:\n\n```\npip install -r requirements.txt\n```\n\n*Required software:*\n\n- `openssl` (version 1.1.1+ required)\n\n*Optional Python packages:*\n\n- `lxml` and `pyasn1` (for XML validation and KeyDescription ASN.1 encoding)\n\n## Required Files\n\n- `openssl_aosp.cnf` - OpenSSL config file, placed in the same directory as the script.  \n- `prettify_xml.py` - XML formatting helper script.\n\n## Usage\n\nRun interactively (prompts for Enter key to exit):\n\n```\npython3 aosp_keybox_generator.py\n```\n\nFor CI/CD pipelines, disable prompt with:\n\n```\nCI=true python3 aosp_keybox_generator.py\n```\n\n## Expected Console Output\n\n```\nAOSP Keybox Generator v2.1\nGenerating attestation keyboxes...\n[INFO] Requires openssl_aosp.cnf in script directory\n[OK] Chain 1 complete: 202*-*-UTC-aosp-chainX\n[OK] Chain 2 complete: 202*-*-UTC-aosp-chainX  \n[OK] Chain 3 complete: 202*-*-UTC-aosp-chainX\n\nOutput locations:\n  • 202*-*-UTC-aosp-chainX\n  • 202*-*-UTC-aosp-chainX\n  • 202*-*-UTC-aosp-chainX\n```\n\n## Keybox Structure\n\nGenerated `keybox.xml` follows Android Open Source Project (AOSP) format:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cAndroidAttestation\u003e\n  \u003cNumberOfKeyboxes\u003e1\u003c/NumberOfKeyboxes\u003e\n  \u003cKeybox DeviceID=\"rVwy78oa55xj\"\u003e\n    \u003cKey algorithm=\"ecdsa\"\u003e...\u003c/Key\u003e\n    \u003cKey algorithm=\"rsa\"\u003e...\u003c/Key\u003e\n  \u003c/Keybox\u003e\n\u003c/AndroidAttestation\u003e\n```\n\n## ⚠️ Important Notes\n\n- **TEST ONLY** - Template code; not production or real device keyboxes.  \n- Fails Google Play Integrity validation (not signed by Google).  \n- Intended for Android Keystore attestation development/testing.  \n- DeviceID is random per run (6-12 characters).  \n\n## Troubleshooting\n\n| Issue                      | Solution                                   |\n|----------------------------|--------------------------------------------|\n| `OpenSSL not found`        | Install OpenSSL or add it to your PATH.   |\n| `openssl_aosp.cnf missing` | Place `openssl_aosp.cnf` in script directory. |\n| XML validation warnings    | Install `lxml`: `pip install lxml`         |\n| Missing KeyDescription     | Install `pyasn1`: `pip install pyasn1`     |\n\n## Automation / CI Integration Example\n\n```\n- name: Generate AOSP keyboxes\n  run: |\n    CI=true python3 aosp_keybox_generator.py\n    ls -la *-aosp-chain*\n  shell: bash\n```\n\n## License\n\nThis project is licensed under the **GPLv3** License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxprateek%2Faospgenkeybox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxprateek%2Faospgenkeybox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxprateek%2Faospgenkeybox/lists"}