HashiCorp Vault Verifier API Reference

This document provides a concise API reference for the Vault Verifier class within the Hedera DID SDK for JavaScript. This class is responsible for verifying signatures using HashiCorp Vault as the key store.

Class Diagram

The class diagram below illustrates the core methods of the Vault Verifier interface for interacting with cryptographic keys stored in HashiCorp Vault.

vault verifier class diagram

Constructor

constructor

constructor(options: VerifierOptions)

Initializes a new Verifier instance.

Parameters
  • options: (Required) An object containing the necessary options to create a Verifier instance (refer to VerifierOptions Type for details).

Methods

publicKey

publicKey(): string

Returns the public key associated with the Verifier instance in DER format.

Returns

The public key in DER format.

verify

verify(message: Uint8Array, signature: Uint8Array): boolean

Verifies the given signature using the public key stored in HashiCorp Vault.

Parameters
  • message: The message that was signed.

  • signature: The signature to be verified.

Returns

true if the signature is valid, false otherwise.

Data Types

This section elaborates on the data types employed within the Verifier class.

VerifierOptions Type

The VerifierOptions type is an object that contains the necessary options to create a Verifier instance.

Name Type Description

clientApi

VaultApi

An internal API object that interacts with HashiCorp Vault.

keyName

string

A unique identifier for the key stored in HashiCorp Vault.

Errors

Exception code Description

internalError

When a Vault API call fails. Message contains the error details.

Class Implementation

The Hashgraph DID SDK provides the Vault Verifier class within its verifier-hashicorp-vault package. For further details, refer to the @hashgraph-did-sdk-js/verifier-hashicorp-vault package documentation.