openssl dgst -sha384 -binary wgp-seal.js | openssl base64 -A
<script src="https://VAS-ORIGIN.example/wgp-seal.js"
integrity="sha384-…HASH…" crossorigin="anonymous"></script>
<script>
WGPSeal.configure({ endpoints: ["/api/submit"], keyUrl: "/wgp-key.json" });
// běžný fetch POST se zapečetí sám:
await fetch("/api/submit", { method:"POST", body: JSON.stringify(data) });
</script>const WGP = require("./wgp-seal.js");
// SRV = { privateKey, publicRaw } // v produkci z HSM/KMS
app.post("/api/submit", express.text({type:"*/*"}), async (req,res)=>{
const env = JSON.parse(req.body);
const opened = await WGP.openRequest(env, SRV.privateKey, SRV.publicRaw); // dešifruj
// ... vaše logika: opened.obj ...
const resp = await WGP.sealResponse(opened.respKey, opened.header, {status:"ok"});
res.type("application/wgp-sealed+json").send(JSON.stringify(resp));
});