Table of Contents

Class EcdhEsJweEncryptor

Namespace
Tessio.Verifier.OpenId4Vp
Assembly
Tessio.Verifier.OpenId4Vp.dll

Encrypts a JWE with ECDH-ES Direct Key Agreement and A256GCM, the shape a HAIP wallet uses for a direct_post.jwt response.

public static class EcdhEsJweEncryptor
Inheritance
EcdhEsJweEncryptor
Inherited Members

Remarks

The sender side of Tessio.Verifier.OpenId4Vp.EcdhEsJweDecryptor, kept next to it and shared by everything that plays the wallet: the Mock-mode background wallet and the test helpers both call this rather than each assembling the JWE. A wallet stand-in that encrypts differently from what we advertise, or differently from what our own decryptor expects, tests nothing that matters, which is the mistake that let a content encryption no real wallet would choose sit green for months.

Assembled by hand rather than via JsonWebTokenHandler because that library cannot encrypt with AES-GCM at all (it answers IDX10715), and its AES-GCM is Windows-only regardless. Both alg and enc mirror exactly what ClientMetadata advertises under HAIP 1.0 §5.

Methods

Encrypt(string, string)

Encrypts plaintextJson to recipientJwkJson, a P-256 public JWK carrying a kid. Returns the JWE compact serialization.

public static string Encrypt(string plaintextJson, string recipientJwkJson)

Parameters

plaintextJson string
recipientJwkJson string

Returns

string