Skip to main content
When you send client data through the API, encrypt HYOK fields before they leave your systems. The Node.js SDK does this for you. It encrypts each configured field with a fresh data key, wraps the data key with your HYOK public key, and computes the normalized hash that Corsa uses for exact search and screening. Corsa never receives the plaintext. You don’t need any credential for your HYOK stack to encrypt. Encryption uses only the public half of your HYOK key.

Pin your public key

Take the public key from your own AWS account, not from Corsa. This way, nobody can substitute a different key without you noticing.
Settings → Encryption shows your HYOK key ARN. Corsa also shows the same public key and its fingerprint there (stackOutputs.piiPublicKeySpki and piiKeyId). Check that the fingerprints match.

Configure the client


What the SDK sends

For each protected field, the SDK sends an envelope (version 2) that contains:
  • the value encrypted with AES-256-GCM under a random 256-bit data key;
  • the data key wrapped with RSA-OAEP-SHA256 under your public key, together with the field’s resource (corsa:v2:<platformId>:<entityType>:<fieldPath>);
  • the key ID;
  • hashData: the SHA-256 of the normalized value.
Corsa turns hashData into the stored keyed index with your workspace’s salt. Corsa can’t decrypt the value. Reading values back through the API returns the envelopes. Decrypt them for your users in the Secure Viewer. Server-side decryption outside your Secure Viewer isn’t supported.

Migrating from the previous SDK setup

Earlier versions configured apiSecret and encryptionServiceUrl for an encryption credential. HYOK no longer uses machine credentials for encryption. Replace them with publicKey, and delete any SDK secrets you created in your HYOK stack.