import { GeneralSign } from "https://deno.land/x/jose@v4.11.2/jws/general/sign.ts";
The GeneralSign class is a utility for creating General JWS objects.
Examples
Usage
Usage
const jws = await new jose.GeneralSign(
new TextEncoder().encode('It’s a dangerous business, Frodo, going out your door.'),
)
.addSignature(ecPrivateKey)
.setProtectedHeader({ alg: 'ES256' })
.addSignature(rsaPrivateKey)
.setProtectedHeader({ alg: 'PS256' })
.sign()
console.log(jws)
Methods
addSignature(key: KeyLike | Uint8Array, options?: SignOptions): Signature
Adds an additional signature for the General JWS object.
sign(): Promise<GeneralJWS>
Signs and resolves the value of the General JWS object.