Thread resolver return types through verify and decrypt results. Add overloads so wrappers can forward either keys or resolvers. Infer importJWK and generateSecret results from their inputs. Keep JWT payload generics unconstrained while rejecting known non-object shapes. Signed-off-by: Filip Skokan <[email protected]>
2.5 KiB
Interface: Signature
💗 Help the project
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
Used to build General JWS object's individual signatures.
Methods
addSignature()
â–¸ addSignature(key, options?): Signature
A shorthand for calling addSignature() on the enclosing GeneralSign instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
KeyInput |
Private Key or Secret to sign the individual JWS signature with. See Algorithm Key Requirements. |
options? |
SignOptions |
JWS Sign options. |
Returns
Signature
done()
â–¸ done(): GeneralSign
Returns the enclosing GeneralSign instance
Returns
setProtectedHeader()
â–¸ setProtectedHeader(protectedHeader): Signature
Sets the JWS Protected Header on the Signature object.
Parameters
| Parameter | Type | Description |
|---|---|---|
protectedHeader |
JWSHeaderParameters |
JWS Protected Header. |
Returns
Signature
setUnprotectedHeader()
â–¸ setUnprotectedHeader(unprotectedHeader): Signature
Sets the JWS Unprotected Header on the Signature object.
Parameters
| Parameter | Type | Description |
|---|---|---|
unprotectedHeader |
JWSHeaderParameters |
JWS Unprotected Header. |
Returns
Signature
sign()
â–¸ sign(): Promise<GeneralJWS>
A shorthand for calling sign() on the enclosing GeneralSign instance. Takes no arguments — each signature's key is supplied to addSignature.