Options
All
  • Public
  • Public/Protected
  • All
Menu

Verify data using signature and key(COSE, JWK or PEM).

Hierarchy

  • default

Index

Constructors

Methods

  • verifyWithCOSEKey(data: Buffer, signature: Buffer, key: coseMap): Promise<boolean>
  • Verify data using signature and COSE key.

    throws

    {@link KeyParseError} if COSE key is imperfect

    Parameters

    • data: Buffer

      verification content

    • signature: Buffer

      calculated signature for data

    • key: coseMap

      public key

    Returns Promise<boolean>

    Validity of signature

  • verifyWithJWK(data: Buffer, signature: Buffer, key: jwk): Promise<boolean>
  • Verify data using signature and JWK.

    throws

    {@link KeyParseError} if JWK is imperfect

    Parameters

    • data: Buffer

      verification content

    • signature: Buffer

      calculated signature for data

    • key: jwk

      public key

    Returns Promise<boolean>

    Validity of signature

  • verifyWithPEM(data: Buffer, signature: Buffer, key: string, algorithm: string, hashAlgorithm?: string): boolean
  • Verify data using signature and PEM.

    Parameters

    • data: Buffer

      verification content

    • signature: Buffer

      calculated signature for data

    • key: string

      public key

    • algorithm: string
    • Optional hashAlgorithm: string

    Returns boolean

    Validity of signature

Generated using TypeDoc