Call Verification Example Utilities
Intro
This project provides utility scripts to generate and verify JWTs (JSON Web Tokens) for blockchain-enabled call verification, similar to the STIR/SHAKEN model. It supports creating key pairs, signing JWTs with private keys, and verifying them with public keys using ES256 (ECDSA P-256 + SHA-256).
How It Works
The caller verification flow includes:
Key pair generation (ES256)
JWT signing for originating phone numbers
JWT verification using public keys
Integration with KNS and the Sui blockchain
Requires:
Node.js 22+
ts-nodeinstalled globally (npm install -g ts-node)Project dependencies (
npm install)
π οΈ Scripts Overview
generate-key.ts
Generates ES256 private/public key pair
authorize.ts
Signs a JWT using private key
verify.ts
Verifies a JWT using public key
π 1. Generate Key Pair
Output:
es256-private-key-{timestamp}.pemes256-public-key-{timestamp}.pem
βοΈ 2. Sign a JWT
Example:
Output:
es256-signed.jwt (JWT file)
β 3. Verify a JWT
Example:
Output:
Decoded JWT (header, payload, signature)
Verification status
π Workflow Example
π Python JWT Verification
Setup:
Verify:
π» .NET JWT Verification
Setup:
Verify:
π SUI Blockchain Integration
π₯ Keystore Registration
Example:
π Lookup KNS Object ID
Development:
Production:
π Map KNS ID to Certificate Registry
Add Entry:
Update Entry:
Remove Entry:
Dump Table:
π Lookup Public Key for Phone Number
Also supports:
Response:
π Full JWT Verification Flow
Originating Server:
Terminating Server:
API Call:
Response:
Conclusion
This utility toolkit bridges identity, telecom, and blockchain technologies using JWT-based verification. It's ideal for telcos and platforms implementing secure call validation with the Karrier Number System.
For support or questions, contact support@karrier.one.
π Reference
Last updated