1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-24 04:09:13 +01:00
ntfy/examples/publish-js/publish-encrypted.js

8 lines
246 B
JavaScript
Raw Normal View History

2022-07-08 14:16:03 +02:00
import * as jose from 'jose'
async function publish() {
const jwe = await new jose.CompactEncrypt(new TextEncoder().encode('Secret message from JS!'))
.setProtectedHeader({ alg: 'dir', enc: 'A256GCM' })
.encrypt(publicKey)
}