whiteflag-js
    Preparing search index...

    A class representing a JSON Web Token (JWS) Jws

    Whiteflag uses JSON Web Signatures (JWS) for one of its authentication methods. This class provides the basic (not Whiteflag- specific) functionality to create, sign and convert JWSs for other Whiteflag packages.

    Index

    Methods

    • Function

      Returns the JWS signature getSignature

      Returns string

      a string with the the JWS signature

    • Function

      Returns the JWS signature input getSignInput

      Returns string

      a string with the input to be signed by the signing algorithm

    • Function

      Indicates if the JWS has been signed isSigned

      Returns boolean

      true if signed, else false

    • Function

      Sets the identifier of the signing algorithm, if not yet signed setSignAlgorithm

      Parameters

      • algorithm: string

        the identifier of the algorithm used to sign the payload

      Returns boolean

      true if identifier could be set, false if already signed

    • Function

      Sets the signature, if not yet signed setSignature

      Parameters

      • signature: string

        the base64url encoded signature

      Returns boolean

      true if signature could be added, false if already signed

    • Function

      Return a compact serialised JWS as a compact serialized string toCompact

      Returns string

      the JWS as a compact serialized JWS string

    • Function

      Returns a flattened JWS toFlat

      Returns Object

      the JWS as a flattened JWS plain JavaScript object

    • Function

      Returns a full JWS toFull

      Returns Object

      the JWS as a full JWS plain JavaScript object

    • Function

      Creates a new JWS object from a compact serialised JWS string fromCompact

      Parameters

      • jws: string

        a compact serialised JWS string

      Returns Jws

      a new JWS object

    • Function

      Creates a new JWS object from a plain javaScript object fromObject

      Parameters

      • jws: any

        a plain object

      Returns Jws

      a new JWS object

    • Function

      Creates a new JWS from a payload fromPayload

      Parameters

      • payload: Object

        the JWS payload

      Returns Jws

      a new Binary Array