-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Turnkey API Key Generation Bug Report
Issue Summary
Turnkey API key generation produces invalid cryptographic key pairs that cannot be used for authentication.
Environment
- Turnkey SDK Version: @turnkey/[email protected]
- API Key Stamper Version: @turnkey/[email protected]
- Node.js Version: v22.14.0
- Platform: Windows 10
Steps to Reproduce
- Go to Turnkey dashboard
- Navigate to API Keys section
- Click "Create API key"
- Select "Generate API keys in-browser"
- Provide API key name (e.g., "gen-1", "gen-2")
- Download the generated JSON file
- Use the keys in Turnkey SDK
Expected Behavior
- Generated public and private keys should form a valid P-256 cryptographic pair
- Keys should work with Turnkey SDK authentication
Actual Behavior
- Generated keys are mathematically invalid
- Public key cannot be derived from private key
- Turnkey SDK rejects keys with error: "unable to load API key: invalid public key"
Evidence
First API Key Generation (gen-1)
- Public Key: 022fbd14baec3997747e817ac24d3ea6098461be7183a7e856f816eaa3bd816149
- Private Key: cd706...2a35
- Curve Type: API_KEY_CURVE_P256
- Status: ❌ Invalid key pair
Second API Key Generation (gen-2)
- Public Key: 035e771436b1adf475ae715ccdd96824ae03a521b144251d47a2ffc2c770926362
- Private Key: a296...c65b
- Curve Type: API_KEY_CURVE_P256
- Status: ❌ Invalid key pair
Technical Details
- Both keys are 66-character public keys and 64-character private keys
- Keys are in correct hex format with no encoding issues
- Node.js crypto module confirms keys are not valid ECDSA pairs
- Turnkey SDK validation fails at convertTurnkeyApiKeyToJwk function
Impact
- Cannot authenticate with Turnkey API
- Cannot use Turnkey SDK for any operations
- Blocks development and testing of Turnkey integration
Request
Please investigate and fix the API key generation algorithm to ensure valid cryptographic key pairs are produced.
Contact
- User: [email protected]
- Organization ID: e336c77b-d34b-4bf2-87bd-0ffb2b9d84e2
- Report Date: August 30, 2025
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels