Skip to content
Discussion options

You must be logged in to vote

This is not well explained, you have to pass apu and apv like so.

import * as crypto from "crypto";
import * as jose from "jose";

const recipient = crypto.generateKeyPairSync("x25519");

const data = Buffer.from(
  "You can trust us to stick with you through thick and thin–to the bitter end. And you can trust us to keep any secret of yours–closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."
);

const jwe = await new jose.CompactEncrypt(data)
  .setProtectedHeader({
    alg: "ECDH-ES",
    enc: "A256GCM",
  })
  .setKeyManagementParameters({
    apu: Buffer.from("apu value"),
    apv: Buffer.from("…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by huckle-panda
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants