KeyVaultEkmClient class

The KeyVaultEkmClient provides asynchronous methods to create, get, update, delete and check the External Key Manager (EKM) connection for an Azure Key Vault Managed HSM.

Constructors

KeyVaultEkmClient(string, TokenCredential, EkmClientOptions)

Creates an instance of the KeyVaultEkmClient.

Example usage:

import { DefaultAzureCredential } from "@azure/identity";
import { KeyVaultEkmClient } from "@azure/keyvault-admin";

const vaultUrl = `https://<MY KEY VAULT HERE>.managedhsm.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultEkmClient(vaultUrl, credentials);

Properties

vaultUrl

The base URL to the vault.

Methods

checkEkmConnection(CheckEkmConnectionOptions)

Checks the connectivity and authentication with the EKM proxy. This operation requires the ekm/read permission.

createEkmConnection(EkmConnection, CreateEkmConnectionOptions)

Sets up the EKM connection. If the EKM connection already exists, this operation fails. This operation requires the ekm/write permission.

deleteEkmConnection(DeleteEkmConnectionOptions)

Deletes the existing EKM connection. If the EKM connection does not already exist, this operation fails. This operation requires the ekm/delete permission.

getEkmCertificate(GetEkmCertificateOptions)

Returns the client certificate that Managed HSM uses to authenticate to the EKM proxy. This operation requires the ekm/read permission.

getEkmConnection(GetEkmConnectionOptions)

Returns the EKM connection. This operation requires the ekm/read permission.

updateEkmConnection(EkmConnection, UpdateEkmConnectionOptions)

Updates the existing EKM connection. If the EKM connection does not exist, this operation fails. This operation requires the ekm/write permission.

Constructor Details

KeyVaultEkmClient(string, TokenCredential, EkmClientOptions)

Creates an instance of the KeyVaultEkmClient.

Example usage:

import { DefaultAzureCredential } from "@azure/identity";
import { KeyVaultEkmClient } from "@azure/keyvault-admin";

const vaultUrl = `https://<MY KEY VAULT HERE>.managedhsm.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultEkmClient(vaultUrl, credentials);
new KeyVaultEkmClient(vaultUrl: string, credential: TokenCredential, options?: EkmClientOptions)

Parameters

vaultUrl

string

the URL of the Key Vault. It should have this shape: https://${your-key-vault-name}.managedhsm.azure.net. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.

credential
TokenCredential

An object that implements the TokenCredential interface used to authenticate requests to the service. Use the @azure/identity package to create a credential that suits your needs.

options
EkmClientOptions

options used to configure Key Vault API requests.

Property Details

vaultUrl

The base URL to the vault.

vaultUrl: string

Property Value

string

Method Details

checkEkmConnection(CheckEkmConnectionOptions)

Checks the connectivity and authentication with the EKM proxy. This operation requires the ekm/read permission.

function checkEkmConnection(options?: CheckEkmConnectionOptions): Promise<EkmProxyInfo>

Parameters

options
CheckEkmConnectionOptions

the optional parameters.

Returns

Promise<EkmProxyInfo>

createEkmConnection(EkmConnection, CreateEkmConnectionOptions)

Sets up the EKM connection. If the EKM connection already exists, this operation fails. This operation requires the ekm/write permission.

function createEkmConnection(ekmConnection: EkmConnection, options?: CreateEkmConnectionOptions): Promise<EkmConnection>

Parameters

ekmConnection
EkmConnection

the EKM connection to create.

options
CreateEkmConnectionOptions

the optional parameters.

Returns

Promise<EkmConnection>

deleteEkmConnection(DeleteEkmConnectionOptions)

Deletes the existing EKM connection. If the EKM connection does not already exist, this operation fails. This operation requires the ekm/delete permission.

function deleteEkmConnection(options?: DeleteEkmConnectionOptions): Promise<EkmConnection>

Parameters

options
DeleteEkmConnectionOptions

the optional parameters.

Returns

Promise<EkmConnection>

getEkmCertificate(GetEkmCertificateOptions)

Returns the client certificate that Managed HSM uses to authenticate to the EKM proxy. This operation requires the ekm/read permission.

function getEkmCertificate(options?: GetEkmCertificateOptions): Promise<EkmProxyClientCertificateInfo>

Parameters

options
GetEkmCertificateOptions

the optional parameters.

Returns

getEkmConnection(GetEkmConnectionOptions)

Returns the EKM connection. This operation requires the ekm/read permission.

function getEkmConnection(options?: GetEkmConnectionOptions): Promise<EkmConnection>

Parameters

options
GetEkmConnectionOptions

the optional parameters.

Returns

Promise<EkmConnection>

updateEkmConnection(EkmConnection, UpdateEkmConnectionOptions)

Updates the existing EKM connection. If the EKM connection does not exist, this operation fails. This operation requires the ekm/write permission.

function updateEkmConnection(ekmConnection: EkmConnection, options?: UpdateEkmConnectionOptions): Promise<EkmConnection>

Parameters

ekmConnection
EkmConnection

the updated EKM connection.

options
UpdateEkmConnectionOptions

the optional parameters.

Returns

Promise<EkmConnection>