Setting up evidence pack encryption
Once you register a key, every aml-identity check in Nexiel Verify, and every screening decision in Nexiel Screen, produces an “evidence pack”: the identity details checked, the decision itself, and the exact matching engine version and thresholds behind it. Nexiel encrypts it to a key you control and hands it to you once, either when you claim it or, with push delivery, by posting it to your own webhook endpoint. This page covers what that pack contains, how to register and protect the key that reads it, how it reaches you, and how to keep your records readable for as long as you must keep them.
What an evidence pack is, and why Nexiel does not keep it
AMLR (the EU Anti-Money Laundering Regulation) requires the obliged entity, meaning your organization, not Nexiel, to retain evidence of the customer due diligence and screening it relied on for a decision. Nexiel is infrastructure your organization uses to make that decision. It is not the obliged entity, so the retention duty, and the record itself, stay with you.
An evidence pack hands that record to you. Instead of storing the disclosed identity details and the decision Nexiel made on them, Nexiel packages both, plus the frozen decision artifact that pins the exact engine version and thresholds in force, encrypts the package to a public key you registered, and delivers the ciphertext to you. Only your own private key can decrypt it. Nexiel never has that key, so Nexiel has nothing left to keep, and nothing a breach of Nexiel's own systems could ever expose.
The AML evidence pack described on this page covers Nexiel Verify's aml-identity check type and every Nexiel Screen decision. The Verify check types str-guest-registration, mobile-driving-licence, and corporate-mandate-verification use the same encryption and one-time delivery for their own evidence packs, which carry the disclosed claims and the issuer signature validation result, with no screening decision or frozen decision artifact. Nexiel Age's age-verification checks have no CDD or AML purpose at all, and are unaffected. They keep their existing boolean-proof-only design: a yes/no answer such as age_over_18 and nothing else, with no evidence pack to register a key for.
What is inside
Decrypted, an evidence pack holds:
- The actual disclosed claim values used for that check: name, DOB, and nationality for a Screen decision (plus any wallet addresses submitted with it), or given name, family name, DOB, and nationality for a Verify aml-identity check (the wallet discloses nationality as a plural
nationalitiesarray, and Nexiel uses the first entry). - The screening decision: classification, which lists were checked, which matching layers drove the result, and whether it requires human review.
- The frozen decision artifact: the engine version, the gates and ensemble-weights hashes, and the list-snapshot ids in force at decision time, so you can point to exactly what logic ran, months later, without re-deriving it from whatever configuration happens to be live today.
- For a Verify aml-identity check: the wallet credential's issuer signature validation result. Screen has no wallet presentation to validate, so this field is
nullthere. - An
amlrSuggestedRetentionUntildate: the decision date plus 5 years. It is the earliest date your retention period could end, not a date to delete by. See how to read the retention date.
The encryption is JWE Compact Serialization, ECDH-ES key agreement and A256GCM content encryption on the P-256 curve, so any standard JOSE library, such as jose for Node.js or joserfc for Python, decrypts it with your private key. The Nexiel SDKs do it for you with decryptEvidencePack (TypeScript) and decrypt_evidence_pack (Python). The protected header carries kid, the RFC 7638 thumbprint of the public key the pack was encrypted to: the same fingerprint the dashboard shows for that key, so you can tell which of your keys opens a pack without trying each one (evidencePackKeyId and evidence_pack_key_id read it).
What Nexiel keeps instead
A single audit row per decision: the session or request id, your client id, the timestamp, the classification, the frozen-artifact hashes above, and a SHA-256 hash of the ciphertext that was delivered to you. The encrypted pack itself is held only until it is delivered, for as long as the delivery mode you choose allows (see how long Nexiel holds the encrypted pack). That hash proves a specific evidence pack was generated and handed off. It reveals nothing about what was inside it. Nexiel never retains the plaintext, the claim values, or your private key.
Registering a key from the dashboard
Key registration lives on the customer dashboard, gated behind sign-in and an approved KYB status, the same account that already manages your API keys and request history:
- Sign in at
dashboard.nexiel.ioand open Evidence pack keys. - Choose a password for the key file. Protection is on by default: the private key is encrypted in your browser with this password before it is saved, and Nexiel never sees the password. You can turn it off if you import the key straight into your own key vault.
- Select Generate a key pair. Your browser's Web Crypto
SubtleCryptoAPI generates a real P-256 ECDH key pair on your own device. Nothing is sent anywhere yet. - The private key downloads immediately to your device, as
nexiel-evidence-pack-private-key.jwewhen it is password-protected (an encrypted JWK as RFC 7517 describes it: PBES2-HS512+A256KW and A256GCM), or as a plain JSON file when it is not. Store it now, in whatever secret storage your organization already uses, and keep a backup copy somewhere separate. - Only the public half, exported directly from the public key object (never derived by stripping fields off the private one), is sent to Nexiel for registration.
- The dashboard shows a fingerprint, an RFC 7638 JWK thumbprint, for the key it just registered. Confirm it matches your own saved record before you rely on it. Every pack encrypted to this key carries the same value as its
kid, without the spaces the dashboard groups it with.
To open a protected key file, use decryptEvidencePackPrivateKey(file, password) in the TypeScript SDK or decrypt_evidence_pack_private_key(file, password) in the Python SDK, then pass the key to the decrypt call. Other JOSE libraries that support PBES2 open it too; some cap the PBES2 iteration count below the file's 210,000 by default (with jose, pass maxPBES2Count), so raise that limit when you use them.
import { readFile } from 'node:fs/promises';
import { decryptEvidencePack, decryptEvidencePackPrivateKey, evidencePackKeyId } from '@nexiel/sdk';
const keyFile = await readFile('nexiel-evidence-pack-private-key.jwe', 'utf8');
const password = await secrets.get('evidence-key-password'); // from your own secret store
const privateKey = await decryptEvidencePackPrivateKey(keyFile, password);
// claimed: the response of the claim route (or a pushed event's data)
console.log(evidencePackKeyId(claimed.evidencePackCiphertext)); // the key's fingerprint
const pack = await decryptEvidencePack(claimed.evidencePackCiphertext, privateKey);
await records.save(claimed.evidencePackHash, pack); // your own secure records systemfrom nexiel_sdk import decrypt_evidence_pack, decrypt_evidence_pack_private_key, evidence_pack_key_id
password = secrets.get("evidence-key-password") # from your own secret store
with open("nexiel-evidence-pack-private-key.jwe") as handle:
private_key = decrypt_evidence_pack_private_key(handle.read(), password)
# claimed: the response of the claim route (or a pushed event's data)
print(evidence_pack_key_id(claimed["evidencePackCiphertext"])) # the key's fingerprint
pack = decrypt_evidence_pack(claimed["evidencePackCiphertext"], private_key)
records.save(claimed["evidencePackHash"], pack) # your own secure records systemYou can register more than one active key at once, for example to roll in a replacement before revoking an old one. Revoke a key from the same page once you have confirmed its replacement is working and nothing still depends on it. Keep the old private key for as long as you keep packs encrypted to it.
Losing the private key
Nexiel keeps no copy of your private key, so if you lose it, Nexiel cannot recover it for you. Every evidence pack encrypted to that key becomes unreadable: the ones you have already stored encrypted, not only the ones generated later. A pack you decrypted and saved in your own records stays readable, because that plaintext no longer depends on the key.
So that losing one file never costs you your records:
- Keep the key file password-protected, and keep a backup copy of it, and of its password, in a separate secure place.
- Decrypt each pack when you receive it and store the contents in your own secure records system, encrypted at rest under your own controls, or re-encrypt it to a key held in your own key management service. Do not rely on the downloaded key file as the only way into years of records.
- Keep the hash of each pack (
evidencePackHash) with your record, so you can show which pack it came from.
Screening and verification do not stop while you sort this out. A missing or revoked key is never an error condition for a decision itself, only for the evidence pack attached to it. Nexiel has nothing to encrypt to, and Screen and Verify decisions proceed normally either way. Generate and register a replacement key as soon as you can, and revoke the lost one from the same page. Any decision made in the gap between losing the old key and registering a new one produces no evidence pack at all, since Nexiel never holds a fallback plaintext copy to hand you once a key exists again.
Where the evidence pack arrives
With pull delivery, the default, you claim each pack from your own backend, once. The decision itself never carries the pack: it reports evidencePackStatus, and the claim route hands the pack over when that reads available.
- Nexiel Screen:
POST /v1/screenreturnsevidencePackStatuswith the decision. Claim the pack withPOST /v1/screen/{decisionId}/evidence-pack/claim. - Nexiel Verify: the decision completes on the wallet's own callback, and
decision.evidencePackStatuson the session says when the pack is ready. Claim it withPOST /v1/verify/sessions/{sessionId}/evidence-pack/claim.
Both claims need your API key and an Idempotency-Key. The pack is handed over once; a retry with the same key within an hour returns it again, so a dropped response, whether of the decision or of the claim, never loses it. A claim with another key afterwards returns 409 evidence_pack_already_claimed. Nexiel deletes its copy at the next purge after that hour, or 7 days after the decision if you never claim it, and keeps only the hash. The status reads delivered only once you have claimed the pack. Rotating an API key never strands a pack: claim a Screen pack made with the old key using the new one and the old key's client id in madeWithKey.
See the Screen API quickstart and the Verify API overview for the full request and response examples.
Push delivery
Instead of claiming packs, you can have Nexiel post each one to a webhook endpoint you choose. With push delivery, Nexiel deletes the encrypted pack as soon as your endpoint acknowledges it. Choose it per product and per environment on the Evidence delivery page of the dashboard, or with PUT /v1/verify/evidence-pack-delivery/{environment} and PUT /v1/screen/evidence-pack-delivery/{environment}. Pick one of your enabled webhook endpoints of the same environment: packs go to that endpoint only, never to your other endpoints, and it cannot be disabled or deleted while it receives them or while packs pushed to it are still being delivered. If the chosen endpoint is disabled when a decision is made, that decision's pack falls back to pull.
Each pack arrives as a signed verify.evidence_pack.ready or screening.evidence_pack.ready event. The event carries the ciphertext, its SHA-256 hash, the decision ids and the frozen-artifact hashes. The ciphertext is the same JWE you would otherwise claim, encrypted to your key. Answer with any 2xx status and Nexiel deletes its copy of the encrypted pack in the same step, keeping only its hash. Other answers are retried with growing delays, up to 8 attempts (about an hour in total). In push modes, POST /v1/screen reports evidencePackStatus: pushing and an evidencePackDelivery field naming the event.
Delivery is at least once. If your endpoint's acknowledgement is lost, the same event can arrive again, with the same event id and the same evidencePackHash, so store a pack once per event id and answer 2xx to a duplicate. Verify the webhook signature first, then check the ciphertext against evidencePackHash, the hex SHA-256 of the ciphertext string, before storing it.
import { createHash, timingSafeEqual } from 'node:crypto';
// event: the parsed body of a delivery whose X-Nexiel-Signature you verified
function packMatchesHash(ciphertext, expectedHash) {
const actual = createHash('sha256').update(ciphertext, 'utf8').digest();
const expected = Buffer.from(expectedHash, 'hex');
return expected.length === actual.length && timingSafeEqual(actual, expected);
}
if (!packMatchesHash(event.data.evidencePackCiphertext, event.data.evidencePackHash)) {
return res.status(400).end();
}
// Store it once per event id: a retried delivery carries the same id.
await evidenceStore.saveOnce(event.id, event.data.evidencePackCiphertext);
return res.status(200).end(); // Nexiel now deletes its encrypted copyimport hashlib
import hmac
# event: the parsed body of a delivery whose X-Nexiel-Signature you verified
def pack_matches_hash(ciphertext: str, expected_hash: str) -> bool:
actual = hashlib.sha256(ciphertext.encode("utf-8")).hexdigest()
return hmac.compare_digest(actual, expected_hash.lower())
data = event["data"]
if not pack_matches_hash(data["evidencePackCiphertext"], data["evidencePackHash"]):
return Response(status_code=400)
# Store it once per event id: a retried delivery carries the same id.
evidence_store.save_once(event["id"], data["evidencePackCiphertext"])
return Response(status_code=200) # Nexiel now deletes its encrypted copyHow long Nexiel holds the encrypted pack
Nexiel never holds the plaintext. How long it holds the encrypted pack depends on the delivery mode you choose:
- Pull, Nexiel Screen and Nexiel Verify. Until an hour after you claim it, so a retry of the claim gets the same pack, then deleted on the next purge pass; or 7 days after the decision if you never claim it.
- Push. Until your endpoint answers with a 2xx, then deleted at once. If every attempt fails, the pack is deleted undelivered when the last attempt ends, and you do not receive it.
- Push with pull fallback. As push, but if every attempt fails, the pack is kept for one claim (
POST /v1/verify/sessions/{sessionId}/evidence-pack/claimorPOST /v1/screen/{decisionId}/evidence-pack/claim) until 7 days after the decision, then deleted.
When a push ends without an acknowledgement, Nexiel emails your organization's contact address once for that pack, saying whether it was deleted or is waiting to be claimed, and until when. In every mode a pack is deleted 7 days after the decision at the latest. A pack too large to push (over 256 KiB, far above a normal pack of a few KB) stays on the pull path so it is never lost. A GDPR erasure request also deletes any pack still waiting to be delivered. The Evidence delivery page of the dashboard shows the measured time from delivery to deletion for your own packs over the last 30 days.
How to read the retention date
AMLR requires you to keep customer due diligence records for 5 years after the end of the business relationship with the customer, or after the date of an occasional transaction. A competent authority can extend that period in specific cases, and the records must be deleted once it ends.
amlrSuggestedRetentionUntil is the decision date plus 5 years. It matches your retention period only for an occasional transaction carried out when the check ran. For a business relationship, your period starts when the relationship ends, a date only you know, so it ends later than this date. Treat the field as the earliest possible end of retention, never as a deletion date: start the 5 years from the end of the relationship in your own records, and apply any longer period your supervisor or national law sets.
Nexiel never sees or stores the private key
The key pair is generated in your own browser, and only the public half is ever exported for upload. The password that protects the downloaded key file is used in your browser only. The registration endpoint also checks the shape of anything it receives and rejects a JWK carrying a private-key component outright, a safeguard against a modified client, a compromised browser extension, or a bug ever sending one by mistake. Nexiel's production service only ever encrypts evidence packs. It never holds a private key, so it cannot decrypt one.
const keyPair = await crypto.subtle.generateKey(
{ name: 'ECDH', namedCurve: 'P-256' },
true,
['deriveKey', 'deriveBits'],
);
// Encrypted with your password in the browser (PBES2-HS512+A256KW,
// A256GCM), then downloaded to your device. Never sent anywhere.
const privateKeyJwk = await crypto.subtle.exportKey('jwk', keyPair.privateKey);
// Only this half is ever uploaded to Nexiel.
const publicKeyJwk = await crypto.subtle.exportKey('jwk', keyPair.publicKey);