publish-encrypted.js 246 B

1234567
  1. import * as jose from 'jose'
  2. async function publish() {
  3. const jwe = await new jose.CompactEncrypt(new TextEncoder().encode('Secret message from JS!'))
  4. .setProtectedHeader({ alg: 'dir', enc: 'A256GCM' })
  5. .encrypt(publicKey)
  6. }