@azure/keyvault-keys 4.10.2 → 4.11.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -2
- package/dist/browser/api/keyVaultContext.js +1 -1
- package/dist/browser/api/keyVaultContext.js.map +1 -1
- package/dist/browser/api/operations.d.ts +10 -2
- package/dist/browser/api/operations.d.ts.map +1 -1
- package/dist/browser/api/operations.js +65 -1
- package/dist/browser/api/operations.js.map +1 -1
- package/dist/browser/api/options.d.ts +6 -0
- package/dist/browser/api/options.d.ts.map +1 -1
- package/dist/browser/api/options.js.map +1 -1
- package/dist/browser/constants.d.ts.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/cryptography/models.d.ts.map +1 -1
- package/dist/browser/cryptography/models.js.map +1 -1
- package/dist/browser/cryptographyClient.d.ts.map +1 -1
- package/dist/browser/cryptographyClient.js.map +1 -1
- package/dist/browser/cryptographyClientModels.d.ts.map +1 -1
- package/dist/browser/cryptographyClientModels.js.map +1 -1
- package/dist/browser/index.d.ts +102 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +139 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/keyVaultClient.d.ts +6 -2
- package/dist/browser/keyVaultClient.d.ts.map +1 -1
- package/dist/browser/keyVaultClient.js +9 -1
- package/dist/browser/keyVaultClient.js.map +1 -1
- package/dist/browser/keysModels.d.ts +75 -2
- package/dist/browser/keysModels.d.ts.map +1 -1
- package/dist/browser/keysModels.js +5 -1
- package/dist/browser/keysModels.js.map +1 -1
- package/dist/browser/models/models.d.ts +37 -1
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +32 -0
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/transformations.d.ts.map +1 -1
- package/dist/browser/transformations.js +12 -0
- package/dist/browser/transformations.js.map +1 -1
- package/dist/commonjs/api/keyVaultContext.js +1 -1
- package/dist/commonjs/api/keyVaultContext.js.map +1 -1
- package/dist/commonjs/api/operations.d.ts +10 -2
- package/dist/commonjs/api/operations.d.ts.map +1 -1
- package/dist/commonjs/api/operations.js +82 -0
- package/dist/commonjs/api/operations.js.map +2 -2
- package/dist/commonjs/api/options.d.ts +6 -0
- package/dist/commonjs/api/options.d.ts.map +1 -1
- package/dist/commonjs/api/options.js.map +1 -1
- package/dist/commonjs/constants.d.ts.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/cryptography/models.d.ts.map +1 -1
- package/dist/commonjs/cryptography/models.js.map +1 -1
- package/dist/commonjs/cryptographyClient.d.ts.map +1 -1
- package/dist/commonjs/cryptographyClient.js.map +2 -2
- package/dist/commonjs/cryptographyClientModels.d.ts.map +1 -1
- package/dist/commonjs/cryptographyClientModels.js.map +1 -1
- package/dist/commonjs/index.d.ts +102 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +158 -0
- package/dist/commonjs/index.js.map +3 -3
- package/dist/commonjs/keyVaultClient.d.ts +6 -2
- package/dist/commonjs/keyVaultClient.d.ts.map +1 -1
- package/dist/commonjs/keyVaultClient.js +8 -0
- package/dist/commonjs/keyVaultClient.js.map +2 -2
- package/dist/commonjs/keysModels.d.ts +75 -2
- package/dist/commonjs/keysModels.d.ts.map +1 -1
- package/dist/commonjs/keysModels.js +3 -1
- package/dist/commonjs/keysModels.js.map +2 -2
- package/dist/commonjs/models/models.d.ts +37 -1
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +38 -4
- package/dist/commonjs/models/models.js.map +2 -2
- package/dist/commonjs/transformations.d.ts.map +1 -1
- package/dist/commonjs/transformations.js +12 -0
- package/dist/commonjs/transformations.js.map +2 -2
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/api/keyVaultContext.js +1 -1
- package/dist/esm/api/keyVaultContext.js.map +1 -1
- package/dist/esm/api/operations.d.ts +10 -2
- package/dist/esm/api/operations.d.ts.map +1 -1
- package/dist/esm/api/operations.js +65 -1
- package/dist/esm/api/operations.js.map +1 -1
- package/dist/esm/api/options.d.ts +6 -0
- package/dist/esm/api/options.d.ts.map +1 -1
- package/dist/esm/api/options.js.map +1 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/cryptography/models.d.ts.map +1 -1
- package/dist/esm/cryptography/models.js.map +1 -1
- package/dist/esm/cryptographyClient.d.ts.map +1 -1
- package/dist/esm/cryptographyClient.js.map +1 -1
- package/dist/esm/cryptographyClientModels.d.ts.map +1 -1
- package/dist/esm/cryptographyClientModels.js.map +1 -1
- package/dist/esm/index.d.ts +102 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +139 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/keyVaultClient.d.ts +6 -2
- package/dist/esm/keyVaultClient.d.ts.map +1 -1
- package/dist/esm/keyVaultClient.js +9 -1
- package/dist/esm/keyVaultClient.js.map +1 -1
- package/dist/esm/keysModels.d.ts +75 -2
- package/dist/esm/keysModels.d.ts.map +1 -1
- package/dist/esm/keysModels.js +5 -1
- package/dist/esm/keysModels.js.map +1 -1
- package/dist/esm/models/models.d.ts +37 -1
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +32 -0
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/transformations.d.ts.map +1 -1
- package/dist/esm/transformations.js +12 -0
- package/dist/esm/transformations.js.map +1 -1
- package/package.json +7 -7
package/dist/browser/index.js
CHANGED
|
@@ -227,6 +227,55 @@ export class KeyClient {
|
|
|
227
227
|
const keyType = options?.hsm ? KnownKeyTypes.OctHSM : KnownKeyTypes.Oct;
|
|
228
228
|
return this.createKey(name, keyType, options);
|
|
229
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* The createExternalKey method creates a new key in Azure Key Vault that is backed by a key
|
|
232
|
+
* stored in an external key management system. If the named key already exists, Azure Key Vault
|
|
233
|
+
* creates a new version of the key. It requires the keys/create permission.
|
|
234
|
+
*
|
|
235
|
+
* The key type and key size must not be specified for external keys; the service derives them
|
|
236
|
+
* from the referenced external key.
|
|
237
|
+
*
|
|
238
|
+
* Example usage:
|
|
239
|
+
* ```ts snippet:ReadmeSampleCreateExternalKey
|
|
240
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
241
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
|
242
|
+
*
|
|
243
|
+
* const credential = new DefaultAzureCredential();
|
|
244
|
+
*
|
|
245
|
+
* const vaultName = "<YOUR KEYVAULT NAME>";
|
|
246
|
+
* const url = `https://${vaultName}.managedhsm.azure.net`;
|
|
247
|
+
*
|
|
248
|
+
* const client = new KeyClient(url, credential);
|
|
249
|
+
*
|
|
250
|
+
* const keyName = "MyKeyName";
|
|
251
|
+
* const result = await client.createExternalKey(keyName, { id: "my-external-key-id" });
|
|
252
|
+
* console.log("result: ", result);
|
|
253
|
+
* ```
|
|
254
|
+
* Creates a new key, stores it, then returns key parameters and properties to the client.
|
|
255
|
+
* @param name - The name of the key.
|
|
256
|
+
* @param externalKey - A reference to the key stored in the external key management system.
|
|
257
|
+
* @param options - The optional parameters.
|
|
258
|
+
*/
|
|
259
|
+
async createExternalKey(name, externalKey, options = {}) {
|
|
260
|
+
return tracingClient.withSpan("KeyClient.createExternalKey", options, async (updatedOptions) => {
|
|
261
|
+
// Key type and key size must not be specified for external keys; the
|
|
262
|
+
// service derives the key type from the referenced external key.
|
|
263
|
+
const parameters = {
|
|
264
|
+
keyAttributes: {
|
|
265
|
+
enabled: options?.enabled,
|
|
266
|
+
notBefore: options?.notBefore,
|
|
267
|
+
expires: options?.expiresOn,
|
|
268
|
+
exportable: options?.exportable,
|
|
269
|
+
externalKey,
|
|
270
|
+
},
|
|
271
|
+
keyOps: options?.keyOps,
|
|
272
|
+
releasePolicy: options?.releasePolicy,
|
|
273
|
+
tags: options?.tags,
|
|
274
|
+
};
|
|
275
|
+
const response = await this.client.createKey(name, parameters, updatedOptions);
|
|
276
|
+
return getKeyFromKeyBundle(response);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
230
279
|
/**
|
|
231
280
|
* The import key operation may be used to import any key type into an Azure Key Vault. If the
|
|
232
281
|
* named key already exists, Azure Key Vault creates a new version of the key. This operation
|
|
@@ -743,6 +792,95 @@ export class KeyClient {
|
|
|
743
792
|
return { value: result.value };
|
|
744
793
|
});
|
|
745
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Wraps a 256-bit AES key generated inside a Trusted Execution Environment
|
|
797
|
+
* (TEE) using a key encryption key previously stored in Azure Key Vault.
|
|
798
|
+
*
|
|
799
|
+
* Unlike {@link CryptographyClient.wrapKey}, the key being wrapped is
|
|
800
|
+
* generated by the service inside a TEE rather than supplied by the caller,
|
|
801
|
+
* which provides additional protection for the symmetric key material.
|
|
802
|
+
*
|
|
803
|
+
* This operation requires the `keys/wrapKey` permission.
|
|
804
|
+
*
|
|
805
|
+
* Example usage:
|
|
806
|
+
* ```ts snippet:ReadmeSampleSecureWrapKey
|
|
807
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
808
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
|
809
|
+
*
|
|
810
|
+
* const credential = new DefaultAzureCredential();
|
|
811
|
+
*
|
|
812
|
+
* const vaultName = "<YOUR KEYVAULT NAME>";
|
|
813
|
+
* const url = `https://${vaultName}.managedhsm.azure.net`;
|
|
814
|
+
*
|
|
815
|
+
* const client = new KeyClient(url, credential);
|
|
816
|
+
*
|
|
817
|
+
* const wrapped = await client.secureWrapKey("myKey", "RSA-OAEP-256");
|
|
818
|
+
* console.log(wrapped.keyID, wrapped.algorithm, wrapped.result);
|
|
819
|
+
* ```
|
|
820
|
+
*
|
|
821
|
+
* @param name - The name of the key encryption key.
|
|
822
|
+
* @param algorithm - The algorithm to use to wrap the generated key.
|
|
823
|
+
* @param options - The optional parameters.
|
|
824
|
+
*/
|
|
825
|
+
secureWrapKey(name, algorithm, options = {}) {
|
|
826
|
+
return tracingClient.withSpan("KeyClient.secureWrapKey", options, async (updatedOptions) => {
|
|
827
|
+
const { version, ...rest } = updatedOptions;
|
|
828
|
+
const result = await this.client.secureWrapKey(name, version, { algorithm }, rest);
|
|
829
|
+
return {
|
|
830
|
+
keyID: result.kid ?? "",
|
|
831
|
+
algorithm: result.algorithm ?? algorithm,
|
|
832
|
+
result: result.result ?? new Uint8Array(),
|
|
833
|
+
};
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Unwraps a symmetric key that was previously wrapped via
|
|
838
|
+
* {@link KeyClient.secureWrapKey}. The unwrap operation runs inside a
|
|
839
|
+
* Trusted Execution Environment (TEE) attested by the Microsoft Azure
|
|
840
|
+
* Attestation Service (MAA).
|
|
841
|
+
*
|
|
842
|
+
* This operation requires the `keys/unwrapKey` permission.
|
|
843
|
+
*
|
|
844
|
+
* Example usage:
|
|
845
|
+
* ```ts snippet:ReadmeSampleSecureUnwrapKey
|
|
846
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
847
|
+
* import { KeyClient } from "@azure/keyvault-keys";
|
|
848
|
+
*
|
|
849
|
+
* const credential = new DefaultAzureCredential();
|
|
850
|
+
*
|
|
851
|
+
* const vaultName = "<YOUR KEYVAULT NAME>";
|
|
852
|
+
* const url = `https://${vaultName}.managedhsm.azure.net`;
|
|
853
|
+
*
|
|
854
|
+
* const client = new KeyClient(url, credential);
|
|
855
|
+
*
|
|
856
|
+
* const wrapped = await client.secureWrapKey("myKey", "RSA-OAEP-256");
|
|
857
|
+
* const unwrapped = await client.secureUnwrapKey(
|
|
858
|
+
* "myKey",
|
|
859
|
+
* wrapped.algorithm,
|
|
860
|
+
* wrapped.result,
|
|
861
|
+
* "<attestation-target>",
|
|
862
|
+
* );
|
|
863
|
+
* console.log(unwrapped.keyID, unwrapped.algorithm, unwrapped.result);
|
|
864
|
+
* ```
|
|
865
|
+
*
|
|
866
|
+
* @param name - The name of the key encryption key.
|
|
867
|
+
* @param algorithm - The algorithm originally used to wrap the value.
|
|
868
|
+
* @param value - The wrapped key value to unwrap.
|
|
869
|
+
* @param targetAttestationToken - The attestation assertion for the target
|
|
870
|
+
* of the key release.
|
|
871
|
+
* @param options - The optional parameters.
|
|
872
|
+
*/
|
|
873
|
+
secureUnwrapKey(name, algorithm, value, targetAttestationToken, options = {}) {
|
|
874
|
+
return tracingClient.withSpan("KeyClient.secureUnwrapKey", options, async (updatedOptions) => {
|
|
875
|
+
const { version, ...rest } = updatedOptions;
|
|
876
|
+
const result = await this.client.secureUnwrapKey(name, version, { algorithm, value, targetAttestationToken }, rest);
|
|
877
|
+
return {
|
|
878
|
+
keyID: result.kid ?? "",
|
|
879
|
+
algorithm: result.algorithm ?? algorithm,
|
|
880
|
+
result: result.result ?? new Uint8Array(),
|
|
881
|
+
};
|
|
882
|
+
});
|
|
883
|
+
}
|
|
746
884
|
/**
|
|
747
885
|
* Gets the rotation policy of a Key Vault Key.
|
|
748
886
|
* By default, all keys have a policy that will notify 30 days before expiry.
|
|
@@ -916,4 +1054,5 @@ export class KeyClient {
|
|
|
916
1054
|
return mapPagedAsyncIterable(options, this.client.getDeletedKeys.bind(this.client), getDeletedKeyFromDeletedKeyItem);
|
|
917
1055
|
}
|
|
918
1056
|
}
|
|
1057
|
+
export { RestError, isRestError } from "@azure/core-rest-pipeline";
|
|
919
1058
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAA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CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./logger.js\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { DeletionRecoveryLevel } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel } from \"./models/models.js\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\nimport { DeleteKeyPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedKeyPoller } from \"./lro/recover/poller.js\";\nimport type {\n BackupKeyOptions,\n BeginDeleteKeyOptions,\n BeginRecoverDeletedKeyOptions,\n CreateEcKeyOptions,\n CreateKeyOptions,\n CreateOctKeyOptions,\n CreateRsaKeyOptions,\n CryptographyClientOptions,\n CryptographyOptions,\n DeletedKey,\n GetCryptographyClientOptions,\n GetDeletedKeyOptions,\n GetKeyAttestationOptions,\n GetKeyOptions,\n GetKeyRotationPolicyOptions,\n GetRandomBytesOptions,\n ImportKeyOptions,\n JsonWebKey,\n KeyAttestation,\n KeyClientOptions,\n KeyExportEncryptionAlgorithm,\n KeyOperation,\n KeyPollerOptions,\n KeyProperties,\n KeyReleasePolicy,\n KeyRotationLifetimeAction,\n KeyRotationPolicy,\n KeyRotationPolicyAction,\n KeyRotationPolicyProperties,\n KeyType,\n KeyVaultKey,\n ListDeletedKeysOptions,\n ListPropertiesOfKeyVersionsOptions,\n ListPropertiesOfKeysOptions,\n PurgeDeletedKeyOptions,\n ReleaseKeyOptions,\n ReleaseKeyResult,\n RestoreKeyBackupOptions,\n RotateKeyOptions,\n UpdateKeyPropertiesOptions,\n UpdateKeyRotationPolicyOptions,\n} from \"./keysModels.js\";\nimport { KnownKeyOperations, LATEST_API_VERSION } from \"./keysModels.js\";\nimport { CryptographyClient } from \"./cryptographyClient.js\";\nimport type {\n AesCbcDecryptParameters,\n AesCbcEncryptParameters,\n AesCbcEncryptionAlgorithm,\n AesGcmDecryptParameters,\n AesGcmEncryptParameters,\n AesGcmEncryptionAlgorithm,\n DecryptOptions,\n DecryptParameters,\n DecryptResult,\n EncryptOptions,\n EncryptParameters,\n EncryptResult,\n EncryptionAlgorithm,\n KeyCurveName,\n KeyWrapAlgorithm,\n RsaDecryptParameters,\n RsaEncryptParameters,\n RsaEncryptionAlgorithm,\n SignOptions,\n SignResult,\n SignatureAlgorithm,\n UnwrapKeyOptions,\n UnwrapResult,\n VerifyDataOptions,\n VerifyOptions,\n VerifyResult,\n WrapKeyOptions,\n WrapResult,\n} from \"./cryptographyClientModels.js\";\nimport {\n KnownKeyExportEncryptionAlgorithm,\n KnownEncryptionAlgorithms,\n KnownKeyTypes,\n KnownKeyCurveNames,\n KnownSignatureAlgorithms,\n} from \"./cryptographyClientModels.js\";\nimport type { KeyVaultKeyIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultKeyIdentifier } from \"./identifier.js\";\nimport {\n getDeletedKeyFromDeletedKeyItem,\n getKeyFromKeyBundle,\n getKeyPropertiesFromKeyItem,\n keyRotationTransformations,\n mapPagedAsyncIterable,\n} from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\n\nexport {\n type CryptographyClientOptions,\n type KeyClientOptions,\n type BackupKeyOptions,\n type CreateEcKeyOptions,\n type CreateKeyOptions,\n type CreateRsaKeyOptions,\n type CreateOctKeyOptions,\n CryptographyClient,\n type CryptographyOptions,\n type RsaEncryptionAlgorithm,\n type RsaDecryptParameters,\n type AesGcmEncryptionAlgorithm,\n type AesGcmDecryptParameters,\n type AesCbcEncryptionAlgorithm,\n type AesCbcDecryptParameters,\n type DecryptParameters,\n type DecryptOptions,\n type DecryptResult,\n type DeletedKey,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type RsaEncryptParameters,\n type AesGcmEncryptParameters,\n type AesCbcEncryptParameters,\n type EncryptParameters,\n type EncryptOptions,\n type EncryptResult,\n type GetDeletedKeyOptions,\n type GetKeyAttestationOptions,\n type GetKeyOptions,\n type GetRandomBytesOptions,\n type ImportKeyOptions,\n type JsonWebKey,\n type KeyAttestation,\n type KeyCurveName,\n KnownKeyCurveNames,\n KnownKeyExportEncryptionAlgorithm,\n type EncryptionAlgorithm,\n KnownEncryptionAlgorithms,\n type KeyOperation,\n KnownKeyOperations,\n type KeyType,\n KnownKeyTypes,\n type KeyPollerOptions,\n type BeginDeleteKeyOptions,\n type BeginRecoverDeletedKeyOptions,\n type KeyProperties,\n type SignatureAlgorithm,\n KnownSignatureAlgorithms,\n type KeyVaultKey,\n type KeyWrapAlgorithm,\n type ListPropertiesOfKeysOptions,\n type ListPropertiesOfKeyVersionsOptions,\n type ListDeletedKeysOptions,\n type PageSettings,\n type PagedAsyncIterableIterator,\n type KeyVaultKeyIdentifier,\n parseKeyVaultKeyIdentifier,\n type PollOperationState,\n type PollerLike,\n type PurgeDeletedKeyOptions,\n type RestoreKeyBackupOptions,\n type RotateKeyOptions,\n type SignOptions,\n type SignResult,\n type UnwrapKeyOptions,\n type UnwrapResult,\n type UpdateKeyPropertiesOptions,\n type VerifyOptions,\n type VerifyDataOptions,\n type VerifyResult,\n type WrapKeyOptions,\n type WrapResult,\n type ReleaseKeyOptions,\n type ReleaseKeyResult,\n type KeyReleasePolicy,\n type KeyExportEncryptionAlgorithm,\n type GetCryptographyClientOptions,\n type KeyRotationPolicyAction,\n type KeyRotationPolicyProperties,\n type KeyRotationPolicy,\n type KeyRotationLifetimeAction,\n type UpdateKeyRotationPolicyOptions,\n type GetKeyRotationPolicyOptions,\n logger,\n};\n\n/**\n * The KeyClient provides methods to manage {@link KeyVaultKey} in the\n * Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultKeys. The\n * client also supports listing {@link DeletedKey} for a soft-delete enabled Azure Key\n * Vault.\n */\nexport class KeyClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * A reference to the credential that was used to construct this client.\n * Later used to instantiate a {@link CryptographyClient} with the same credential.\n */\n private readonly credential: TokenCredential;\n\n /**\n * Creates an instance of KeyClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`; // or `https://${vaultName}.managedhsm.azure.net` for managed HSM.\n *\n * // Lastly, create our keys client and connect to the service\n * const client = new KeyClient(url, credential);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.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.\n * @param credential - 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.\n * @param pipelineOptions - Pipeline options used to configure Key Vault API requests. Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: KeyClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const libInfo = `azsdk-js-keyvault-keys/${SDK_VERSION}`;\n\n const userAgentOptions = pipelineOptions.userAgentOptions;\n\n pipelineOptions.userAgentOptions = {\n userAgentPrefix:\n userAgentOptions && userAgentOptions.userAgentPrefix\n ? `${userAgentOptions.userAgentPrefix} ${libInfo}`\n : libInfo,\n };\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.credential = credential;\n this.client = new KeyVaultClient(vaultUrl, credential, internalPipelineOptions);\n\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions));\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The create key operation can be used to create any key type in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createKey(keyName, \"RSA\");\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param keyType - The type of the key. One of the following: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'.\n * @param options - The optional parameters.\n */\n public createKey(\n name: string,\n keyType: KeyType,\n options: CreateKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\"KeyClient.createKey\", options, async (updatedOptions) => {\n const response = await this.client.createKey(\n name,\n {\n kty: keyType,\n curve: options?.curve,\n keyAttributes: {\n enabled: options?.enabled,\n notBefore: options?.notBefore,\n expires: options?.expiresOn,\n exportable: options?.exportable,\n },\n keyOps: options?.keyOps,\n keySize: options?.keySize,\n releasePolicy: options?.releasePolicy,\n tags: options?.tags,\n },\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The createEcKey method creates a new elliptic curve key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateEcKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createEcKey(keyName, { curve: \"P-256\" });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createEcKey(name: string, options?: CreateEcKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.ECHSM : KnownKeyTypes.EC;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The createRSAKey method creates a new RSA key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateRsaKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createRsaKey(\"MyKey\", { keySize: 2048 });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createRsaKey(name: string, options?: CreateRsaKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.RSAHSM : KnownKeyTypes.RSA;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The createOctKey method creates a new OCT key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateOctKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createOctKey(\"MyKey\", { hsm: true });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createOctKey(name: string, options?: CreateOctKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.OctHSM : KnownKeyTypes.Oct;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The import key operation may be used to import any key type into an Azure Key Vault. If the\n * named key already exists, Azure Key Vault creates a new version of the key. This operation\n * requires the keys/import permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleImportKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const jsonWebKey = {\n * kty: \"RSA\",\n * kid: \"test-key-123\",\n * use: \"sig\",\n * alg: \"RS256\",\n * n: new Uint8Array([112, 34, 56, 98, 123, 244, 200, 99]),\n * e: new Uint8Array([1, 0, 1]),\n * d: new Uint8Array([45, 67, 89, 23, 144, 200, 76, 233]),\n * p: new Uint8Array([34, 89, 100, 77, 204, 56, 29, 77]),\n * q: new Uint8Array([78, 99, 201, 45, 188, 34, 67, 90]),\n * dp: new Uint8Array([23, 45, 78, 56, 200, 144, 32, 67]),\n * dq: new Uint8Array([12, 67, 89, 144, 99, 56, 23, 45]),\n * qi: new Uint8Array([78, 90, 45, 201, 34, 67, 120, 55]),\n * };\n *\n * const result = await client.importKey(\"MyKey\", jsonWebKey);\n * ```\n * Imports an externally created key, stores it, and returns key parameters and properties\n * to the client.\n * @param name - Name for the imported key.\n * @param key - The JSON web key.\n * @param options - The optional parameters.\n */\n public importKey(\n name: string,\n key: JsonWebKey,\n options: ImportKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.importKey`, options, async (updatedOptions) => {\n const { enabled, notBefore, expiresOn: expires, exportable, releasePolicy, tags } = options;\n const keyAttributes = {\n enabled,\n notBefore,\n expires,\n exportable,\n };\n const parameters = {\n key,\n hsm: options?.hardwareProtected,\n keyAttributes,\n releasePolicy,\n tags,\n };\n const response = await this.client.importKey(name, parameters, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * Gets a {@link CryptographyClient} for the given key.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetCryptographyClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * // Get a cryptography client for a given key\n * const cryptographyClient = client.getCryptographyClient(\"MyKey\");\n * ```\n * @param name - The name of the key used to perform cryptographic operations.\n * @param version - Optional version of the key used to perform cryptographic operations.\n * @returns - A {@link CryptographyClient} using the same options, credentials, and http client as this {@link KeyClient}\n */\n public getCryptographyClient(\n keyName: string,\n options?: GetCryptographyClientOptions,\n ): CryptographyClient {\n const keyUrl = new URL(\n [\"keys\", keyName, options?.keyVersion].filter(Boolean).join(\"/\"),\n this.vaultUrl,\n );\n\n // The goals of this method are discoverability and performance (by sharing a client and pipeline).\n // The existing cryptography client does not accept a pipeline as an argument, nor does it expose it.\n // In order to avoid publicly exposing the pipeline we will pass in the underlying client as an undocumented\n // property to the constructor so that crypto providers downstream can use it.\n const constructorOptions: CryptographyClientOptions & { generatedClient: KeyVaultClient } = {\n generatedClient: this.client,\n };\n const cryptoClient = new CryptographyClient(\n keyUrl.toString(),\n this.credential,\n constructorOptions,\n );\n return cryptoClient;\n }\n\n /**\n * The delete operation applies to any key stored in Azure Key Vault. Individual versions\n * of a key can not be deleted, only all versions of a given key at once.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the key is deleted.\n *\n * This operation requires the keys/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const poller = await client.beginDeleteKey(keyName);\n * await poller.pollUntilDone();\n * ```\n * Deletes a key from a specified key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async beginDeleteKey(\n name: string,\n options: BeginDeleteKeyOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>> {\n const poller = new DeleteKeyPoller({\n name,\n client: this.client,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the deletion of the key).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * The updateKeyProperties method changes specified properties of an existing stored key. Properties that\n * are not specified in the request are left unchanged. The value of a key itself cannot be\n * changed. This operation requires the keys/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyProperties\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.createKey(keyName, \"RSA\");\n * await client.updateKeyProperties(keyName, result.properties.version, {\n * enabled: false,\n * });\n * ```\n * Updates the properties associated with a specified key in a given key vault.\n * @param name - The name of the key.\n * @param keyVersion - The version of the key.\n * @param options - The optional parameters.\n */\n public updateKeyProperties(\n name: string,\n keyVersion: string,\n options?: UpdateKeyPropertiesOptions,\n ): Promise<KeyVaultKey>;\n /**\n * The updateKeyProperties method changes specified properties of the latest version of an existing stored key. Properties that\n * are not specified in the request are left unchanged. The value of a key itself cannot be\n * changed. This operation requires the keys/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyProperties\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.createKey(keyName, \"RSA\");\n * await client.updateKeyProperties(keyName, result.properties.version, {\n * enabled: false,\n * });\n * ```\n * Updates the properties associated with a specified key in a given key vault.\n * @param name - The name of the key.\n * @param keyVersion - The version of the key.\n * @param options - The optional parameters.\n */\n public updateKeyProperties(\n name: string,\n options?: UpdateKeyPropertiesOptions,\n ): Promise<KeyVaultKey>;\n public updateKeyProperties(\n ...args: [string, string, UpdateKeyPropertiesOptions?] | [string, UpdateKeyPropertiesOptions?]\n ): Promise<KeyVaultKey> {\n const [name, keyVersion, options] = this.disambiguateUpdateKeyPropertiesArgs(args);\n return tracingClient.withSpan(\n `KeyClient.updateKeyProperties`,\n options,\n async (updatedOptions) => {\n const response = await this.client.updateKey(\n name,\n keyVersion,\n {\n keyAttributes: {\n enabled: options?.enabled,\n notBefore: options?.notBefore,\n expires: options?.expiresOn,\n },\n keyOps: options?.keyOps,\n releasePolicy: options?.releasePolicy,\n tags: options?.tags,\n },\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Standardizes an overloaded arguments collection for the updateKeyProperties method.\n *\n * @param args - The arguments collection.\n * @returns - The standardized arguments collection.\n */\n private disambiguateUpdateKeyPropertiesArgs(\n args: [string, string, UpdateKeyPropertiesOptions?] | [string, UpdateKeyPropertiesOptions?],\n ): [string, string, UpdateKeyPropertiesOptions] {\n if (typeof args[1] === \"string\") {\n // [name, keyVersion, options?] => [name, keyVersion, options || {}]\n return [args[0], args[1], args[2] || {}];\n } else {\n // [name, options?] => [name , \"\", options || {}]\n return [args[0], \"\", args[1] || {}];\n }\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const latestKey = await client.getKey(keyName);\n * console.log(`Latest version of the key ${keyName}: `, latestKey);\n *\n * const specificKey = await client.getKey(keyName, { version: latestKey.properties.version! });\n * console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey);\n * ```\n * Get a specified key from a given key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.getKey`, options, async (updatedOptions) => {\n const response = await this.client.getKey(name, options.version || \"\", updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The getKeyAttestation method gets a specified key and its attestation blob and is applicable to any key stored in Azure Key Vault Managed HSM.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKeyAttestation\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT MANAGED HSM NAME>\";\n * const url = `https://${vaultName}.managedhsm.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const latestKey = await client.getKeyAttestation(keyName);\n * console.log(`Latest version of the key ${keyName}: `, latestKey);\n *\n * const specificKey = await client.getKeyAttestation(keyName, {\n * version: latestKey.properties.version!,\n * });\n * console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey);\n * ```\n * Get a specified key from a given key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getKeyAttestation(\n name: string,\n options: GetKeyAttestationOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n `KeyClient.getKeyAttestation`,\n options,\n async (updatedOptions) => {\n const response = await this.client.getKeyAttestation(\n name,\n updatedOptions.version,\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * The getDeletedKey method returns the specified deleted key along with its properties.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * await client.getDeletedKey(keyName);\n * ```\n * Gets the specified deleted key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getDeletedKey(name: string, options: GetDeletedKeyOptions = {}): Promise<DeletedKey> {\n return tracingClient.withSpan(`KeyClient.getDeletedKey`, options, async (updatedOptions) => {\n const response = await this.client.getDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The purge deleted key operation removes the key permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the keys/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const deletePoller = await client.beginDeleteKey(keyName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedKey(keyName);\n * ```\n * Permanently deletes the specified key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public purgeDeletedKey(name: string, options: PurgeDeletedKeyOptions = {}): Promise<void> {\n return tracingClient.withSpan(`KeyClient.purgeDeletedKey`, options, async (updatedOptions) => {\n await this.client.purgeDeletedKey(name, updatedOptions);\n });\n }\n\n /**\n * Recovers the deleted key in the specified vault. This operation can only be performed on a\n * soft-delete enabled vault.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the deleted key is recovered.\n *\n * This operation requires the keys/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const deletePoller = await client.beginDeleteKey(keyName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedKey(keyName);\n * const recoveredKey = await recoverPoller.pollUntilDone();\n * ```\n * Recovers the deleted key to the latest version.\n * @param name - The name of the deleted key.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedKey(\n name: string,\n options: BeginRecoverDeletedKeyOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>> {\n const poller = new RecoverDeletedKeyPoller({\n name,\n client: this.client,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the key).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified key be downloaded to the client. All versions of the\n * key will be downloaded. This operation requires the keys/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const backupContents = await client.backupKey(keyName);\n * ```\n * Backs up the specified key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public backupKey(name: string, options: BackupKeyOptions = {}): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(`KeyClient.backupKey`, options, async (updatedOptions) => {\n const response = await this.client.backupKey(name, updatedOptions);\n return response.value;\n });\n }\n\n /**\n * Restores a backed up key, and all its versions, to a vault. This operation requires the\n * keys/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreKeyBackup\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const backupContents = await client.backupKey(keyName);\n *\n * const key = await client.restoreKeyBackup(backupContents);\n * ```\n * Restores a backed up key to a vault.\n * @param backup - The backup blob associated with a key bundle.\n * @param options - The optional parameters.\n */\n public async restoreKeyBackup(\n backup: Uint8Array,\n options: RestoreKeyBackupOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.restoreKeyBackup`, options, async (updatedOptions) => {\n const response = await this.client.restoreKey({ keyBundleBackup: backup }, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * Gets the requested number of bytes containing random values from a managed HSM.\n * This operation requires the managedHsm/rng permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetRandomBytes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const bytes = await client.getRandomBytes(10);\n * ```\n * @param count - The number of bytes to generate between 1 and 128 inclusive.\n * @param options - The optional parameters.\n */\n public getRandomBytes(count: number, options: GetRandomBytesOptions = {}): Promise<Uint8Array> {\n return tracingClient.withSpan(\"KeyClient.getRandomBytes\", options, async (updatedOptions) => {\n const response = await this.client.getRandomBytes({ count }, updatedOptions);\n return response.value!;\n });\n }\n\n /**\n * Rotates the key based on the key policy by generating a new version of the key. This operation requires the keys/rotate permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleKeyRotation\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * // Set the key's automated rotation policy to rotate the key 30 days before expiry.\n * const policy = await client.updateKeyRotationPolicy(keyName, {\n * lifetimeActions: [\n * {\n * action: \"Rotate\",\n * timeBeforeExpiry: \"P30D\",\n * },\n * ],\n * // You may also specify the duration after which any newly rotated key will expire.\n * // In this case, any new key versions will expire after 90 days.\n * expiresIn: \"P90D\",\n * });\n *\n * // You can get the current key rotation policy of a given key by calling the getKeyRotationPolicy method.\n * const currentPolicy = await client.getKeyRotationPolicy(keyName);\n *\n * // Finally, you can rotate a key on-demand by creating a new version of the given key.\n * const rotatedKey = await client.rotateKey(keyName);\n * ```\n *\n * @param name - The name of the key to rotate.\n * @param options - The optional parameters.\n */\n public rotateKey(name: string, options: RotateKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\"KeyClient.rotateKey\", options, async (updatedOptions) => {\n const key = await this.client.rotateKey(name, updatedOptions);\n return getKeyFromKeyBundle(key);\n });\n }\n\n /**\n * Releases a key from a managed HSM.\n *\n * The release key operation is applicable to all key types. The operation requires the key to be marked exportable and the keys/release permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleReleaseKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.releaseKey(\"myKey\", \"<attestation-target>\");\n * ```\n *\n * @param name - The name of the key.\n * @param targetAttestationToken - The attestation assertion for the target of the key release.\n * @param options - The optional parameters.\n */\n public releaseKey(\n name: string,\n targetAttestationToken: string,\n options: ReleaseKeyOptions = {},\n ): Promise<ReleaseKeyResult> {\n return tracingClient.withSpan(\"KeyClient.releaseKey\", options, async (updatedOptions) => {\n const { nonce, algorithm, ...rest } = updatedOptions;\n const result = await this.client.release(\n name,\n updatedOptions.version,\n {\n targetAttestationToken,\n enc: algorithm,\n nonce,\n },\n rest,\n );\n\n return { value: result.value! };\n });\n }\n\n /**\n * Gets the rotation policy of a Key Vault Key.\n * By default, all keys have a policy that will notify 30 days before expiry.\n *\n * This operation requires the keys/get permission.\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKeyRotationPolicy\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.getKeyRotationPolicy(keyName);\n * ```\n *\n * @param keyName - The name of the key.\n * @param options - The optional parameters.\n */\n public getKeyRotationPolicy(\n keyName: string,\n options: GetKeyRotationPolicyOptions = {},\n ): Promise<KeyRotationPolicy> {\n return tracingClient.withSpan(\"KeyClient.getKeyRotationPolicy\", options, async () => {\n const policy = await this.client.getKeyRotationPolicy(keyName);\n return keyRotationTransformations.generatedToPublic(policy);\n });\n }\n\n /**\n * Updates the rotation policy of a Key Vault Key.\n * This operation requires the keys/update permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyRotationPolicy\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const myPolicy = await client.getKeyRotationPolicy(keyName);\n *\n * const setPolicy = await client.updateKeyRotationPolicy(keyName, myPolicy);\n * ```\n *\n * @param keyName - The name of the key.\n * @param policyProperties - The {@link KeyRotationPolicyProperties} for the policy.\n * @param options - The optional parameters.\n */\n public updateKeyRotationPolicy(\n keyName: string,\n policy: KeyRotationPolicyProperties,\n options: UpdateKeyRotationPolicyOptions = {},\n ): Promise<KeyRotationPolicy> {\n return tracingClient.withSpan(\n \"KeyClient.updateKeyRotationPolicy\",\n options,\n async (updatedOptions) => {\n const result = await this.client.updateKeyRotationPolicy(\n keyName,\n keyRotationTransformations.propertiesToGenerated(policy),\n updatedOptions,\n );\n return keyRotationTransformations.generatedToPublic(result);\n },\n );\n }\n\n /**\n * Iterates all versions of the given key in the vault. The full key identifier, properties, and tags are provided\n * in the response. This operation requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param name - Name of the key to fetch versions for\n * @param options - The optional parameters.\n */\n public listPropertiesOfKeyVersions(\n name: string,\n options: ListPropertiesOfKeyVersionsOptions = {},\n ): PagedAsyncIterableIterator<KeyProperties> {\n return mapPagedAsyncIterable(\n options,\n (mappedOptions) => this.client.getKeyVersions(name, mappedOptions),\n getKeyPropertiesFromKeyItem,\n );\n }\n\n /**\n * Iterates the latest version of all keys in the vault. The full key identifier and properties are provided\n * in the response. No values are returned for the keys. This operations requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all keys in the vault\n * @param options - The optional parameters.\n */\n public listPropertiesOfKeys(\n options: ListPropertiesOfKeysOptions = {},\n ): PagedAsyncIterableIterator<KeyProperties> {\n return mapPagedAsyncIterable(\n options,\n this.client.getKeys.bind(this.client),\n getKeyPropertiesFromKeyItem,\n );\n }\n\n /**\n * Iterates the deleted keys in the vault. The full key identifier and properties are provided\n * in the response. No values are returned for the keys. This operations requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all keys in the vault\n * @param options - The optional parameters.\n */\n public listDeletedKeys(\n options: ListDeletedKeysOptions = {},\n ): PagedAsyncIterableIterator<DeletedKey> {\n return mapPagedAsyncIterable(\n options,\n this.client.getDeletedKeys.bind(this.client),\n getDeletedKeyFromDeletedKeyItem,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAiDlE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA+B7D,OAAO,EACL,iCAAiC,EACjC,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mCAAmC,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAQL,kBAAkB,EAalB,0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CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5C,+BAA+B,CAChC,CAAC;IACJ,CAAC;CACF;AACD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./logger.js\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { DeletionRecoveryLevel, KeyCreateParameters } from \"./models/models.js\";\nimport { KnownDeletionRecoveryLevel } from \"./models/models.js\";\nimport type { KeyVaultClientOptionalParams } from \"./keyVaultClient.js\";\nimport { KeyVaultClient } from \"./keyVaultClient.js\";\nimport { SDK_VERSION } from \"./constants.js\";\nimport { keyVaultAuthenticationPolicy } from \"@azure/keyvault-common\";\nimport { DeleteKeyPoller } from \"./lro/delete/poller.js\";\nimport { RecoverDeletedKeyPoller } from \"./lro/recover/poller.js\";\nimport type {\n BackupKeyOptions,\n BeginDeleteKeyOptions,\n BeginRecoverDeletedKeyOptions,\n CreateEcKeyOptions,\n CreateKeyOptions,\n CreateOctKeyOptions,\n CreateRsaKeyOptions,\n CryptographyClientOptions,\n CryptographyOptions,\n DeletedKey,\n ExternalKey,\n GetCryptographyClientOptions,\n GetDeletedKeyOptions,\n GetKeyAttestationOptions,\n GetKeyOptions,\n GetKeyRotationPolicyOptions,\n GetRandomBytesOptions,\n ImportKeyOptions,\n JsonWebKey,\n KeyAttestation,\n KeyClientOptions,\n KeyExportEncryptionAlgorithm,\n KeyOperation,\n KeyPollerOptions,\n KeyProperties,\n KeyReleasePolicy,\n KeyRotationLifetimeAction,\n KeyRotationPolicy,\n KeyRotationPolicyAction,\n KeyRotationPolicyProperties,\n KeyType,\n KeyVaultKey,\n ListDeletedKeysOptions,\n ListPropertiesOfKeyVersionsOptions,\n ListPropertiesOfKeysOptions,\n PurgeDeletedKeyOptions,\n ReleaseKeyOptions,\n ReleaseKeyResult,\n RestoreKeyBackupOptions,\n RotateKeyOptions,\n SecureKeyOperationResult,\n SecureKeyWrapAlgorithm,\n SecureUnwrapKeyOptions,\n SecureWrapKeyOptions,\n UpdateKeyPropertiesOptions,\n UpdateKeyRotationPolicyOptions,\n} from \"./keysModels.js\";\nimport { KnownKeyOperations, LATEST_API_VERSION } from \"./keysModels.js\";\nimport { CryptographyClient } from \"./cryptographyClient.js\";\nimport type {\n AesCbcDecryptParameters,\n AesCbcEncryptParameters,\n AesCbcEncryptionAlgorithm,\n AesGcmDecryptParameters,\n AesGcmEncryptParameters,\n AesGcmEncryptionAlgorithm,\n DecryptOptions,\n DecryptParameters,\n DecryptResult,\n EncryptOptions,\n EncryptParameters,\n EncryptResult,\n EncryptionAlgorithm,\n KeyCurveName,\n KeyWrapAlgorithm,\n RsaDecryptParameters,\n RsaEncryptParameters,\n RsaEncryptionAlgorithm,\n SignOptions,\n SignResult,\n SignatureAlgorithm,\n UnwrapKeyOptions,\n UnwrapResult,\n VerifyDataOptions,\n VerifyOptions,\n VerifyResult,\n WrapKeyOptions,\n WrapResult,\n} from \"./cryptographyClientModels.js\";\nimport {\n KnownKeyExportEncryptionAlgorithm,\n KnownEncryptionAlgorithms,\n KnownKeyTypes,\n KnownKeyCurveNames,\n KnownSignatureAlgorithms,\n} from \"./cryptographyClientModels.js\";\nimport type { KeyVaultKeyIdentifier } from \"./identifier.js\";\nimport { parseKeyVaultKeyIdentifier } from \"./identifier.js\";\nimport {\n getDeletedKeyFromDeletedKeyItem,\n getKeyFromKeyBundle,\n getKeyPropertiesFromKeyItem,\n keyRotationTransformations,\n mapPagedAsyncIterable,\n} from \"./transformations.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport { bearerTokenAuthenticationPolicyName } from \"@azure/core-rest-pipeline\";\n\nexport {\n type CryptographyClientOptions,\n type KeyClientOptions,\n type BackupKeyOptions,\n type CreateEcKeyOptions,\n type CreateKeyOptions,\n type CreateRsaKeyOptions,\n type CreateOctKeyOptions,\n CryptographyClient,\n type CryptographyOptions,\n type RsaEncryptionAlgorithm,\n type RsaDecryptParameters,\n type AesGcmEncryptionAlgorithm,\n type AesGcmDecryptParameters,\n type AesCbcEncryptionAlgorithm,\n type AesCbcDecryptParameters,\n type DecryptParameters,\n type DecryptOptions,\n type DecryptResult,\n type DeletedKey,\n type DeletionRecoveryLevel,\n KnownDeletionRecoveryLevel,\n type ExternalKey,\n type RsaEncryptParameters,\n type AesGcmEncryptParameters,\n type AesCbcEncryptParameters,\n type EncryptParameters,\n type EncryptOptions,\n type EncryptResult,\n type GetDeletedKeyOptions,\n type GetKeyAttestationOptions,\n type GetKeyOptions,\n type GetRandomBytesOptions,\n type ImportKeyOptions,\n type JsonWebKey,\n type KeyAttestation,\n type KeyCurveName,\n KnownKeyCurveNames,\n KnownKeyExportEncryptionAlgorithm,\n type EncryptionAlgorithm,\n KnownEncryptionAlgorithms,\n type KeyOperation,\n KnownKeyOperations,\n type KeyType,\n KnownKeyTypes,\n type KeyPollerOptions,\n type BeginDeleteKeyOptions,\n type BeginRecoverDeletedKeyOptions,\n type KeyProperties,\n type SignatureAlgorithm,\n KnownSignatureAlgorithms,\n type KeyVaultKey,\n type KeyWrapAlgorithm,\n type ListPropertiesOfKeysOptions,\n type ListPropertiesOfKeyVersionsOptions,\n type ListDeletedKeysOptions,\n type PageSettings,\n type PagedAsyncIterableIterator,\n type KeyVaultKeyIdentifier,\n parseKeyVaultKeyIdentifier,\n type PollOperationState,\n type PollerLike,\n type PurgeDeletedKeyOptions,\n type RestoreKeyBackupOptions,\n type RotateKeyOptions,\n type SignOptions,\n type SignResult,\n type UnwrapKeyOptions,\n type UnwrapResult,\n type UpdateKeyPropertiesOptions,\n type VerifyOptions,\n type VerifyDataOptions,\n type VerifyResult,\n type WrapKeyOptions,\n type WrapResult,\n type ReleaseKeyOptions,\n type ReleaseKeyResult,\n type SecureKeyOperationResult,\n type SecureKeyWrapAlgorithm,\n type SecureUnwrapKeyOptions,\n type SecureWrapKeyOptions,\n type KeyReleasePolicy,\n type KeyExportEncryptionAlgorithm,\n type GetCryptographyClientOptions,\n type KeyRotationPolicyAction,\n type KeyRotationPolicyProperties,\n type KeyRotationPolicy,\n type KeyRotationLifetimeAction,\n type UpdateKeyRotationPolicyOptions,\n type GetKeyRotationPolicyOptions,\n logger,\n};\n\n/**\n * The KeyClient provides methods to manage {@link KeyVaultKey} in the\n * Azure Key Vault. The client supports creating, retrieving, updating,\n * deleting, purging, backing up, restoring and listing KeyVaultKeys. The\n * client also supports listing {@link DeletedKey} for a soft-delete enabled Azure Key\n * Vault.\n */\nexport class KeyClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * A reference to the credential that was used to construct this client.\n * Later used to instantiate a {@link CryptographyClient} with the same credential.\n */\n private readonly credential: TokenCredential;\n\n /**\n * Creates an instance of KeyClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * // Build the URL to reach your key vault\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`; // or `https://${vaultName}.managedhsm.azure.net` for managed HSM.\n *\n * // Lastly, create our keys client and connect to the service\n * const client = new KeyClient(url, credential);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.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.\n * @param credential - 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.\n * @param pipelineOptions - Pipeline options used to configure Key Vault API requests. Omit this parameter to use the default pipeline configuration.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n pipelineOptions: KeyClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n const libInfo = `azsdk-js-keyvault-keys/${SDK_VERSION}`;\n\n const userAgentOptions = pipelineOptions.userAgentOptions;\n\n pipelineOptions.userAgentOptions = {\n userAgentPrefix:\n userAgentOptions && userAgentOptions.userAgentPrefix\n ? `${userAgentOptions.userAgentPrefix} ${libInfo}`\n : libInfo,\n };\n\n const internalPipelineOptions: KeyVaultClientOptionalParams = {\n ...pipelineOptions,\n apiVersion: pipelineOptions.serviceVersion || LATEST_API_VERSION,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"x-ms-keyvault-region\",\n \"x-ms-keyvault-network-info\",\n \"x-ms-keyvault-service-version\",\n ],\n },\n };\n\n this.credential = credential;\n this.client = new KeyVaultClient(vaultUrl, credential, internalPipelineOptions);\n\n this.client.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });\n this.client.pipeline.addPolicy(keyVaultAuthenticationPolicy(credential, pipelineOptions));\n // Workaround for: https://github.com/Azure/azure-sdk-for-js/issues/31843\n this.client.pipeline.addPolicy({\n name: \"ContentTypePolicy\",\n sendRequest(request, next) {\n const contentType = request.headers.get(\"Content-Type\") ?? \"\";\n if (contentType.startsWith(\"application/json\")) {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return next(request);\n },\n });\n }\n\n /**\n * The create key operation can be used to create any key type in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createKey(keyName, \"RSA\");\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param keyType - The type of the key. One of the following: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'.\n * @param options - The optional parameters.\n */\n public createKey(\n name: string,\n keyType: KeyType,\n options: CreateKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\"KeyClient.createKey\", options, async (updatedOptions) => {\n const response = await this.client.createKey(\n name,\n {\n kty: keyType,\n curve: options?.curve,\n keyAttributes: {\n enabled: options?.enabled,\n notBefore: options?.notBefore,\n expires: options?.expiresOn,\n exportable: options?.exportable,\n },\n keyOps: options?.keyOps,\n keySize: options?.keySize,\n releasePolicy: options?.releasePolicy,\n tags: options?.tags,\n },\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The createEcKey method creates a new elliptic curve key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateEcKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createEcKey(keyName, { curve: \"P-256\" });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createEcKey(name: string, options?: CreateEcKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.ECHSM : KnownKeyTypes.EC;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The createRSAKey method creates a new RSA key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateRsaKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createRsaKey(\"MyKey\", { keySize: 2048 });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createRsaKey(name: string, options?: CreateRsaKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.RSAHSM : KnownKeyTypes.RSA;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The createOctKey method creates a new OCT key in Azure Key Vault. If the named key\n * already exists, Azure Key Vault creates a new version of the key. It requires the keys/create\n * permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateOctKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createOctKey(\"MyKey\", { hsm: true });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async createOctKey(name: string, options?: CreateOctKeyOptions): Promise<KeyVaultKey> {\n const keyType = options?.hsm ? KnownKeyTypes.OctHSM : KnownKeyTypes.Oct;\n return this.createKey(name, keyType, options);\n }\n\n /**\n * The createExternalKey method creates a new key in Azure Key Vault that is backed by a key\n * stored in an external key management system. If the named key already exists, Azure Key Vault\n * creates a new version of the key. It requires the keys/create permission.\n *\n * The key type and key size must not be specified for external keys; the service derives them\n * from the referenced external key.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateExternalKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.managedhsm.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n * const result = await client.createExternalKey(keyName, { id: \"my-external-key-id\" });\n * console.log(\"result: \", result);\n * ```\n * Creates a new key, stores it, then returns key parameters and properties to the client.\n * @param name - The name of the key.\n * @param externalKey - A reference to the key stored in the external key management system.\n * @param options - The optional parameters.\n */\n public async createExternalKey(\n name: string,\n externalKey: ExternalKey,\n options: CreateKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n \"KeyClient.createExternalKey\",\n options,\n async (updatedOptions) => {\n // Key type and key size must not be specified for external keys; the\n // service derives the key type from the referenced external key.\n const parameters = {\n keyAttributes: {\n enabled: options?.enabled,\n notBefore: options?.notBefore,\n expires: options?.expiresOn,\n exportable: options?.exportable,\n externalKey,\n },\n keyOps: options?.keyOps,\n releasePolicy: options?.releasePolicy,\n tags: options?.tags,\n } as KeyCreateParameters;\n const response = await this.client.createKey(name, parameters, updatedOptions);\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * The import key operation may be used to import any key type into an Azure Key Vault. If the\n * named key already exists, Azure Key Vault creates a new version of the key. This operation\n * requires the keys/import permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleImportKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const jsonWebKey = {\n * kty: \"RSA\",\n * kid: \"test-key-123\",\n * use: \"sig\",\n * alg: \"RS256\",\n * n: new Uint8Array([112, 34, 56, 98, 123, 244, 200, 99]),\n * e: new Uint8Array([1, 0, 1]),\n * d: new Uint8Array([45, 67, 89, 23, 144, 200, 76, 233]),\n * p: new Uint8Array([34, 89, 100, 77, 204, 56, 29, 77]),\n * q: new Uint8Array([78, 99, 201, 45, 188, 34, 67, 90]),\n * dp: new Uint8Array([23, 45, 78, 56, 200, 144, 32, 67]),\n * dq: new Uint8Array([12, 67, 89, 144, 99, 56, 23, 45]),\n * qi: new Uint8Array([78, 90, 45, 201, 34, 67, 120, 55]),\n * };\n *\n * const result = await client.importKey(\"MyKey\", jsonWebKey);\n * ```\n * Imports an externally created key, stores it, and returns key parameters and properties\n * to the client.\n * @param name - Name for the imported key.\n * @param key - The JSON web key.\n * @param options - The optional parameters.\n */\n public importKey(\n name: string,\n key: JsonWebKey,\n options: ImportKeyOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.importKey`, options, async (updatedOptions) => {\n const { enabled, notBefore, expiresOn: expires, exportable, releasePolicy, tags } = options;\n const keyAttributes = {\n enabled,\n notBefore,\n expires,\n exportable,\n };\n const parameters = {\n key,\n hsm: options?.hardwareProtected,\n keyAttributes,\n releasePolicy,\n tags,\n };\n const response = await this.client.importKey(name, parameters, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * Gets a {@link CryptographyClient} for the given key.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetCryptographyClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * // Get a cryptography client for a given key\n * const cryptographyClient = client.getCryptographyClient(\"MyKey\");\n * ```\n * @param name - The name of the key used to perform cryptographic operations.\n * @param version - Optional version of the key used to perform cryptographic operations.\n * @returns - A {@link CryptographyClient} using the same options, credentials, and http client as this {@link KeyClient}\n */\n public getCryptographyClient(\n keyName: string,\n options?: GetCryptographyClientOptions,\n ): CryptographyClient {\n const keyUrl = new URL(\n [\"keys\", keyName, options?.keyVersion].filter(Boolean).join(\"/\"),\n this.vaultUrl,\n );\n\n // The goals of this method are discoverability and performance (by sharing a client and pipeline).\n // The existing cryptography client does not accept a pipeline as an argument, nor does it expose it.\n // In order to avoid publicly exposing the pipeline we will pass in the underlying client as an undocumented\n // property to the constructor so that crypto providers downstream can use it.\n const constructorOptions: CryptographyClientOptions & { generatedClient: KeyVaultClient } = {\n generatedClient: this.client,\n };\n const cryptoClient = new CryptographyClient(\n keyUrl.toString(),\n this.credential,\n constructorOptions,\n );\n return cryptoClient;\n }\n\n /**\n * The delete operation applies to any key stored in Azure Key Vault. Individual versions\n * of a key can not be deleted, only all versions of a given key at once.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the key is deleted.\n *\n * This operation requires the keys/delete permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleDeleteKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const poller = await client.beginDeleteKey(keyName);\n * await poller.pollUntilDone();\n * ```\n * Deletes a key from a specified key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public async beginDeleteKey(\n name: string,\n options: BeginDeleteKeyOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>> {\n const poller = new DeleteKeyPoller({\n name,\n client: this.client,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n operationOptions: options,\n });\n\n // This will initialize the poller's operation (the deletion of the key).\n await poller.poll();\n\n return poller;\n }\n\n /**\n * The updateKeyProperties method changes specified properties of an existing stored key. Properties that\n * are not specified in the request are left unchanged. The value of a key itself cannot be\n * changed. This operation requires the keys/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyProperties\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.createKey(keyName, \"RSA\");\n * await client.updateKeyProperties(keyName, result.properties.version, {\n * enabled: false,\n * });\n * ```\n * Updates the properties associated with a specified key in a given key vault.\n * @param name - The name of the key.\n * @param keyVersion - The version of the key.\n * @param options - The optional parameters.\n */\n public updateKeyProperties(\n name: string,\n keyVersion: string,\n options?: UpdateKeyPropertiesOptions,\n ): Promise<KeyVaultKey>;\n /**\n * The updateKeyProperties method changes specified properties of the latest version of an existing stored key. Properties that\n * are not specified in the request are left unchanged. The value of a key itself cannot be\n * changed. This operation requires the keys/set permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyProperties\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.createKey(keyName, \"RSA\");\n * await client.updateKeyProperties(keyName, result.properties.version, {\n * enabled: false,\n * });\n * ```\n * Updates the properties associated with a specified key in a given key vault.\n * @param name - The name of the key.\n * @param keyVersion - The version of the key.\n * @param options - The optional parameters.\n */\n public updateKeyProperties(\n name: string,\n options?: UpdateKeyPropertiesOptions,\n ): Promise<KeyVaultKey>;\n public updateKeyProperties(\n ...args: [string, string, UpdateKeyPropertiesOptions?] | [string, UpdateKeyPropertiesOptions?]\n ): Promise<KeyVaultKey> {\n const [name, keyVersion, options] = this.disambiguateUpdateKeyPropertiesArgs(args);\n return tracingClient.withSpan(\n `KeyClient.updateKeyProperties`,\n options,\n async (updatedOptions) => {\n const response = await this.client.updateKey(\n name,\n keyVersion,\n {\n keyAttributes: {\n enabled: options?.enabled,\n notBefore: options?.notBefore,\n expires: options?.expiresOn,\n },\n keyOps: options?.keyOps,\n releasePolicy: options?.releasePolicy,\n tags: options?.tags,\n },\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * Standardizes an overloaded arguments collection for the updateKeyProperties method.\n *\n * @param args - The arguments collection.\n * @returns - The standardized arguments collection.\n */\n private disambiguateUpdateKeyPropertiesArgs(\n args: [string, string, UpdateKeyPropertiesOptions?] | [string, UpdateKeyPropertiesOptions?],\n ): [string, string, UpdateKeyPropertiesOptions] {\n if (typeof args[1] === \"string\") {\n // [name, keyVersion, options?] => [name, keyVersion, options || {}]\n return [args[0], args[1], args[2] || {}];\n } else {\n // [name, options?] => [name , \"\", options || {}]\n return [args[0], \"\", args[1] || {}];\n }\n }\n\n /**\n * The getKey method gets a specified key and is applicable to any key stored in Azure Key Vault.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const latestKey = await client.getKey(keyName);\n * console.log(`Latest version of the key ${keyName}: `, latestKey);\n *\n * const specificKey = await client.getKey(keyName, { version: latestKey.properties.version! });\n * console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey);\n * ```\n * Get a specified key from a given key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getKey(name: string, options: GetKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.getKey`, options, async (updatedOptions) => {\n const response = await this.client.getKey(name, options.version || \"\", updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The getKeyAttestation method gets a specified key and its attestation blob and is applicable to any key stored in Azure Key Vault Managed HSM.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKeyAttestation\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT MANAGED HSM NAME>\";\n * const url = `https://${vaultName}.managedhsm.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const latestKey = await client.getKeyAttestation(keyName);\n * console.log(`Latest version of the key ${keyName}: `, latestKey);\n *\n * const specificKey = await client.getKeyAttestation(keyName, {\n * version: latestKey.properties.version!,\n * });\n * console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey);\n * ```\n * Get a specified key from a given key vault.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getKeyAttestation(\n name: string,\n options: GetKeyAttestationOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\n `KeyClient.getKeyAttestation`,\n options,\n async (updatedOptions) => {\n const response = await this.client.getKeyAttestation(\n name,\n updatedOptions.version,\n updatedOptions,\n );\n return getKeyFromKeyBundle(response);\n },\n );\n }\n\n /**\n * The getDeletedKey method returns the specified deleted key along with its properties.\n * This operation requires the keys/get permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * await client.getDeletedKey(keyName);\n * ```\n * Gets the specified deleted key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public getDeletedKey(name: string, options: GetDeletedKeyOptions = {}): Promise<DeletedKey> {\n return tracingClient.withSpan(`KeyClient.getDeletedKey`, options, async (updatedOptions) => {\n const response = await this.client.getDeletedKey(name, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * The purge deleted key operation removes the key permanently, without the possibility of\n * recovery. This operation can only be enabled on a soft-delete enabled vault. This operation\n * requires the keys/purge permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSamplePurgeDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const deletePoller = await client.beginDeleteKey(keyName);\n * await deletePoller.pollUntilDone();\n *\n * await client.purgeDeletedKey(keyName);\n * ```\n * Permanently deletes the specified key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public purgeDeletedKey(name: string, options: PurgeDeletedKeyOptions = {}): Promise<void> {\n return tracingClient.withSpan(`KeyClient.purgeDeletedKey`, options, async (updatedOptions) => {\n await this.client.purgeDeletedKey(name, updatedOptions);\n });\n }\n\n /**\n * Recovers the deleted key in the specified vault. This operation can only be performed on a\n * soft-delete enabled vault.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the deleted key is recovered.\n *\n * This operation requires the keys/recover permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRecoverDeletedKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const deletePoller = await client.beginDeleteKey(keyName);\n * await deletePoller.pollUntilDone();\n *\n * const recoverPoller = await client.beginRecoverDeletedKey(keyName);\n * const recoveredKey = await recoverPoller.pollUntilDone();\n * ```\n * Recovers the deleted key to the latest version.\n * @param name - The name of the deleted key.\n * @param options - The optional parameters.\n */\n public async beginRecoverDeletedKey(\n name: string,\n options: BeginRecoverDeletedKeyOptions = {},\n ): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>> {\n const poller = new RecoverDeletedKeyPoller({\n name,\n client: this.client,\n intervalInMs: options.intervalInMs,\n resumeFrom: options.resumeFrom,\n operationOptions: options,\n });\n // This will initialize the poller's operation (the deletion of the key).\n await poller.poll();\n return poller;\n }\n\n /**\n * Requests that a backup of the specified key be downloaded to the client. All versions of the\n * key will be downloaded. This operation requires the keys/backup permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBackupKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const backupContents = await client.backupKey(keyName);\n * ```\n * Backs up the specified key.\n * @param name - The name of the key.\n * @param options - The optional parameters.\n */\n public backupKey(name: string, options: BackupKeyOptions = {}): Promise<Uint8Array | undefined> {\n return tracingClient.withSpan(`KeyClient.backupKey`, options, async (updatedOptions) => {\n const response = await this.client.backupKey(name, updatedOptions);\n return response.value;\n });\n }\n\n /**\n * Restores a backed up key, and all its versions, to a vault. This operation requires the\n * keys/restore permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleRestoreKeyBackup\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const backupContents = await client.backupKey(keyName);\n *\n * const key = await client.restoreKeyBackup(backupContents);\n * ```\n * Restores a backed up key to a vault.\n * @param backup - The backup blob associated with a key bundle.\n * @param options - The optional parameters.\n */\n public async restoreKeyBackup(\n backup: Uint8Array,\n options: RestoreKeyBackupOptions = {},\n ): Promise<KeyVaultKey> {\n return tracingClient.withSpan(`KeyClient.restoreKeyBackup`, options, async (updatedOptions) => {\n const response = await this.client.restoreKey({ keyBundleBackup: backup }, updatedOptions);\n return getKeyFromKeyBundle(response);\n });\n }\n\n /**\n * Gets the requested number of bytes containing random values from a managed HSM.\n * This operation requires the managedHsm/rng permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleGetRandomBytes\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const bytes = await client.getRandomBytes(10);\n * ```\n * @param count - The number of bytes to generate between 1 and 128 inclusive.\n * @param options - The optional parameters.\n */\n public getRandomBytes(count: number, options: GetRandomBytesOptions = {}): Promise<Uint8Array> {\n return tracingClient.withSpan(\"KeyClient.getRandomBytes\", options, async (updatedOptions) => {\n const response = await this.client.getRandomBytes({ count }, updatedOptions);\n return response.value!;\n });\n }\n\n /**\n * Rotates the key based on the key policy by generating a new version of the key. This operation requires the keys/rotate permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleKeyRotation\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * // Set the key's automated rotation policy to rotate the key 30 days before expiry.\n * const policy = await client.updateKeyRotationPolicy(keyName, {\n * lifetimeActions: [\n * {\n * action: \"Rotate\",\n * timeBeforeExpiry: \"P30D\",\n * },\n * ],\n * // You may also specify the duration after which any newly rotated key will expire.\n * // In this case, any new key versions will expire after 90 days.\n * expiresIn: \"P90D\",\n * });\n *\n * // You can get the current key rotation policy of a given key by calling the getKeyRotationPolicy method.\n * const currentPolicy = await client.getKeyRotationPolicy(keyName);\n *\n * // Finally, you can rotate a key on-demand by creating a new version of the given key.\n * const rotatedKey = await client.rotateKey(keyName);\n * ```\n *\n * @param name - The name of the key to rotate.\n * @param options - The optional parameters.\n */\n public rotateKey(name: string, options: RotateKeyOptions = {}): Promise<KeyVaultKey> {\n return tracingClient.withSpan(\"KeyClient.rotateKey\", options, async (updatedOptions) => {\n const key = await this.client.rotateKey(name, updatedOptions);\n return getKeyFromKeyBundle(key);\n });\n }\n\n /**\n * Releases a key from a managed HSM.\n *\n * The release key operation is applicable to all key types. The operation requires the key to be marked exportable and the keys/release permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleReleaseKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.releaseKey(\"myKey\", \"<attestation-target>\");\n * ```\n *\n * @param name - The name of the key.\n * @param targetAttestationToken - The attestation assertion for the target of the key release.\n * @param options - The optional parameters.\n */\n public releaseKey(\n name: string,\n targetAttestationToken: string,\n options: ReleaseKeyOptions = {},\n ): Promise<ReleaseKeyResult> {\n return tracingClient.withSpan(\"KeyClient.releaseKey\", options, async (updatedOptions) => {\n const { nonce, algorithm, ...rest } = updatedOptions;\n const result = await this.client.release(\n name,\n updatedOptions.version,\n {\n targetAttestationToken,\n enc: algorithm,\n nonce,\n },\n rest,\n );\n\n return { value: result.value! };\n });\n }\n\n /**\n * Wraps a 256-bit AES key generated inside a Trusted Execution Environment\n * (TEE) using a key encryption key previously stored in Azure Key Vault.\n *\n * Unlike {@link CryptographyClient.wrapKey}, the key being wrapped is\n * generated by the service inside a TEE rather than supplied by the caller,\n * which provides additional protection for the symmetric key material.\n *\n * This operation requires the `keys/wrapKey` permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleSecureWrapKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.managedhsm.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const wrapped = await client.secureWrapKey(\"myKey\", \"RSA-OAEP-256\");\n * console.log(wrapped.keyID, wrapped.algorithm, wrapped.result);\n * ```\n *\n * @param name - The name of the key encryption key.\n * @param algorithm - The algorithm to use to wrap the generated key.\n * @param options - The optional parameters.\n */\n public secureWrapKey(\n name: string,\n algorithm: SecureKeyWrapAlgorithm,\n options: SecureWrapKeyOptions = {},\n ): Promise<SecureKeyOperationResult> {\n return tracingClient.withSpan(\n \"KeyClient.secureWrapKey\",\n options,\n async (updatedOptions): Promise<SecureKeyOperationResult> => {\n const { version, ...rest } = updatedOptions;\n const result = await this.client.secureWrapKey(name, version, { algorithm }, rest);\n return {\n keyID: result.kid ?? \"\",\n algorithm: (result.algorithm as SecureKeyWrapAlgorithm | undefined) ?? algorithm,\n result: result.result ?? new Uint8Array(),\n };\n },\n );\n }\n\n /**\n * Unwraps a symmetric key that was previously wrapped via\n * {@link KeyClient.secureWrapKey}. The unwrap operation runs inside a\n * Trusted Execution Environment (TEE) attested by the Microsoft Azure\n * Attestation Service (MAA).\n *\n * This operation requires the `keys/unwrapKey` permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleSecureUnwrapKey\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.managedhsm.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const wrapped = await client.secureWrapKey(\"myKey\", \"RSA-OAEP-256\");\n * const unwrapped = await client.secureUnwrapKey(\n * \"myKey\",\n * wrapped.algorithm,\n * wrapped.result,\n * \"<attestation-target>\",\n * );\n * console.log(unwrapped.keyID, unwrapped.algorithm, unwrapped.result);\n * ```\n *\n * @param name - The name of the key encryption key.\n * @param algorithm - The algorithm originally used to wrap the value.\n * @param value - The wrapped key value to unwrap.\n * @param targetAttestationToken - The attestation assertion for the target\n * of the key release.\n * @param options - The optional parameters.\n */\n public secureUnwrapKey(\n name: string,\n algorithm: SecureKeyWrapAlgorithm,\n value: Uint8Array,\n targetAttestationToken: string,\n options: SecureUnwrapKeyOptions = {},\n ): Promise<SecureKeyOperationResult> {\n return tracingClient.withSpan(\n \"KeyClient.secureUnwrapKey\",\n options,\n async (updatedOptions): Promise<SecureKeyOperationResult> => {\n const { version, ...rest } = updatedOptions;\n const result = await this.client.secureUnwrapKey(\n name,\n version,\n { algorithm, value, targetAttestationToken },\n rest,\n );\n return {\n keyID: result.kid ?? \"\",\n algorithm: (result.algorithm as SecureKeyWrapAlgorithm | undefined) ?? algorithm,\n result: result.result ?? new Uint8Array(),\n };\n },\n );\n }\n\n /**\n * Gets the rotation policy of a Key Vault Key.\n * By default, all keys have a policy that will notify 30 days before expiry.\n *\n * This operation requires the keys/get permission.\n * Example usage:\n * ```ts snippet:ReadmeSampleGetKeyRotationPolicy\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const result = await client.getKeyRotationPolicy(keyName);\n * ```\n *\n * @param keyName - The name of the key.\n * @param options - The optional parameters.\n */\n public getKeyRotationPolicy(\n keyName: string,\n options: GetKeyRotationPolicyOptions = {},\n ): Promise<KeyRotationPolicy> {\n return tracingClient.withSpan(\"KeyClient.getKeyRotationPolicy\", options, async () => {\n const policy = await this.client.getKeyRotationPolicy(keyName);\n return keyRotationTransformations.generatedToPublic(policy);\n });\n }\n\n /**\n * Updates the rotation policy of a Key Vault Key.\n * This operation requires the keys/update permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleUpdateKeyRotationPolicy\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * const myPolicy = await client.getKeyRotationPolicy(keyName);\n *\n * const setPolicy = await client.updateKeyRotationPolicy(keyName, myPolicy);\n * ```\n *\n * @param keyName - The name of the key.\n * @param policyProperties - The {@link KeyRotationPolicyProperties} for the policy.\n * @param options - The optional parameters.\n */\n public updateKeyRotationPolicy(\n keyName: string,\n policy: KeyRotationPolicyProperties,\n options: UpdateKeyRotationPolicyOptions = {},\n ): Promise<KeyRotationPolicy> {\n return tracingClient.withSpan(\n \"KeyClient.updateKeyRotationPolicy\",\n options,\n async (updatedOptions) => {\n const result = await this.client.updateKeyRotationPolicy(\n keyName,\n keyRotationTransformations.propertiesToGenerated(policy),\n updatedOptions,\n );\n return keyRotationTransformations.generatedToPublic(result);\n },\n );\n }\n\n /**\n * Iterates all versions of the given key in the vault. The full key identifier, properties, and tags are provided\n * in the response. This operation requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * @param name - Name of the key to fetch versions for\n * @param options - The optional parameters.\n */\n public listPropertiesOfKeyVersions(\n name: string,\n options: ListPropertiesOfKeyVersionsOptions = {},\n ): PagedAsyncIterableIterator<KeyProperties> {\n return mapPagedAsyncIterable(\n options,\n (mappedOptions) => this.client.getKeyVersions(name, mappedOptions),\n getKeyPropertiesFromKeyItem,\n );\n }\n\n /**\n * Iterates the latest version of all keys in the vault. The full key identifier and properties are provided\n * in the response. No values are returned for the keys. This operations requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all keys in the vault\n * @param options - The optional parameters.\n */\n public listPropertiesOfKeys(\n options: ListPropertiesOfKeysOptions = {},\n ): PagedAsyncIterableIterator<KeyProperties> {\n return mapPagedAsyncIterable(\n options,\n this.client.getKeys.bind(this.client),\n getKeyPropertiesFromKeyItem,\n );\n }\n\n /**\n * Iterates the deleted keys in the vault. The full key identifier and properties are provided\n * in the response. No values are returned for the keys. This operations requires the keys/list permission.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleListKeys\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyClient } from \"@azure/keyvault-keys\";\n *\n * const credential = new DefaultAzureCredential();\n *\n * const vaultName = \"<YOUR KEYVAULT NAME>\";\n * const url = `https://${vaultName}.vault.azure.net`;\n *\n * const client = new KeyClient(url, credential);\n *\n * const keyName = \"MyKeyName\";\n *\n * for await (const keyProperties of client.listPropertiesOfKeys()) {\n * console.log(\"Key properties: \", keyProperties);\n * }\n *\n * for await (const deletedKey of client.listDeletedKeys()) {\n * console.log(\"Deleted: \", deletedKey);\n * }\n *\n * for await (const versionProperties of client.listPropertiesOfKeyVersions(keyName)) {\n * console.log(\"Version properties: \", versionProperties);\n * }\n * ```\n * List all keys in the vault\n * @param options - The optional parameters.\n */\n public listDeletedKeys(\n options: ListDeletedKeysOptions = {},\n ): PagedAsyncIterableIterator<DeletedKey> {\n return mapPagedAsyncIterable(\n options,\n this.client.getDeletedKeys.bind(this.client),\n getDeletedKeyFromDeletedKeyItem,\n );\n }\n}\nexport { RestError, isRestError } from \"@azure/core-rest-pipeline\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KeyVaultClientOptionalParams } from "./api/index.js";
|
|
2
|
-
import type { KeyCreateParameters, KeyBundle, KeyImportParameters, DeletedKeyBundle, KeyUpdateParameters, KeyItem, BackupKeyResult, KeyRestoreParameters, KeyOperationsParameters, KeyOperationResult, KeySignParameters, KeyVerifyParameters, KeyVerifyResult, KeyReleaseParameters, KeyReleaseResult, DeletedKeyItem, KeyRotationPolicy, GetRandomBytesRequest, RandomBytes } from "./models/models.js";
|
|
3
|
-
import type { GetKeyAttestationOptionalParams, GetRandomBytesOptionalParams, UpdateKeyRotationPolicyOptionalParams, GetKeyRotationPolicyOptionalParams, RecoverDeletedKeyOptionalParams, PurgeDeletedKeyOptionalParams, GetDeletedKeyOptionalParams, GetDeletedKeysOptionalParams, ReleaseOptionalParams, UnwrapKeyOptionalParams, WrapKeyOptionalParams, VerifyOptionalParams, SignOptionalParams, DecryptOptionalParams, EncryptOptionalParams, RestoreKeyOptionalParams, BackupKeyOptionalParams, GetKeysOptionalParams, GetKeyVersionsOptionalParams, GetKeyOptionalParams, UpdateKeyOptionalParams, DeleteKeyOptionalParams, ImportKeyOptionalParams, RotateKeyOptionalParams, CreateKeyOptionalParams } from "./api/options.js";
|
|
2
|
+
import type { KeyCreateParameters, KeyBundle, KeyImportParameters, DeletedKeyBundle, KeyUpdateParameters, KeyItem, BackupKeyResult, KeyRestoreParameters, KeyOperationsParameters, KeyOperationResult, KeySignParameters, KeyVerifyParameters, KeyVerifyResult, KeyReleaseParameters, KeyReleaseResult, SecureKeyWrapParameters, SecureKeyUnwrapParameters, DeletedKeyItem, KeyRotationPolicy, GetRandomBytesRequest, RandomBytes } from "./models/models.js";
|
|
3
|
+
import type { GetKeyAttestationOptionalParams, GetRandomBytesOptionalParams, UpdateKeyRotationPolicyOptionalParams, GetKeyRotationPolicyOptionalParams, RecoverDeletedKeyOptionalParams, PurgeDeletedKeyOptionalParams, GetDeletedKeyOptionalParams, GetDeletedKeysOptionalParams, ReleaseOptionalParams, UnwrapKeyOptionalParams, WrapKeyOptionalParams, SecureWrapKeyOptionalParams, SecureUnwrapKeyOptionalParams, VerifyOptionalParams, SignOptionalParams, DecryptOptionalParams, EncryptOptionalParams, RestoreKeyOptionalParams, BackupKeyOptionalParams, GetKeysOptionalParams, GetKeyVersionsOptionalParams, GetKeyOptionalParams, UpdateKeyOptionalParams, DeleteKeyOptionalParams, ImportKeyOptionalParams, RotateKeyOptionalParams, CreateKeyOptionalParams } from "./api/options.js";
|
|
4
4
|
import type { PagedAsyncIterableIterator } from "./static-helpers/pagingHelpers.js";
|
|
5
5
|
import type { Pipeline } from "@azure/core-rest-pipeline";
|
|
6
6
|
import type { TokenCredential } from "@azure/core-auth";
|
|
@@ -29,6 +29,10 @@ export declare class KeyVaultClient {
|
|
|
29
29
|
getDeletedKeys(options?: GetDeletedKeysOptionalParams): PagedAsyncIterableIterator<DeletedKeyItem>;
|
|
30
30
|
/** The release key operation is applicable to all key types. The target key must be marked exportable. This operation requires the keys/release permission. */
|
|
31
31
|
release(keyName: string, keyVersion: string | undefined, parameters: KeyReleaseParameters, options?: ReleaseOptionalParams): Promise<KeyReleaseResult>;
|
|
32
|
+
/** Securely wraps a 256-bit AES key generated within a trusted execution environment using the target key encryption key. This operation requires the keys/wrapKey permission. */
|
|
33
|
+
secureWrapKey(keyName: string, keyVersion: string | undefined, parameters: SecureKeyWrapParameters, options?: SecureWrapKeyOptionalParams): Promise<KeyOperationResult>;
|
|
34
|
+
/** Securely unwraps a symmetric key previously wrapped via {@link secureWrapKey}. The unwrap operation runs inside a trusted execution environment after attestation. This operation requires the keys/unwrapKey permission. */
|
|
35
|
+
secureUnwrapKey(keyName: string, keyVersion: string | undefined, parameters: SecureKeyUnwrapParameters, options?: SecureUnwrapKeyOptionalParams): Promise<KeyOperationResult>;
|
|
32
36
|
/** The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. */
|
|
33
37
|
unwrapKey(keyName: string, keyVersion: string, parameters: KeyOperationsParameters, options?: UnwrapKeyOptionalParams): Promise<KeyOperationResult>;
|
|
34
38
|
/** The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyVaultClient.d.ts","sourceRoot":"","sources":["../../src/keyVaultClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAEpF,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,+BAA+B,EAC/B,4BAA4B,EAC5B,qCAAqC,EACrC,kCAAkC,EAClC,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"keyVaultClient.d.ts","sourceRoot":"","sources":["../../src/keyVaultClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAEpF,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,+BAA+B,EAC/B,4BAA4B,EAC5B,qCAAqC,EACrC,kCAAkC,EAClC,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AA8B1B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAE7E,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAkB;IACjC,wDAAwD;IACxD,S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gD,GACxD,OAAO,CAAC,SAAS,CAAC;CAGtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { createKeyVault } from "./api/index.js";
|
|
4
|
-
import { getKeyAttestation, getRandomBytes, updateKeyRotationPolicy, getKeyRotationPolicy, recoverDeletedKey, purgeDeletedKey, getDeletedKey, getDeletedKeys, release, unwrapKey, wrapKey, verify, sign, decrypt, encrypt, restoreKey, backupKey, getKeys, getKeyVersions, getKey, updateKey, deleteKey, importKey, rotateKey, createKey, } from "./api/operations.js";
|
|
4
|
+
import { getKeyAttestation, getRandomBytes, updateKeyRotationPolicy, getKeyRotationPolicy, recoverDeletedKey, purgeDeletedKey, getDeletedKey, getDeletedKeys, release, unwrapKey, wrapKey, secureWrapKey, secureUnwrapKey, verify, sign, decrypt, encrypt, restoreKey, backupKey, getKeys, getKeyVersions, getKey, updateKey, deleteKey, importKey, rotateKey, createKey, } from "./api/operations.js";
|
|
5
5
|
export class KeyVaultClient {
|
|
6
6
|
_client;
|
|
7
7
|
/** The pipeline used by this client to make requests */
|
|
@@ -54,6 +54,14 @@ export class KeyVaultClient {
|
|
|
54
54
|
release(keyName, keyVersion, parameters, options = { requestOptions: {} }) {
|
|
55
55
|
return release(this._client, keyName, keyVersion, parameters, options);
|
|
56
56
|
}
|
|
57
|
+
/** Securely wraps a 256-bit AES key generated within a trusted execution environment using the target key encryption key. This operation requires the keys/wrapKey permission. */
|
|
58
|
+
secureWrapKey(keyName, keyVersion, parameters, options = { requestOptions: {} }) {
|
|
59
|
+
return secureWrapKey(this._client, keyName, keyVersion, parameters, options);
|
|
60
|
+
}
|
|
61
|
+
/** Securely unwraps a symmetric key previously wrapped via {@link secureWrapKey}. The unwrap operation runs inside a trusted execution environment after attestation. This operation requires the keys/unwrapKey permission. */
|
|
62
|
+
secureUnwrapKey(keyName, keyVersion, parameters, options = { requestOptions: {} }) {
|
|
63
|
+
return secureUnwrapKey(this._client, keyName, keyVersion, parameters, options);
|
|
64
|
+
}
|
|
57
65
|
/** The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. */
|
|
58
66
|
unwrapKey(keyName, keyVersion, parameters, options = { requestOptions: {} }) {
|
|
59
67
|
return unwrapKey(this._client, keyName, keyVersion, parameters, options);
|