Before starting, make sure you understand the CAK lifecycle overview.
Issuer responsibilities summary
Step 1: Dashboard configuration
Enable CAK on a pricing schema
In the Developer Dashboard, navigate to your pricing schema configuration. Enabling CAK here is the top-level switch that determines whether CAK-encrypted credentials can be created under this pricing model.Enable CAK on an issuance program
When creating or editing an issuance program, enable the CAK feature. When enabled:- The Issuance SDK generates a CAK key pair during credential issuance
- The SDK returns the CAK public key to your backend system
- Your system is expected to encrypt the user’s raw sensitive data with this key
Configure a global callback URL
Set a global HTTPS callback URL that receives notifications whenever a Verifier is authorized to access data from credentials you have issued.schemaId in the callback payload.
Step 2: Issuance SDK integration
When CAK is enabled for an issuance program, theissueCredential() call returns a cakPublicKey in its response.
Response:
The public key is deterministically derived from the [User - Issuer - Schema] composite identifier. The same key is returned for the same combination, so you can retrieve it without re-issuing the credential.
Step 3: Encrypt and store user data
After receiving thecakPublicKey, encrypt the user’s raw sensitive data before storing it.
What to encrypt
Encrypt any raw PII or biometric data associated with the credential:- Identity document images (ID cards, passports)
- Facial biometric photos
- Full names, dates of birth, document numbers
- Any other data that verifiers may need for compliance review
Encryption scheme
Use ECIES (Elliptic Curve Integrated Encryption Scheme) with the CAK public key:Storage
Store the encrypted ciphertext in the designated storage system (dStorage on Moca Chain). The encrypted data cannot be read by anyone — including your own systems — without the corresponding CAK private key, which is only generated when a Verifier obtains user consent during verification.Step 4: Implement the callback endpoint
When a user authorizes a Verifier to access their data, the platform sends an HTTPS POST to your configured callback URL.Callback payload
The payload includes fields that identify who authorized whom, for which credential schema:Implementation requirements
Your callback endpoint must:- Verify the request signature — Validate that the callback originates from the AIR Credential platform
- Route by schemaId — Direct the callback to the correct business logic based on the credential schema
- Return HTTP 2XX — Acknowledge receipt so the platform marks the callback as delivered
- Log the event — Record the authorization event for your own audit trail
Callback record lifecycle
The platform manages callback records through these states:
The platform retries failed callbacks automatically. Ensure your endpoint is idempotent to handle duplicate deliveries.
Best practices
Encrypt only what verifiers need
Encrypt only what verifiers need
Only include data that verifiers will legitimately need for their compliance process. Minimize the scope of encrypted data to reduce exposure.
Use secp256r1 unless you have a specific reason not to
Use secp256r1 unless you have a specific reason not to
The P-256 curve is the default and recommended option. Only switch to secp256k1 if your downstream systems specifically require it.
Make your callback endpoint highly available
Make your callback endpoint highly available
The callback URL is your real-time notification channel for all CAK authorization events. Downtime means missed notifications, which can delay your audit and risk monitoring.
Implement idempotent callback handling
Implement idempotent callback handling
The platform retries failed callbacks. Your endpoint should handle duplicate deliveries gracefully — use the combination of userId, verifierDid, and schemaId as a deduplication key.
Related pages
- CAK Overview — Architecture and lifecycle
- CAK Verifier Guide — Verifier-side integration
- Issuing Credentials — Standard issuance SDK reference
- Compliance & Privacy FAQ — GDPR, CCPA, and data handling questions