HashiCorp Vault Verifier Factory API Reference
This document provides a concise API reference for the VaultVerifierFactory class within the Hedera DID SDK for JavaScript. The VaultVerifierFactory class is responsible for creating Vault Verifier instances and authenticating with HashiCorp Vault to securely manage cryptographic keys.
Class Diagram
The class diagram below illustrates the core methods of the Vault VaultVerifierFactory interface for interacting with HashiCorp Vault.
Static Methods
loginWithToken
static loginWithToken(
options: VaultLoginWithTokenOptions,
): Promise<VaultVerifierFactory>
Creates a new VaultVerifierFactory instance by authenticating with HashiCorp Vault using an access token.
- Parameters
-
-
options: An object containing the necessary options to authenticate with HashiCorp Vault using an access token (refer to VaultLoginWithTokenOptions Type for details).
-
- Returns
-
-
The new
VaultVerifierFactoryinstance.
-
loginWithUsernameAndPassword
static loginWithUsernameAndPassword(
options: VaultLoginWithUsernameAndPasswordOptions,
): Promise<VaultVerifierFactory>
Creates a new VaultVerifierFactory instance by authenticating with HashiCorp Vault using a username and password.
- Parameters
-
-
options: An object containing the necessary options to authenticate with HashiCorp Vault using a username and password (refer to VaultLoginWithUsernameAndPasswordOptions Type for details).
-
- Returns
-
-
The new
VaultVerifierFactoryinstance.
-
loginWithAppRole
static async loginWithAppRole(
options: VaultLoginWithAppRoleOptions,
): Promise<VaultVerifierFactory>
Creates a new VaultVerifierFactory instance by authenticating with HashiCorp Vault using an AppRole.
- Parameters
-
-
options: An object containing the necessary options to authenticate with HashiCorp Vault using an AppRole (refer to VaultLoginWithAppRoleOptions Type for details).
-
- Returns
-
-
The new
VaultVerifierFactoryinstance.
-
Data Types
This section elaborates on the data types employed within the VaultVerifierFactory class.
VaultLoginWithTokenOptions Type
The VaultLoginWithTokenOptions type is an object that contains the necessary options to authenticate with HashiCorp Vault using an access token.
| Name | Type | Description |
|---|---|---|
token |
|
The access token used to authenticate with HashiCorp Vault. |
url |
|
The URL of the HashiCorp Vault server. |
transitPath? |
|
The path for the transit secret engine. Default is |
VaultLoginWithUsernameAndPasswordOptions Type
The VaultLoginWithUsernameAndPasswordOptions type is an object that contains the necessary options to authenticate with HashiCorp Vault using a username and password.
| Name | Type | Description |
|---|---|---|
username |
|
The username used to authenticate with HashiCorp Vault. |
password |
|
The password used to authenticate with HashiCorp Vault. |
url |
|
The URL of the HashiCorp Vault server. |
transitPath? |
|
The path for the transit secret engine. Default is |
VaultLoginWithAppRoleOptions Type
The VaultLoginWithAppRoleOptions type is an object that contains the necessary options to authenticate with HashiCorp Vault using an AppRole.
| Name | Type | Description |
|---|---|---|
roleId |
|
The ID of the AppRole used to authenticate with HashiCorp Vault. |
secretId |
|
The secret ID of the AppRole used to authenticate with HashiCorp Vault. |
url |
|
The URL of the HashiCorp Vault server. |
transitPath? |
|
The path for the transit secret engine. Default is |
Errors
| Exception code | Description |
|---|---|
|
Specified key does not exist or cannot be accessed. |
|
Vault authentication failed. |
Class Implementation
The Hiero DID SDK provides the VaultVerifierFactory class within its verifier-hashicorp-vault package. For further details, refer to the @hiero-did-sdk-js/verifier-hashicorp-vault package documentation.