HashiCorp Vault Signer Factory API Reference
This document provides a concise API reference for the VaultSignerFactory
class within the Hedera DID SDK for JavaScript. The VaultSignerFactory
class is responsible for creating Vault Signer
instances and authenticating with HashiCorp Vault to securely manage cryptographic keys.
Class Diagram
The class diagram below illustrates the core methods of the Vault VaultSignerFactory
interface for interacting with HashiCorp Vault.

Static Methods
loginWithToken
static loginWithToken(
options: VaultLoginWithTokenOptions,
): Promise<VaultSignerFactory>
Creates a new VaultSignerFactory
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
VaultSignerFactory
instance.
loginWithUsernameAndPassword
static loginWithUsernameAndPassword(
options: VaultLoginWithUsernameAndPasswordOptions,
): Promise<VaultSignerFactory>
Creates a new VaultSignerFactory
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
VaultSignerFactory
instance.
loginWithAppRole
static async loginWithAppRole(
options: VaultLoginWithAppRoleOptions,
): Promise<VaultSignerFactory>
Creates a new VaultSignerFactory
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
VaultSignerFactory
instance.
Methods
Data Types
This section elaborates on the data types employed within the VaultSignerFactory
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 Hashgraph DID SDK provides the VaultSignerFactory
class within its signer-hashicorp-vault
package. For further details, refer to the @hashgraph-did-sdk-js/signer-hashicorp-vault
package documentation.