Back to Jose

Interface: Signature

docs/jws/general/sign/interfaces/Signature.md

6.2.122.4 KB
Original Source

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.

Configures an individual signature in a General JWS.

Methods

addSignature()

ā–ø addSignature(key, options?): Signature

Adds another signature to the enclosing GeneralSign and returns its configuration.

Parameters

ParameterTypeDescription
keyKeyInputPrivate key or shared secret. See Algorithm Key Requirements.
options?SignOptionsJWS Sign options.

Returns

Signature


done()

ā–ø done(): GeneralSign

Returns the enclosing GeneralSign instance.

Returns

GeneralSign


setProtectedHeader()

ā–ø setProtectedHeader(protectedHeader): Signature

Sets the JWS Protected Header. May only be called once.

Parameters

ParameterTypeDescription
protectedHeaderJWSHeaderParametersJWS Protected Header.

Returns

Signature


setUnprotectedHeader()

ā–ø setUnprotectedHeader(unprotectedHeader): Signature

Sets the JWS Unprotected Header. May only be called once.

Parameters

ParameterTypeDescription
unprotectedHeaderJWSHeaderParametersJWS Unprotected Header.

Returns

Signature


sign()

ā–ø sign(): Promise<GeneralJWS>

Creates all signatures on the enclosing GeneralSign, using their configured keys.

Returns

Promise<GeneralJWS>