diff --git a/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts index c0697e9572f7..2fe5f543826d 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts @@ -105,7 +105,7 @@ export interface KeyProperties { exportable?: boolean; /** * The type of key pair to be used for the certificate. Possible values include: 'EC', 'EC-HSM', - * 'RSA', 'RSA-HSM', 'oct' + * 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' */ keyType?: JsonWebKeyType; /** @@ -956,11 +956,11 @@ export type DeletionRecoveryLevel = 'Purgeable' | 'Recoverable+Purgeable' | 'Rec /** * Defines values for JsonWebKeyType. - * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' * @readonly * @enum {string} */ -export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM' | 'oct'; +export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM' | 'oct' | 'oct-HSM'; /** * Defines values for JsonWebKeyCurveName. diff --git a/sdk/keyvault/keyvault-certificates/swagger/README.md b/sdk/keyvault/keyvault-certificates/swagger/README.md index 04246bdfffff..f0facb162377 100644 --- a/sdk/keyvault/keyvault-certificates/swagger/README.md +++ b/sdk/keyvault/keyvault-certificates/swagger/README.md @@ -11,7 +11,7 @@ azure-arm: false generate-metadata: false add-credentials: false license-header: MICROSOFT_MIT_NO_VERSION -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.1/certificates.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f9caf92527ccff06c5b66380e6f2b4f50f5e82b3/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/certificates.json output-folder: ../ source-code-folder-path: ./src/generated ``` diff --git a/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md b/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md index 4ccb9f431491..5ab40ebece62 100644 --- a/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md +++ b/sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md @@ -209,7 +209,7 @@ export interface KeyProperties { } // @public -export type KeyType = "EC" | "EC-HSM" | "RSA" | "RSA-HSM" | "oct"; +export type KeyType = "EC" | "EC-HSM" | "RSA" | "RSA-HSM" | "oct" | "oct-HSM"; // @public export interface KeyVaultKey { diff --git a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts index 85cc614abb5a..a4ed581c8888 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/keyVaultClient.ts @@ -33,7 +33,7 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name for the new key. The system will generate the version name for the new * key. * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' * @param [options] The optional parameters * @returns Promise */ @@ -43,7 +43,7 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name for the new key. The system will generate the version name for the new * key. * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' * @param callback The callback */ createKey(vaultBaseUrl: string, keyName: string, kty: Models.JsonWebKeyType, callback: coreHttp.ServiceCallback): void; @@ -52,7 +52,7 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name for the new key. The system will generate the version name for the new * key. * @param kty The type of key to create. For valid values, see JsonWebKeyType. Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' * @param options The optional parameters * @param callback The callback */ @@ -392,18 +392,20 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param [options] The optional parameters * @returns Promise */ - encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase): Promise; + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientEncryptOptionalParams): Promise; /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param callback The callback */ @@ -413,13 +415,14 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param options The optional parameters * @param callback The callback */ - encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: Models.KeyVaultClientEncryptOptionalParams, callback: coreHttp.ServiceCallback): void; + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientEncryptOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.sendOperationRequest( { vaultBaseUrl, @@ -445,18 +448,20 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param [options] The optional parameters * @returns Promise */ - decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase): Promise; + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientDecryptOptionalParams): Promise; /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param callback The callback */ @@ -466,13 +471,14 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param options The optional parameters * @param callback The callback */ - decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: Models.KeyVaultClientDecryptOptionalParams, callback: coreHttp.ServiceCallback): void; + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientDecryptOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.sendOperationRequest( { vaultBaseUrl, @@ -610,18 +616,20 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param [options] The optional parameters * @returns Promise */ - wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase): Promise; + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientWrapKeyOptionalParams): Promise; /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param callback The callback */ @@ -631,13 +639,14 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param options The optional parameters * @param callback The callback */ - wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: Models.KeyVaultClientWrapKeyOptionalParams, callback: coreHttp.ServiceCallback): void; + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientWrapKeyOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.sendOperationRequest( { vaultBaseUrl, @@ -662,18 +671,20 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param [options] The optional parameters * @returns Promise */ - unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase): Promise; + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientUnwrapKeyOptionalParams): Promise; /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param callback The callback */ @@ -683,13 +694,14 @@ class KeyVaultClient extends KeyVaultClientContext { * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', - * 'RSA1_5' + * 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' * @param value * @param options The optional parameters * @param callback The callback */ - unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options: Models.KeyVaultClientUnwrapKeyOptionalParams, callback: coreHttp.ServiceCallback): void; + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: Models.JsonWebKeyEncryptionAlgorithm, value: Uint8Array, options?: Models.KeyVaultClientUnwrapKeyOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.sendOperationRequest( { vaultBaseUrl, @@ -703,6 +715,48 @@ class KeyVaultClient extends KeyVaultClientContext { callback) as Promise; } + /** + * The export key operation is applicable to all key types. The target key must be marked + * exportable. This operation requires the keys/export permission. + * @summary Exports a key. + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param environment The target environment assertion. + * @param [options] The optional parameters + * @returns Promise + */ + exportKey(vaultBaseUrl: string, keyName: string, keyVersion: string, environment: string, options?: coreHttp.RequestOptionsBase): Promise; + /** + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param environment The target environment assertion. + * @param callback The callback + */ + exportKey(vaultBaseUrl: string, keyName: string, keyVersion: string, environment: string, callback: coreHttp.ServiceCallback): void; + /** + * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. + * @param keyName The name of the key to get. + * @param keyVersion Adding the version parameter retrieves a specific version of a key. + * @param environment The target environment assertion. + * @param options The optional parameters + * @param callback The callback + */ + exportKey(vaultBaseUrl: string, keyName: string, keyVersion: string, environment: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; + exportKey(vaultBaseUrl: string, keyName: string, keyVersion: string, environment: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + return this.sendOperationRequest( + { + vaultBaseUrl, + keyName, + keyVersion, + environment, + options + }, + exportKeyOperationSpec, + callback) as Promise; + } + /** * Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public * part of a deleted key. This operation includes deletion-specific information. The Get Deleted @@ -862,6 +916,10 @@ const createKeyOperationSpec: coreHttp.OperationSpec = { "options", "keySize" ], + publicExponent: [ + "options", + "publicExponent" + ], keyOps: [ "options", "keyOps" @@ -877,6 +935,10 @@ const createKeyOperationSpec: coreHttp.OperationSpec = { curve: [ "options", "curve" + ], + releasePolicy: [ + "options", + "releasePolicy" ] }, mapper: { @@ -919,6 +981,10 @@ const importKeyOperationSpec: coreHttp.OperationSpec = { tags: [ "options", "tags" + ], + releasePolicy: [ + "options", + "releasePolicy" ] }, mapper: { @@ -982,6 +1048,10 @@ const updateKeyOperationSpec: coreHttp.OperationSpec = { tags: [ "options", "tags" + ], + releasePolicy: [ + "options", + "releasePolicy" ] }, mapper: { @@ -1129,7 +1199,19 @@ const encryptOperationSpec: coreHttp.OperationSpec = { requestBody: { parameterPath: { algorithm: "algorithm", - value: "value" + value: "value", + iv: [ + "options", + "iv" + ], + aad: [ + "options", + "aad" + ], + tag: [ + "options", + "tag" + ] }, mapper: { ...Mappers.KeyOperationsParameters, @@ -1161,7 +1243,19 @@ const decryptOperationSpec: coreHttp.OperationSpec = { requestBody: { parameterPath: { algorithm: "algorithm", - value: "value" + value: "value", + iv: [ + "options", + "iv" + ], + aad: [ + "options", + "aad" + ], + tag: [ + "options", + "tag" + ] }, mapper: { ...Mappers.KeyOperationsParameters, @@ -1258,7 +1352,19 @@ const wrapKeyOperationSpec: coreHttp.OperationSpec = { requestBody: { parameterPath: { algorithm: "algorithm", - value: "value" + value: "value", + iv: [ + "options", + "iv" + ], + aad: [ + "options", + "aad" + ], + tag: [ + "options", + "tag" + ] }, mapper: { ...Mappers.KeyOperationsParameters, @@ -1290,7 +1396,19 @@ const unwrapKeyOperationSpec: coreHttp.OperationSpec = { requestBody: { parameterPath: { algorithm: "algorithm", - value: "value" + value: "value", + iv: [ + "options", + "iv" + ], + aad: [ + "options", + "aad" + ], + tag: [ + "options", + "tag" + ] }, mapper: { ...Mappers.KeyOperationsParameters, @@ -1308,6 +1426,37 @@ const unwrapKeyOperationSpec: coreHttp.OperationSpec = { serializer }; +const exportKeyOperationSpec: coreHttp.OperationSpec = { + httpMethod: "POST", + path: "keys/{key-name}/{key-version}/export", + urlParameters: [ + Parameters.vaultBaseUrl, + Parameters.keyName1, + Parameters.keyVersion + ], + queryParameters: [ + Parameters.apiVersion + ], + requestBody: { + parameterPath: { + environment: "environment" + }, + mapper: { + ...Mappers.KeyExportParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.KeyBundle + }, + default: { + bodyMapper: Mappers.KeyVaultError + } + }, + serializer +}; + const getDeletedKeysOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", path: "deletedkeys", diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts index 73b49f972c6c..9133dd6dae23 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/index.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/index.ts @@ -9,6 +9,43 @@ import * as coreHttp from "@azure/core-http"; +/** + * An interface representing KeyReleaseCondition. + */ +export interface KeyReleaseCondition { + /** + * claim type name + */ + claimType?: string; + /** + * condition to test. Possible values include: 'equals' + */ + claimCondition?: KeyReleaseConditionCondition; + value?: string; +} + +/** + * An interface representing KeyReleaseAuthority. + */ +export interface KeyReleaseAuthority { + /** + * Base URL of the attestation service. + */ + authorityURL?: string; + allOf?: KeyReleaseCondition[]; +} + +/** + * An interface representing KeyReleasePolicy. + */ +export interface KeyReleasePolicy { + /** + * key release policy version. Possible values include: '0.2' + */ + version?: KeyReleasePolicyVersion; + anyOf?: KeyReleaseAuthority[]; +} + /** * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 */ @@ -20,7 +57,7 @@ export interface JsonWebKey { /** * JsonWebKey Key Type (kty), as defined in * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' */ kty?: JsonWebKeyType; keyOps?: string[]; @@ -61,7 +98,7 @@ export interface JsonWebKey { */ k?: Uint8Array; /** - * HSM Token, used with 'Bring Your Own Key'. + * Protected Key, used with 'Bring Your Own Key'. */ t?: Uint8Array; /** @@ -127,6 +164,10 @@ export interface KeyAttributes extends Attributes { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly recoveryLevel?: DeletionRecoveryLevel; + /** + * Indicates if the private key can be exported. + */ + exportable?: boolean; } /** @@ -151,6 +192,10 @@ export interface KeyBundle { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly managed?: boolean; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -227,7 +272,7 @@ export interface KeyProperties { exportable?: boolean; /** * The type of key pair to be used for the certificate. Possible values include: 'EC', 'EC-HSM', - * 'RSA', 'RSA-HSM', 'oct' + * 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' */ keyType?: JsonWebKeyType; /** @@ -251,13 +296,17 @@ export interface KeyProperties { export interface KeyCreateParameters { /** * The type of key to create. For valid values, see JsonWebKeyType. Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' */ kty: JsonWebKeyType; /** * The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ keySize?: number; + /** + * The public exponent for a RSA key. + */ + publicExponent?: number; keyOps?: JsonWebKeyOperation[]; keyAttributes?: KeyAttributes; /** @@ -269,6 +318,10 @@ export interface KeyCreateParameters { * 'P-256', 'P-384', 'P-521', 'P-256K' */ curve?: JsonWebKeyCurveName; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -291,6 +344,20 @@ export interface KeyImportParameters { * Application specific metadata in the form of key-value pairs. */ tags?: { [propertyName: string]: string }; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; +} + +/** + * The export key parameters. + */ +export interface KeyExportParameters { + /** + * The target environment assertion. + */ + environment: string; } /** @@ -298,10 +365,25 @@ export interface KeyImportParameters { */ export interface KeyOperationsParameters { /** - * algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', + * 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', + * 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' */ algorithm: JsonWebKeyEncryptionAlgorithm; value: Uint8Array; + /** + * Initialization vector for symmetric algorithms. + */ + iv?: Uint8Array; + /** + * Additional data to authenticate but not encrypt/decrypt when using authenticated crypto + * algorithms. + */ + aad?: Uint8Array; + /** + * The tag to authenticate when performing decryption with an authenticated algorithm. + */ + tag?: Uint8Array; } /** @@ -351,6 +433,10 @@ export interface KeyUpdateParameters { * Application specific metadata in the form of key-value pairs. */ tags?: { [propertyName: string]: string }; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -472,6 +558,10 @@ export interface KeyVaultClientCreateKeyOptionalParams extends coreHttp.RequestO * The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ keySize?: number; + /** + * The public exponent for a RSA key. + */ + publicExponent?: number; keyOps?: JsonWebKeyOperation[]; keyAttributes?: KeyAttributes; /** @@ -483,6 +573,10 @@ export interface KeyVaultClientCreateKeyOptionalParams extends coreHttp.RequestO * 'P-256', 'P-384', 'P-521', 'P-256K' */ curve?: JsonWebKeyCurveName; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -501,6 +595,10 @@ export interface KeyVaultClientImportKeyOptionalParams extends coreHttp.RequestO * Application specific metadata in the form of key-value pairs. */ tags?: { [propertyName: string]: string }; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -517,6 +615,10 @@ export interface KeyVaultClientUpdateKeyOptionalParams extends coreHttp.RequestO * Application specific metadata in the form of key-value pairs. */ tags?: { [propertyName: string]: string }; + /** + * The policy rules under which the key can be exported. + */ + releasePolicy?: KeyReleasePolicy; } /** @@ -541,6 +643,82 @@ export interface KeyVaultClientGetKeysOptionalParams extends coreHttp.RequestOpt maxresults?: number; } +/** + * Optional Parameters. + */ +export interface KeyVaultClientEncryptOptionalParams extends coreHttp.RequestOptionsBase { + /** + * Initialization vector for symmetric algorithms. + */ + iv?: Uint8Array; + /** + * Additional data to authenticate but not encrypt/decrypt when using authenticated crypto + * algorithms. + */ + aad?: Uint8Array; + /** + * The tag to authenticate when performing decryption with an authenticated algorithm. + */ + tag?: Uint8Array; +} + +/** + * Optional Parameters. + */ +export interface KeyVaultClientDecryptOptionalParams extends coreHttp.RequestOptionsBase { + /** + * Initialization vector for symmetric algorithms. + */ + iv?: Uint8Array; + /** + * Additional data to authenticate but not encrypt/decrypt when using authenticated crypto + * algorithms. + */ + aad?: Uint8Array; + /** + * The tag to authenticate when performing decryption with an authenticated algorithm. + */ + tag?: Uint8Array; +} + +/** + * Optional Parameters. + */ +export interface KeyVaultClientWrapKeyOptionalParams extends coreHttp.RequestOptionsBase { + /** + * Initialization vector for symmetric algorithms. + */ + iv?: Uint8Array; + /** + * Additional data to authenticate but not encrypt/decrypt when using authenticated crypto + * algorithms. + */ + aad?: Uint8Array; + /** + * The tag to authenticate when performing decryption with an authenticated algorithm. + */ + tag?: Uint8Array; +} + +/** + * Optional Parameters. + */ +export interface KeyVaultClientUnwrapKeyOptionalParams extends coreHttp.RequestOptionsBase { + /** + * Initialization vector for symmetric algorithms. + */ + iv?: Uint8Array; + /** + * Additional data to authenticate but not encrypt/decrypt when using authenticated crypto + * algorithms. + */ + aad?: Uint8Array; + /** + * The tag to authenticate when performing decryption with an authenticated algorithm. + */ + tag?: Uint8Array; +} + /** * Optional Parameters. */ @@ -552,13 +730,29 @@ export interface KeyVaultClientGetDeletedKeysOptionalParams extends coreHttp.Req maxresults?: number; } +/** + * Defines values for KeyReleaseConditionCondition. + * Possible values include: 'equals' + * @readonly + * @enum {string} + */ +export type KeyReleaseConditionCondition = 'equals'; + +/** + * Defines values for KeyReleasePolicyVersion. + * Possible values include: '0.2' + * @readonly + * @enum {string} + */ +export type KeyReleasePolicyVersion = '0.2'; + /** * Defines values for JsonWebKeyType. - * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' * @readonly * @enum {string} */ -export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM' | 'oct'; +export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM' | 'oct' | 'oct-HSM'; /** * Defines values for JsonWebKeyCurveName. @@ -581,19 +775,21 @@ export type DeletionRecoveryLevel = 'Purgeable' | 'Recoverable+Purgeable' | 'Rec /** * Defines values for JsonWebKeyOperation. * Possible values include: 'encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey', - * 'import' + * 'import', 'export' * @readonly * @enum {string} */ -export type JsonWebKeyOperation = 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'wrapKey' | 'unwrapKey' | 'import'; +export type JsonWebKeyOperation = 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'wrapKey' | 'unwrapKey' | 'import' | 'export'; /** * Defines values for JsonWebKeyEncryptionAlgorithm. - * Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', + * 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', + * 'A256CBCPAD' * @readonly * @enum {string} */ -export type JsonWebKeyEncryptionAlgorithm = 'RSA-OAEP' | 'RSA-OAEP-256' | 'RSA1_5'; +export type JsonWebKeyEncryptionAlgorithm = 'RSA-OAEP' | 'RSA-OAEP-256' | 'RSA1_5' | 'A128GCM' | 'A192GCM' | 'A256GCM' | 'A128KW' | 'A192KW' | 'A256KW' | 'A128CBC' | 'A192CBC' | 'A256CBC' | 'A128CBCPAD' | 'A192CBCPAD' | 'A256CBCPAD'; /** * Defines values for JsonWebKeySignatureAlgorithm. @@ -904,6 +1100,26 @@ export type UnwrapKeyResponse = KeyOperationResult & { }; }; +/** + * Contains response data for the exportKey operation. + */ +export type ExportKeyResponse = KeyBundle & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: KeyBundle; + }; +}; + /** * Contains response data for the getDeletedKeys operation. */ diff --git a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts index 944587ed685b..78e7aa15d7f5 100644 --- a/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts +++ b/sdk/keyvault/keyvault-keys/src/generated/models/mappers.ts @@ -9,6 +9,99 @@ import * as coreHttp from "@azure/core-http"; +export const KeyReleaseCondition: coreHttp.CompositeMapper = { + serializedName: "KeyReleaseCondition", + type: { + name: "Composite", + className: "KeyReleaseCondition", + modelProperties: { + claimType: { + serializedName: "claim", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + claimCondition: { + serializedName: "condition", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const KeyReleaseAuthority: coreHttp.CompositeMapper = { + serializedName: "KeyReleaseAuthority", + type: { + name: "Composite", + className: "KeyReleaseAuthority", + modelProperties: { + authorityURL: { + serializedName: "authority", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + allOf: { + serializedName: "allOf", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyReleaseCondition" + } + } + } + } + } + } +}; + +export const KeyReleasePolicy: coreHttp.CompositeMapper = { + serializedName: "KeyReleasePolicy", + type: { + name: "Composite", + className: "KeyReleasePolicy", + modelProperties: { + version: { + serializedName: "version", + type: { + name: "String" + } + }, + anyOf: { + serializedName: "anyOf", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyReleaseAuthority" + } + } + } + } + } + } +}; + export const JsonWebKey: coreHttp.CompositeMapper = { serializedName: "JsonWebKey", type: { @@ -183,6 +276,12 @@ export const KeyAttributes: coreHttp.CompositeMapper = { type: { name: "String" } + }, + exportable: { + serializedName: "exportable", + type: { + name: "Boolean" + } } } } @@ -225,6 +324,13 @@ export const KeyBundle: coreHttp.CompositeMapper = { type: { name: "Boolean" } + }, + releasePolicy: { + serializedName: "release_policy", + type: { + name: "Composite", + className: "KeyReleasePolicy" + } } } } @@ -395,6 +501,12 @@ export const KeyCreateParameters: coreHttp.CompositeMapper = { name: "Number" } }, + publicExponent: { + serializedName: "public_exponent", + type: { + name: "Number" + } + }, keyOps: { serializedName: "key_ops", type: { @@ -429,6 +541,13 @@ export const KeyCreateParameters: coreHttp.CompositeMapper = { type: { name: "String" } + }, + releasePolicy: { + serializedName: "release_policy", + type: { + name: "Composite", + className: "KeyReleasePolicy" + } } } } @@ -471,6 +590,33 @@ export const KeyImportParameters: coreHttp.CompositeMapper = { } } } + }, + releasePolicy: { + serializedName: "release_policy", + type: { + name: "Composite", + className: "KeyReleasePolicy" + } + } + } + } +}; + +export const KeyExportParameters: coreHttp.CompositeMapper = { + serializedName: "KeyExportParameters", + type: { + name: "Composite", + className: "KeyExportParameters", + modelProperties: { + environment: { + required: true, + serializedName: "env", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } } } } @@ -498,6 +644,24 @@ export const KeyOperationsParameters: coreHttp.CompositeMapper = { type: { name: "Base64Url" } + }, + iv: { + serializedName: "iv", + type: { + name: "Base64Url" + } + }, + aad: { + serializedName: "aad", + type: { + name: "Base64Url" + } + }, + tag: { + serializedName: "tag", + type: { + name: "Base64Url" + } } } } @@ -598,6 +762,13 @@ export const KeyUpdateParameters: coreHttp.CompositeMapper = { } } } + }, + releasePolicy: { + serializedName: "release_policy", + type: { + name: "Composite", + className: "KeyReleasePolicy" + } } } } diff --git a/sdk/keyvault/keyvault-keys/src/keysModels.ts b/sdk/keyvault/keyvault-keys/src/keysModels.ts index 98dd04e5616b..546e5815c674 100644 --- a/sdk/keyvault/keyvault-keys/src/keysModels.ts +++ b/sdk/keyvault/keyvault-keys/src/keysModels.ts @@ -22,11 +22,11 @@ export type KeyOperation = /** * Defines values for KeyType. - * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', "oct-HSM" * @readonly * @enum {string} */ -export type KeyType = "EC" | "EC-HSM" | "RSA" | "RSA-HSM" | "oct"; +export type KeyType = "EC" | "EC-HSM" | "RSA" | "RSA-HSM" | "oct" | "oct-HSM"; /** * @internal @@ -87,7 +87,7 @@ export interface JsonWebKey { /** * JsonWebKey Key Type (kty), as defined in * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', "oct-HSM" */ kty?: KeyType; /** @@ -169,7 +169,7 @@ export interface KeyVaultKey { /** * JsonWebKey Key Type (kty), as defined in * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', "oct-HSM" */ keyType?: KeyType; /** @@ -268,7 +268,7 @@ export interface DeletedKey { /** * JsonWebKey Key Type (kty), as defined in * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', "oct-HSM" */ keyType?: KeyType; /** diff --git a/sdk/keyvault/keyvault-keys/swagger/README.md b/sdk/keyvault/keyvault-keys/swagger/README.md index 89bd7dc04c04..80e8a578f3ec 100644 --- a/sdk/keyvault/keyvault-keys/swagger/README.md +++ b/sdk/keyvault/keyvault-keys/swagger/README.md @@ -10,8 +10,8 @@ use-extension: azure-arm: false generate-metadata: false add-credentials: false -license-header: MICROSOFT_MIT_NO_VERSION -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.1/keys.json +license-header: MICROSOFT_MIT_NO_VERSION +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f9caf92527ccff06c5b66380e6f2b4f50f5e82b3/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/keys.json output-folder: ../ source-code-folder-path: ./src/generated ``` diff --git a/sdk/keyvault/keyvault-secrets/swagger/README.md b/sdk/keyvault/keyvault-secrets/swagger/README.md index 7332223dd35a..a7d9dc4122b8 100644 --- a/sdk/keyvault/keyvault-secrets/swagger/README.md +++ b/sdk/keyvault/keyvault-secrets/swagger/README.md @@ -11,7 +11,7 @@ azure-arm: false generate-metadata: false add-credentials: false license-header: MICROSOFT_MIT_NO_VERSION -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.1/secrets.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f9caf92527ccff06c5b66380e6f2b4f50f5e82b3/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/secrets.json output-folder: ../ source-code-folder-path: ./src/generated ```