From a5730dd640edef54e15f4114870c2f3483cdef65 Mon Sep 17 00:00:00 2001 From: Victor Colin Amador Date: Mon, 21 Aug 2023 18:27:36 -0700 Subject: [PATCH] Reset changes to the patch version. --- .../azure-security-keyvault-keys/CHANGELOG.md | 13 +- .../azure-security-keyvault-keys/assets.json | 6 - .../azure-security-keyvault-keys/pom.xml | 12 +- .../keyvault/keys/KeyAsyncClient.java | 6 +- .../security/keyvault/keys/KeyClient.java | 22 +- .../keyvault/keys/KeyClientBuilder.java | 9 +- .../AesKeyCryptographyClient.java | 378 +---- .../cryptography/CryptographyAsyncClient.java | 284 ++-- .../keys/cryptography/CryptographyClient.java | 416 ++--- .../CryptographyClientBuilder.java | 30 +- .../cryptography/CryptographyClientImpl.java | 635 -------- .../CryptographyServiceClient.java | 332 ++++ .../cryptography/EcKeyCryptographyClient.java | 265 +-- .../KeyEncryptionKeyAsyncClient.java | 6 +- .../cryptography/KeyEncryptionKeyClient.java | 34 +- .../KeyEncryptionKeyClientBuilder.java | 43 +- .../LocalKeyCryptographyClient.java | 53 +- .../RsaKeyCryptographyClient.java | 417 ++--- .../implementation/CryptographyService.java | 240 +-- .../keys/implementation/KeyClientImpl.java | 320 +--- .../KeyVaultErrorCodeStrings.java | 45 +- .../main/resources/kvErrorStrings.properties | 2 + .../keys/KeyClientJavaDocCodeSnippets.java | 8 +- .../keyvault/keys/KeyAsyncClientTest.java | 19 +- .../security/keyvault/keys/KeyClientTest.java | 19 +- .../security/keyvault/keys/TestUtils.java | 14 - .../CryptographyClientBuilderTest.java | 2 +- .../cryptography/CryptographyClientTest.java | 65 +- .../KeyEncryptionKeyClientTest.java | 15 +- ...ientTest.encryptDecryptAes128CbcLocal.json | 4 + ...tTest.encryptDecryptAes128CbcPadLocal.json | 4 + ...ientTest.encryptDecryptAes192CbcLocal.json | 4 + ...tTest.encryptDecryptAes192CbcPadLocal.json | 4 + ...ientTest.encryptDecryptAes256CbcLocal.json | 4 + ...tTest.encryptDecryptAes256CbcPadLocal.json | 4 + ...aphyClientTest.encryptDecryptRsaLocal.json | 4 + ...graphyClientTest.encryptDecryptRsa[1].json | 509 ++++++ ...yptographyClientTest.signVerifyRsa[1].json | 579 +++++++ ...tographyClientTest.wrapUnwrapRsaLocal.json | 4 + ...yptographyClientTest.wrapUnwrapRsa[1].json | 509 ++++++ ...smTest.createOctKeyWithDefaultSize[1].json | 98 ++ ...smTest.createOctKeyWithInvalidSize[1].json | 75 + ...dHsmTest.createOctKeyWithValidSize[1].json | 99 ++ ...est.createRsaKeyWithPublicExponent[1].json | 100 ++ ...cClientManagedHsmTest.createRsaKey[1].json | 99 ++ ...lientManagedHsmTest.getRandomBytes[1].json | 61 + ...yncClientManagedHsmTest.releaseKey[1].json | 4 + ...yAsyncClientTest.backupKeyNotFound[1].json | 73 + .../KeyAsyncClientTest.backupKey[1].json | 131 ++ ...AsyncClientTest.createKeyEmptyName[1].json | 76 + ...yAsyncClientTest.createKeyNullType[1].json | 76 + .../KeyAsyncClientTest.createKeyNull[1].json | 4 + ...tTest.createKeyWithMultipleTenants[1].json | 177 ++ .../KeyAsyncClientTest.createKey[1].json | 108 ++ .../KeyAsyncClientTest.createRsaKey[1].json | 108 ++ ...yAsyncClientTest.deleteKeyNotFound[1].json | 73 + .../KeyAsyncClientTest.deleteKey[1].json | 246 +++ ...graphyAsyncClientAndEncryptDecrypt[1].json | 200 +++ ...aphyAsyncClientWithEmptyKeyVersion[1].json | 4 + ...ptographyAsyncClientWithKeyVersion[1].json | 4 + ...raphyAsyncClientWithNullKeyVersion[1].json | 4 + ...entTest.getCryptographyAsyncClient[1].json | 4 + ...ncClientTest.getDeletedKeyNotFound[1].json | 73 + .../KeyAsyncClientTest.getDeletedKey[1].json | 336 ++++ .../KeyAsyncClientTest.getKeyNotFound[1].json | 73 + ...tKeyRotationPolicyOfNonExistentKey[1].json | 71 + ...etKeyRotationPolicyWithNoPolicySet[1].json | 136 ++ ...ncClientTest.getKeySpecificVersion[1].json | 265 +++ .../KeyAsyncClientTest.getKey[1].json | 153 ++ ...KeyAsyncClientTest.listDeletedKeys[1].json | 996 ++++++++++++ ...KeyAsyncClientTest.listKeyVersions[1].json | 358 +++++ .../KeyAsyncClientTest.listKeys[1].json | 1368 ++++++++++++++++ ...ientTest.recoverDeletedKeyNotFound[1].json | 73 + ...yAsyncClientTest.recoverDeletedKey[1].json | 386 +++++ .../KeyAsyncClientTest.releaseKey[1].json | 4 + ...Test.restoreKeyFromMalformedBackup[1].json | 75 + .../KeyAsyncClientTest.restoreKey[1].json | 393 +++++ .../KeyAsyncClientTest.rotateKey[1].json | 147 ++ ...yAsyncClientTest.updateDisabledKey[1].json | 155 ++ ...KeyRotationPolicyWithAllProperties[1].json | 224 +++ .../KeyAsyncClientTest.updateKey[1].json | 176 ++ ...smTest.createOctKeyWithDefaultSize[1].json | 98 ++ ...smTest.createOctKeyWithInvalidSize[1].json | 75 + ...dHsmTest.createOctKeyWithValidSize[1].json | 99 ++ ...est.createRsaKeyWithPublicExponent[1].json | 100 ++ ...yClientManagedHsmTest.createRsaKey[1].json | 99 ++ ...lientManagedHsmTest.getRandomBytes[1].json | 61 + ...KeyClientManagedHsmTest.releaseKey[1].json | 4 + .../KeyClientTest.backupKeyNotFound[1].json | 73 + .../KeyClientTest.backupKey[1].json | 131 ++ .../KeyClientTest.createKeyEmptyName[1].json | 77 + .../KeyClientTest.createKeyNullType[1].json | 76 + .../KeyClientTest.createKeyNull[1].json | 4 + ...tTest.createKeyWithMultipleTenants[1].json | 177 ++ .../KeyClientTest.createKey[1].json | 108 ++ .../KeyClientTest.createRsaKey[1].json | 108 ++ .../KeyClientTest.deleteKeyNotFound[1].json | 73 + .../KeyClientTest.deleteKey[1].json | 246 +++ ...ryptographyClientAndEncryptDecrypt[1].json | 200 +++ ...ptographyClientWithEmptyKeyVersion[1].json | 4 + ...etCryptographyClientWithKeyVersion[1].json | 4 + ...yptographyClientWithNullKeyVersion[1].json | 4 + ...eyClientTest.getCryptographyClient[1].json | 4 + ...eyClientTest.getDeletedKeyNotFound[1].json | 73 + .../KeyClientTest.getDeletedKey[1].json | 302 ++++ .../KeyClientTest.getKeyNotFound[1].json | 73 + ...tKeyRotationPolicyOfNonExistentKey[1].json | 71 + ...etKeyRotationPolicyWithNoPolicySet[1].json | 136 ++ ...eyClientTest.getKeySpecificVersion[1].json | 265 +++ .../KeyClientTest.getKey[1].json | 153 ++ .../KeyClientTest.listDeletedKeys[1].json | 1132 +++++++++++++ .../KeyClientTest.listKeyVersions[1].json | 358 +++++ .../KeyClientTest.listKeys[1].json | 1424 +++++++++++++++++ ...ientTest.recoverDeletedKeyNotFound[1].json | 73 + .../KeyClientTest.recoverDeletedKey[1].json | 454 ++++++ .../KeyClientTest.releaseKey[1].json | 4 + ...Test.restoreKeyFromMalformedBackup[1].json | 75 + .../KeyClientTest.restoreKey[1].json | 427 +++++ .../KeyClientTest.rotateKey[1].json | 147 ++ .../KeyClientTest.updateDisabledKey[1].json | 155 ++ ...KeyRotationPolicyWithAllProperties[1].json | 224 +++ .../KeyClientTest.updateKey[1].json | 176 ++ ...edHsmTest.wrapUnwrapSymmetricAK128[1].json | 250 +++ ...edHsmTest.wrapUnwrapSymmetricAK192[1].json | 250 +++ ...entTest.wrapUnwrapSymmetricAK128Local.json | 4 + ...lientTest.wrapUnwrapSymmetricAK128[1].json | 122 ++ ...entTest.wrapUnwrapSymmetricAK192Local.json | 4 + ...lientTest.wrapUnwrapSymmetricAK192[1].json | 122 ++ 128 files changed, 18297 insertions(+), 2627 deletions(-) delete mode 100644 sdk/keyvault/azure-security-keyvault-keys/assets.json delete mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientImpl.java create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceClient.java create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/main/resources/kvErrorStrings.properties create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcPadLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcPadLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcPadLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsaLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsa[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.signVerifyRsa[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsaLocal.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsa[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithDefaultSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithInvalidSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithValidSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.getRandomBytes[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.releaseKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyEmptyName[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNullType[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNull[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyWithMultipleTenants[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createRsaKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientAndEncryptDecrypt[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithEmptyKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithNullKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClient[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyOfNonExistentKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyWithNoPolicySet[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeySpecificVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listDeletedKeys[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeyVersions[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeys[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.releaseKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKeyFromMalformedBackup[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.rotateKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateDisabledKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithDefaultSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithInvalidSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithValidSize[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.getRandomBytes[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.releaseKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyEmptyName[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNullType[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNull[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyWithMultipleTenants[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createRsaKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientAndEncryptDecrypt[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithEmptyKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithNullKeyVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClient[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyOfNonExistentKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyWithNoPolicySet[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeySpecificVersion[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listDeletedKeys[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeyVersions[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeys[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKeyNotFound[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.releaseKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKeyFromMalformedBackup[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.rotateKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateDisabledKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateKey[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK128[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK192[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128Local.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128[1].json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192Local.json create mode 100644 sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192[1].json diff --git a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md index ab1471510b200..8f2ea00fb9eba 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md @@ -1,16 +1,5 @@ # Release History -## 4.7.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes -- Migrate test recordings to assets repo. - ## 4.6.4 (2023-07-25) ### Other Changes @@ -30,6 +19,7 @@ - Upgraded `azure-core` from `1.39.0` to version `1.40.0`. - Upgraded `azure-core-http-netty` from `1.13.3` to version `1.13.4`. + ## 4.6.2 (2023-05-23) ### Other Changes @@ -39,6 +29,7 @@ - Upgraded `azure-core-http-netty` from `1.13.2` to version `1.13.3`. - Upgraded `azure-core` from `1.38.0` to version `1.39.0`. + ## 4.6.1 (2023-04-20) ### Other Changes diff --git a/sdk/keyvault/azure-security-keyvault-keys/assets.json b/sdk/keyvault/azure-security-keyvault-keys/assets.json deleted file mode 100644 index 789370fd57112..0000000000000 --- a/sdk/keyvault/azure-security-keyvault-keys/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/keyvault/azure-security-keyvault-keys", - "Tag": "java/keyvault/azure-security-keyvault-keys_8f5c85b7b9" -} diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml index 51560db92d1d5..c34c1be5047b9 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml @@ -14,7 +14,7 @@ com.azure azure-security-keyvault-keys - 4.7.0-beta.1 + 4.6.4 Microsoft Azure client library for KeyVault Keys This module contains client library for Microsoft Azure KeyVault Keys. @@ -63,13 +63,13 @@ com.azure azure-core - 1.42.0 + 1.41.0 com.azure azure-core-http-netty - 1.13.6 + 1.13.5 @@ -106,19 +106,19 @@ com.azure azure-core-test - 1.19.0 + 1.18.1 test com.azure azure-core-http-okhttp - 1.11.12 + 1.11.11 test com.azure azure-identity - 1.10.0 + 1.9.2 test diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java index b066b55d91d81..fd47d2359c956 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java @@ -1321,7 +1321,7 @@ public Mono> restoreKeyBackupWithResponse(byte[] backup) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPropertiesOfKeys() { - return implClient.listPropertiesOfKeysAsync(); + return implClient.listPropertiesOfKeys(); } /** @@ -1346,7 +1346,7 @@ public PagedFlux listPropertiesOfKeys() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDeletedKeys() { - return implClient.listDeletedKeysAsync(); + return implClient.listDeletedKeys(); } /** @@ -1381,7 +1381,7 @@ public PagedFlux listDeletedKeys() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPropertiesOfKeyVersions(String name) { - return implClient.listPropertiesOfKeyVersionsAsync(name); + return implClient.listPropertiesOfKeyVersions(name); } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClient.java index 630f0d5c270cd..0ba159638c1b7 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClient.java @@ -438,7 +438,7 @@ public Response createEcKeyWithResponse(CreateEcKeyOptions createEc *

Code Samples

*

Creates a new {@link KeyVaultKey symmetric key}. The {@link KeyVaultKey key} activates in one day and expires * in one year. Prints out the details of the newly {@link KeyVaultKey created key}.

- * + * *
      * CreateOctKeyOptions createOctKeyOptions = new CreateOctKeyOptions("keyName")
      *     .setNotBefore(OffsetDateTime.now().plusDays(1))
@@ -447,7 +447,7 @@ public Response createEcKeyWithResponse(CreateEcKeyOptions createEc
      *
      * System.out.printf("Created key with name: %s and id: %s%n", octKey.getName(), octKey.getId());
      * 
- * + * * * @param createOctKeyOptions The {@link CreateOctKeyOptions options object} containing information about the * {@link KeyVaultKey symmetric key} being created. @@ -479,7 +479,7 @@ public KeyVaultKey createOctKey(CreateOctKeyOptions createOctKeyOptions) { *

Code Samples

*

Creates a new {@link KeyVaultKey symmetric key}. The {@link KeyVaultKey key} activates in one day and expires * in one year. Prints out the details of the newly {@link KeyVaultKey created key}.

- * + * *
      * CreateOctKeyOptions createOctKeyOptions = new CreateOctKeyOptions("keyName")
      *     .setNotBefore(OffsetDateTime.now().plusDays(1))
@@ -490,7 +490,7 @@ public KeyVaultKey createOctKey(CreateOctKeyOptions createOctKeyOptions) {
      * System.out.printf("Created key with name: %s and: id %s%n", createOctKeyResponse.getValue().getName(),
      *     createOctKeyResponse.getValue().getId());
      * 
- * + * * * @param createOctKeyOptions The {@link CreateOctKeyOptions options object} containing information about the * {@link KeyVaultKey symmetric key} being created. @@ -849,7 +849,7 @@ public Response updateKeyPropertiesWithResponse(KeyProperties keyPr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginDeleteKey(String name) { - return implClient.beginDeleteKey(name, Context.NONE); + return implClient.beginDeleteKeyAsync(name).getSyncPoller(); } /** @@ -995,7 +995,7 @@ public Response purgeDeletedKeyWithResponse(String name, Context context) */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginRecoverDeletedKey(String name) { - return implClient.beginRecoverDeletedKey(name, Context.NONE); + return implClient.beginRecoverDeletedKeyAsync(name).getSyncPoller(); } /** @@ -1243,7 +1243,7 @@ public PagedIterable listPropertiesOfKeys() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPropertiesOfKeys(Context context) { - return implClient.listPropertiesOfKeys(context); + return new PagedIterable<>(implClient.listPropertiesOfKeys(context)); } /** @@ -1322,7 +1322,7 @@ public PagedIterable listDeletedKeys() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeletedKeys(Context context) { - return implClient.listDeletedKeys(context); + return new PagedIterable<>(implClient.listDeletedKeys(context)); } /** @@ -1421,7 +1421,7 @@ public PagedIterable listPropertiesOfKeyVersions(String name) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPropertiesOfKeyVersions(String name, Context context) { - return implClient.listPropertiesOfKeyVersions(name, context); + return new PagedIterable<>(implClient.listPropertiesOfKeyVersions(name, context)); } /** @@ -1529,7 +1529,7 @@ public ReleaseKeyResult releaseKey(String name, String targetAttestationToken) { * * @param name The name of the {@link KeyVaultKey key} to release. * @param version The version of the key to release. If this is empty or {@code null}, this call is equivalent to - * calling {@link KeyClient#releaseKey(String, String)}, with the latest key version being released. + * calling {@link KeyAsyncClient#releaseKey(String, String)}, with the latest key version being released. * @param targetAttestationToken The attestation assertion for the target of the {@link KeyVaultKey key} release. * * @return The key release result containing the {@link KeyVaultKey released key}. @@ -1571,7 +1571,7 @@ public ReleaseKeyResult releaseKey(String name, String version, String targetAtt * * @param name The name of the {@link KeyVaultKey key} to release. * @param version The version of the {@link KeyVaultKey key} to release. If this is empty or {@code null}, this call - * is equivalent to calling {@link KeyClient#releaseKey(String, String)}, with the latest key version being + * is equivalent to calling {@link KeyAsyncClient#releaseKey(String, String)}, with the latest key version being * released. * @param targetAttestationToken The attestation assertion for the target of the key release. * @param releaseKeyOptions Additional {@link ReleaseKeyOptions options} for releasing a {@link KeyVaultKey key}. diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java index e18af7349eecb..06ab627fc78df 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java @@ -179,8 +179,9 @@ private KeyClientImpl buildInnerClient() { String buildEndpoint = getBuildEndpoint(buildConfiguration); if (buildEndpoint == null) { - throw LOGGER.logExceptionAsError( - new IllegalStateException(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); + throw LOGGER + .logExceptionAsError(new IllegalStateException(KeyVaultErrorCodeStrings + .getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED))); } KeyServiceVersion serviceVersion = version != null ? version : KeyServiceVersion.getLatest(); @@ -190,7 +191,9 @@ private KeyClientImpl buildInnerClient() { } if (credential == null) { - throw LOGGER.logExceptionAsError(new IllegalStateException(KeyVaultErrorCodeStrings.CREDENTIALS_REQUIRED)); + throw LOGGER.logExceptionAsError( + new IllegalStateException(KeyVaultErrorCodeStrings + .getErrorString(KeyVaultErrorCodeStrings.CREDENTIAL_REQUIRED))); } // Closest to API goes first, closest to wire goes last. diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/AesKeyCryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/AesKeyCryptographyClient.java index 56aab7597133b..3a6f04174523e 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/AesKeyCryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/AesKeyCryptographyClient.java @@ -35,11 +35,11 @@ class AesKeyCryptographyClient extends LocalKeyCryptographyClient { * * @param serviceClient The client to route the requests through. */ - AesKeyCryptographyClient(CryptographyClientImpl serviceClient) { + AesKeyCryptographyClient(CryptographyServiceClient serviceClient) { super(serviceClient); } - AesKeyCryptographyClient(JsonWebKey key, CryptographyClientImpl serviceClient) { + AesKeyCryptographyClient(JsonWebKey key, CryptographyServiceClient serviceClient) { super(serviceClient); this.key = key.toAes().getEncoded(); } @@ -52,64 +52,36 @@ private byte[] getKey(JsonWebKey key) { } - @Override - Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); - - try { - return encryptInternalAsync(algorithm, plaintext, null, null, jsonWebKey, context); - } catch (Exception e) { - return Mono.error(e); - } - } @Override - EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); - - return encryptInternal(algorithm, plaintext, null, null, jsonWebKey, context); - } - - @Override - Mono encryptAsync(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(encryptParameters, "Encrypt parameters cannot be null."); - - try { - return encryptInternalAsync(encryptParameters.getAlgorithm(), encryptParameters.getPlainText(), - encryptParameters.getIv(), encryptParameters.getAdditionalAuthenticatedData(), jsonWebKey, context); - } catch (Exception e) { - return Mono.error(e); - } + Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, + JsonWebKey jsonWebKey) { + return encryptInternal(algorithm, plaintext, null, null, context, jsonWebKey); } @Override - EncryptResult encrypt(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(encryptParameters, "Encrypt parameters cannot be null."); - + Mono encryptAsync(EncryptParameters encryptParameters, Context context, JsonWebKey jsonWebKey) { return encryptInternal(encryptParameters.getAlgorithm(), encryptParameters.getPlainText(), - encryptParameters.getIv(), encryptParameters.getAdditionalAuthenticatedData(), jsonWebKey, context); + encryptParameters.getIv(), encryptParameters.getAdditionalAuthenticatedData(), context, jsonWebKey); } - private Mono encryptInternalAsync(EncryptionAlgorithm algorithm, byte[] plaintext, byte[] iv, - byte[] additionalAuthenticatedData, JsonWebKey jsonWebKey, - Context context) { + private Mono encryptInternal(EncryptionAlgorithm algorithm, byte[] plaintext, byte[] iv, + byte[] additionalAuthenticatedData, Context context, + JsonWebKey jsonWebKey) { if (isGcm(algorithm)) { return Mono.error( new UnsupportedOperationException("AES-GCM is not supported for local cryptography operations.")); } if (!isAes(algorithm)) { - return Mono.error( + throw LOGGER.logExceptionAsError( new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); } - key = getKey(jsonWebKey); + this.key = getKey(jsonWebKey); if (key == null || key.length == 0) { - return Mono.error(new IllegalArgumentException("Key is empty.")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException("Key is empty.")); } // Interpret the algorithm @@ -127,13 +99,13 @@ private Mono encryptInternalAsync(EncryptionAlgorithm algorithm, if (isAes(algorithm)) { iv = generateRandomByteArray(AES_BLOCK_SIZE); } else { - return Mono.error( + throw LOGGER.logExceptionAsError( new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); } } try { - transform = symmetricEncryptionAlgorithm.createEncryptor(key, iv, additionalAuthenticatedData, + transform = symmetricEncryptionAlgorithm.createEncryptor(this.key, iv, additionalAuthenticatedData, null); } catch (Exception e) { return Mono.error(e); @@ -151,130 +123,36 @@ private Mono encryptInternalAsync(EncryptionAlgorithm algorithm, additionalAuthenticatedData)); } - private EncryptResult encryptInternal(EncryptionAlgorithm algorithm, byte[] plaintext, byte[] iv, - byte[] additionalAuthenticatedData, JsonWebKey jsonWebKey, - Context context) { - if (isGcm(algorithm)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("AES-GCM is not supported for local cryptography operations.")); - } - - if (!isAes(algorithm)) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); - } - - key = getKey(jsonWebKey); - - if (key == null || key.length == 0) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Key is empty.")); - } - - // Interpret the algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (!(baseAlgorithm instanceof SymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - SymmetricEncryptionAlgorithm symmetricEncryptionAlgorithm = (SymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - if (iv == null) { - if (isAes(algorithm)) { - iv = generateRandomByteArray(AES_BLOCK_SIZE); - } else { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); - } - } - - try { - transform = symmetricEncryptionAlgorithm.createEncryptor(key, iv, additionalAuthenticatedData, - null); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - byte[] ciphertext; - - try { - ciphertext = transform.doFinal(plaintext); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - return new EncryptResult(ciphertext, algorithm, jsonWebKey.getId(), iv, null, - additionalAuthenticatedData); - } - - @Override - Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - - try { - return decryptInternalAsync(algorithm, ciphertext, null, null, null, jsonWebKey, context); - } catch (Exception e) { - return Mono.error(e); - } - } - @Override - DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - - return decryptInternal(algorithm, ciphertext, null, null, null, jsonWebKey, context); + Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context, + JsonWebKey jsonWebKey) { + return decryptInternal(algorithm, ciphertext, null, null, null, context, jsonWebKey); } @Override - Mono decryptAsync(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context) { - try { - return decryptInternalAsync(decryptParameters.getAlgorithm(), decryptParameters.getCipherText(), - decryptParameters.getIv(), decryptParameters.getAdditionalAuthenticatedData(), - decryptParameters.getAuthenticationTag(), jsonWebKey, context); - } catch (Exception e) { - return Mono.error(e); - } - } - - @Override - DecryptResult decrypt(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(decryptParameters, "Decrypt parameters cannot be null."); - + Mono decryptAsync(DecryptParameters decryptParameters, Context context, JsonWebKey jsonWebKey) { return decryptInternal(decryptParameters.getAlgorithm(), decryptParameters.getCipherText(), decryptParameters.getIv(), decryptParameters.getAdditionalAuthenticatedData(), - decryptParameters.getAuthenticationTag(), jsonWebKey, context); + decryptParameters.getAuthenticationTag(), context, jsonWebKey); } - private Mono decryptInternalAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, byte[] iv, - byte[] additionalAuthenticatedData, byte[] authenticationTag, - JsonWebKey jsonWebKey, Context context) { + private Mono decryptInternal(EncryptionAlgorithm algorithm, byte[] ciphertext, byte[] iv, + byte[] additionalAuthenticatedData, byte[] authenticationTag, + Context context, JsonWebKey jsonWebKey) { if (isGcm(algorithm)) { return Mono.error( new UnsupportedOperationException("AES-GCM is not supported for local cryptography operations.")); } if (!isAes(algorithm)) { - return Mono.error( + throw LOGGER.logExceptionAsError( new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); } - key = getKey(jsonWebKey); + this.key = getKey(jsonWebKey); if (key == null || key.length == 0) { - return Mono.error(new IllegalArgumentException("Key is empty.")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException("Key is empty.")); } // Interpret the algorithm @@ -291,7 +169,7 @@ private Mono decryptInternalAsync(EncryptionAlgorithm algorithm, Objects.requireNonNull(iv, "'iv' cannot be null in local decryption operations."); try { - transform = symmetricEncryptionAlgorithm.createDecryptor(key, iv, additionalAuthenticatedData, + transform = symmetricEncryptionAlgorithm.createDecryptor(this.key, iv, additionalAuthenticatedData, authenticationTag); } catch (Exception e) { return Mono.error(e); @@ -308,93 +186,20 @@ private Mono decryptInternalAsync(EncryptionAlgorithm algorithm, return Mono.just(new DecryptResult(plaintext, algorithm, jsonWebKey.getId())); } - private DecryptResult decryptInternal(EncryptionAlgorithm algorithm, byte[] ciphertext, byte[] iv, - byte[] additionalAuthenticatedData, byte[] authenticationTag, - JsonWebKey jsonWebKey, Context context) { - if (isGcm(algorithm)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("AES-GCM is not supported for local cryptography operations.")); - } - - if (!isAes(algorithm)) { - throw LOGGER.logExceptionAsError( - new IllegalStateException("Encryption algorithm provided is not supported: " + algorithm)); - } - - key = getKey(jsonWebKey); - - if (key == null || key.length == 0) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Key is empty.")); - } - - // Interpret the algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (!(baseAlgorithm instanceof SymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - SymmetricEncryptionAlgorithm symmetricEncryptionAlgorithm = (SymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - Objects.requireNonNull(iv, "'iv' cannot be null in local decryption operations."); - - try { - transform = symmetricEncryptionAlgorithm.createDecryptor(key, iv, additionalAuthenticatedData, - authenticationTag); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - byte[] plaintext; - - try { - plaintext = transform.doFinal(ciphertext); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - return new DecryptResult(plaintext, algorithm, jsonWebKey.getId()); - } - @Override - Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { + Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, Context context, JsonWebKey key) { return Mono.error(new UnsupportedOperationException("Sign operation not supported for OCT/Symmetric key.")); } @Override - SignResult sign(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Sign operation not supported for OCT/Symmetric key.")); - } - - @Override - Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { + Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context, + JsonWebKey key) { return Mono.error(new UnsupportedOperationException("Verify operation not supported for OCT/Symmetric key.")); } - VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Verify operation not supported for OCT/Symmetric key.")); - } - @Override - Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] keyToWrap, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(keyToWrap, "Key content to be wrapped cannot be null."); - - key = getKey(jsonWebKey); + Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, Context context, JsonWebKey jsonWebKey) { + this.key = getKey(jsonWebKey); if (key == null || key.length == 0) { throw LOGGER.logExceptionAsError(new IllegalArgumentException("key")); @@ -412,7 +217,7 @@ Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] keyToWrap, Json ICryptoTransform transform; try { - transform = localKeyWrapAlgorithm.createEncryptor(key, null, null); + transform = localKeyWrapAlgorithm.createEncryptor(this.key, null, null); } catch (Exception e) { return Mono.error(e); } @@ -420,7 +225,7 @@ Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] keyToWrap, Json byte[] encrypted; try { - encrypted = transform.doFinal(keyToWrap); + encrypted = transform.doFinal(key); } catch (Exception e) { return Mono.error(e); } @@ -429,58 +234,7 @@ Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] keyToWrap, Json } @Override - WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] keyToWrap, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(keyToWrap, "Key content to be wrapped cannot be null."); - - this.key = getKey(jsonWebKey); - - if (this.key == null || this.key.length == 0) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("key")); - } - - // Interpret the algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (!(baseAlgorithm instanceof LocalKeyWrapAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - LocalKeyWrapAlgorithm localKeyWrapAlgorithm = (LocalKeyWrapAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = localKeyWrapAlgorithm.createEncryptor(this.key, null, null); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - byte[] encrypted; - - try { - encrypted = transform.doFinal(keyToWrap); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - return new WrapResult(encrypted, algorithm, jsonWebKey.getId()); - } - - @Override - Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - + Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context, JsonWebKey jsonWebKey) { this.key = getKey(jsonWebKey); Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); @@ -511,66 +265,14 @@ Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKe } @Override - UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - - this.key = getKey(jsonWebKey); - - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (!(baseAlgorithm instanceof LocalKeyWrapAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - LocalKeyWrapAlgorithm localKeyWrapAlgorithm = (LocalKeyWrapAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = localKeyWrapAlgorithm.createDecryptor(this.key, null, null); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - byte[] decrypted; - - try { - decrypted = transform.doFinal(encryptedKey); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - return new UnwrapResult(decrypted, algorithm, jsonWebKey.getId()); - } - - @Override - Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { - return signAsync(algorithm, data, key, context); - } - - @Override - SignResult signData(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { - return sign(algorithm, data, key, context); + Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, Context context, JsonWebKey key) { + return signAsync(algorithm, data, context, key); } @Override - Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { - return verifyAsync(algorithm, data, signature, key, context); - } - - VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { - return verify(algorithm, data, signature, key, context); + Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context, + JsonWebKey key) { + return verifyAsync(algorithm, data, signature, context, key); } private byte[] generateRandomByteArray(int sizeInBytes) { diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java index 21420395a9330..a39869b3f082c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyAsyncClient.java @@ -9,7 +9,9 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService; @@ -29,13 +31,19 @@ import com.azure.security.keyvault.keys.models.KeyVaultKey; import reactor.core.publisher.Mono; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; import java.util.Objects; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.checkKeyPermissions; -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.initializeCryptoClient; -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.unpackAndValidateId; +import static com.azure.security.keyvault.keys.models.KeyType.EC; +import static com.azure.security.keyvault.keys.models.KeyType.EC_HSM; +import static com.azure.security.keyvault.keys.models.KeyType.OCT; +import static com.azure.security.keyvault.keys.models.KeyType.OCT_HSM; +import static com.azure.security.keyvault.keys.models.KeyType.RSA; +import static com.azure.security.keyvault.keys.models.KeyType.RSA_HSM; /** * The {@link CryptographyAsyncClient} provides asynchronous methods to perform cryptographic operations using @@ -67,13 +75,15 @@ public class CryptographyAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(CryptographyAsyncClient.class); - private final String keyCollection; + private final CryptographyService service; private final HttpPipeline pipeline; + private final String keyId; + private CryptographyServiceClient cryptographyServiceClient; private LocalKeyCryptographyClient localKeyCryptographyClient; + private String keyCollection; - final CryptographyClientImpl implClient; - final String keyId; + static final String SECRETS_COLLECTION = "secrets"; JsonWebKey key; @@ -85,10 +95,12 @@ public class CryptographyAsyncClient { * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. */ CryptographyAsyncClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { - this.keyCollection = unpackAndValidateId(keyId); + unpackAndValidateId(keyId); + this.keyId = keyId; this.pipeline = pipeline; - this.implClient = new CryptographyClientImpl(keyId, pipeline, version); + this.service = RestProxy.create(CryptographyService.class, pipeline); + this.cryptographyServiceClient = new CryptographyServiceClient(keyId, service, version); this.key = null; } @@ -113,12 +125,30 @@ public class CryptographyAsyncClient { throw new IllegalArgumentException("The JSON Web Key's key type property is not configured."); } - this.keyCollection = null; this.key = jsonWebKey; this.keyId = jsonWebKey.getId(); this.pipeline = null; - this.implClient = null; - this.localKeyCryptographyClient = initializeCryptoClient(key, null); + this.service = null; + this.cryptographyServiceClient = null; + + initializeCryptoClients(); + } + + private void initializeCryptoClients() { + if (localKeyCryptographyClient != null) { + return; + } + + if (key.getKeyType().equals(RSA) || key.getKeyType().equals(RSA_HSM)) { + this.localKeyCryptographyClient = new RsaKeyCryptographyClient(this.key, this.cryptographyServiceClient); + } else if (key.getKeyType().equals(EC) || key.getKeyType().equals(EC_HSM)) { + this.localKeyCryptographyClient = new EcKeyCryptographyClient(this.key, this.cryptographyServiceClient); + } else if (key.getKeyType().equals(OCT) || key.getKeyType().equals(OCT_HSM)) { + this.localKeyCryptographyClient = new AesKeyCryptographyClient(this.key, this.cryptographyServiceClient); + } else { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The JSON Web Key type: %s is not supported.", this.key.getKeyType().toString()))); + } } /** @@ -130,6 +160,10 @@ HttpPipeline getHttpPipeline() { return this.pipeline; } + Mono getKeyId() { + return Mono.defer(() -> Mono.just(this.keyId)); + } + /** * Gets the public part of the configured key. The get key operation is applicable to all key types and it requires * the {@code keys/get} permission for non-local operations. @@ -193,8 +227,8 @@ public Mono> getKeyWithResponse() { } Mono> getKeyWithResponse(Context context) { - if (implClient != null) { - return implClient.getKeyAsync(context); + if (cryptographyServiceClient != null) { + return cryptographyServiceClient.getKey(context); } else { throw LOGGER.logExceptionAsError(new UnsupportedOperationException( "Operation not supported when in operating local-only mode")); @@ -203,7 +237,7 @@ Mono> getKeyWithResponse(Context context) { Mono getSecretKey() { try { - return withContext(implClient::getSecretKeyAsync) + return withContext(context -> cryptographyServiceClient.getSecretKey(context)) .flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(LOGGER, ex); @@ -212,14 +246,12 @@ Mono getSecretKey() { /** * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports - * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be - * used. + * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. * The encrypt operation is supported for both symmetric keys and asymmetric keys. In case of asymmetric keys, the * public portion of the key is used for encryption. This operation requires the {@code keys/encrypt} permission * for non-local operations. * - *

The {@link EncryptionAlgorithm encryption algorithm} indicates the type of algorithm to use for encrypting - * the + *

The {@link EncryptionAlgorithm encryption algorithm} indicates the type of algorithm to use for encrypting the * specified {@code plaintext}. Possible values for asymmetric keys include: * {@link EncryptionAlgorithm#RSA1_5 RSA1_5}, {@link EncryptionAlgorithm#RSA_OAEP RSA_OAEP} and * {@link EncryptionAlgorithm#RSA_OAEP_256 RSA_OAEP_256}. @@ -236,8 +268,7 @@ Mono getSecretKey() { *

Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when * a response has been received.

* - * + * *
      * byte[] plaintext = new byte[100];
      * new Random(0x1234567L).nextBytes(plaintext);
@@ -248,8 +279,7 @@ Mono getSecretKey() {
      *         System.out.printf("Received encrypted content of length: %d, with algorithm: %s.%n",
      *             encryptResult.getCipherText().length, encryptResult.getAlgorithm().toString()));
      * 
- * + * * * @param algorithm The algorithm to be used for encryption. * @param plaintext The content to be encrypted. @@ -263,19 +293,20 @@ Mono getSecretKey() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono encrypt(EncryptionAlgorithm algorithm, byte[] plaintext) { - return encrypt(algorithm, plaintext, Context.NONE); + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(plaintext, "'plaintext' cannot be null."); + + return encrypt(algorithm, plaintext, null); } /** * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports - * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be - * used. + * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. * The encrypt operation is supported for both symmetric keys and asymmetric keys. In case of asymmetric keys, the * public portion of the key is used for encryption. This operation requires the {@code keys/encrypt} permission * for non-local operations. * - *

The {@link EncryptionAlgorithm encryption algorithm} indicates the type of algorithm to use for encrypting - * the + *

The {@link EncryptionAlgorithm encryption algorithm} indicates the type of algorithm to use for encrypting the * specified {@code plaintext}. Possible values for asymmetric keys include: * {@link EncryptionAlgorithm#RSA1_5 RSA1_5}, {@link EncryptionAlgorithm#RSA_OAEP RSA_OAEP} and * {@link EncryptionAlgorithm#RSA_OAEP_256 RSA_OAEP_256}. @@ -292,8 +323,7 @@ public Mono encrypt(EncryptionAlgorithm algorithm, byte[] plainte *

Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when * a response has been received.

* - * + * *
      * byte[] plaintextBytes = new byte[100];
      * new Random(0x1234567L).nextBytes(plaintextBytes);
@@ -323,6 +353,8 @@ public Mono encrypt(EncryptionAlgorithm algorithm, byte[] plainte
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono encrypt(EncryptParameters encryptParameters) {
+        Objects.requireNonNull(encryptParameters, "'encryptParameters' cannot be null.");
+
         try {
             return withContext(context -> encrypt(encryptParameters, context));
         } catch (RuntimeException ex) {
@@ -333,30 +365,30 @@ public Mono encrypt(EncryptParameters encryptParameters) {
     Mono encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) {
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.encryptAsync(algorithm, plaintext, context);
+                return cryptographyServiceClient.encrypt(algorithm, plaintext, context);
             }
 
-            if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.ENCRYPT)) {
+            if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.ENCRYPT)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
                     "Encrypt operation is missing permission/not supported for key with id: %s", key.getId()))));
             }
 
-            return localKeyCryptographyClient.encryptAsync(algorithm, plaintext, key, context);
+            return localKeyCryptographyClient.encryptAsync(algorithm, plaintext, context, key);
         });
     }
 
     Mono encrypt(EncryptParameters encryptParameters, Context context) {
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.encryptAsync(encryptParameters, context);
+                return cryptographyServiceClient.encrypt(encryptParameters, context);
             }
 
-            if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.ENCRYPT)) {
+            if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.ENCRYPT)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
                     "Encrypt operation is missing permission/not supported for key with id: %s", key.getId()))));
             }
 
-            return localKeyCryptographyClient.encryptAsync(encryptParameters, key, context);
+            return localKeyCryptographyClient.encryptAsync(encryptParameters, context, key);
         });
     }
 
@@ -383,8 +415,7 @@ Mono encrypt(EncryptParameters encryptParameters, Context context
      * 

Decrypts the encrypted content. Subscribes to the call asynchronously and prints out the decrypted content * details when a response has been received.

* - * + * *
      * byte[] ciphertext = new byte[100];
      * new Random(0x1234567L).nextBytes(ciphertext);
@@ -394,14 +425,12 @@ Mono encrypt(EncryptParameters encryptParameters, Context context
      *     .subscribe(decryptResult ->
      *         System.out.printf("Received decrypted content of length: %d%n", decryptResult.getPlainText().length));
      * 
- * + * * * @param algorithm The algorithm to be used for decryption. * @param ciphertext The content to be decrypted. Microsoft recommends you not use CBC without first ensuring the * integrity of the ciphertext using an HMAC, for example. - * See Timing vulnerabilities - * with CBC-mode symmetric decryption using padding for more information. + * See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information. * * @return A {@link Mono} containing the decrypted blob. * @@ -411,6 +440,9 @@ Mono encrypt(EncryptParameters encryptParameters, Context context */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext) { + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(algorithm, "'ciphertext' cannot be null."); + return decrypt(algorithm, ciphertext, null); } @@ -437,8 +469,7 @@ public Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphert *

Decrypts the encrypted content. Subscribes to the call asynchronously and prints out the decrypted content * details when a response has been received.

* - * + * *
      * byte[] ciphertextBytes = new byte[100];
      * new Random(0x1234567L).nextBytes(ciphertextBytes);
@@ -458,8 +489,7 @@ public Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphert
      *
      * @param decryptParameters The parameters to use in the decryption operation. Microsoft recommends you not use CBC
      * without first ensuring the integrity of the ciphertext using an HMAC, for example.
-     * See Timing vulnerabilities
-     * with CBC-mode symmetric decryption using padding for more information.
+     * See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
      *
      * @return A {@link Mono} containing the decrypted blob.
      *
@@ -469,6 +499,8 @@ public Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphert
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono decrypt(DecryptParameters decryptParameters) {
+        Objects.requireNonNull(decryptParameters, "'decryptParameters' cannot be null.");
+
         try {
             return withContext(context -> decrypt(decryptParameters, context));
         } catch (RuntimeException ex) {
@@ -479,30 +511,30 @@ public Mono decrypt(DecryptParameters decryptParameters) {
     Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context) {
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.decryptAsync(algorithm, ciphertext, context);
+                return cryptographyServiceClient.decrypt(algorithm, ciphertext, context);
             }
 
-            if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.DECRYPT)) {
+            if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.DECRYPT)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
                     "Decrypt operation is not allowed for key with id: %s", key.getId()))));
             }
 
-            return localKeyCryptographyClient.decryptAsync(algorithm, ciphertext, key, context);
+            return localKeyCryptographyClient.decryptAsync(algorithm, ciphertext, context, key);
         });
     }
 
     Mono decrypt(DecryptParameters decryptParameters, Context context) {
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.decryptAsync(decryptParameters, context);
+                return cryptographyServiceClient.decrypt(decryptParameters, context);
             }
 
-            if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.DECRYPT)) {
+            if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.DECRYPT)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
                     "Decrypt operation is not allowed for key with id: %s", key.getId()))));
             }
 
-            return localKeyCryptographyClient.decryptAsync(decryptParameters, key, context);
+            return localKeyCryptographyClient.decryptAsync(decryptParameters, context, key);
         });
     }
 
@@ -522,8 +554,7 @@ Mono decrypt(DecryptParameters decryptParameters, Context context
      * 

Sings the digest. Subscribes to the call asynchronously and prints out the signature details when a response * has been received.

* - * + * *
      * byte[] data = new byte[100];
      * new Random(0x1234567L).nextBytes(data);
@@ -559,17 +590,20 @@ public Mono sign(SignatureAlgorithm algorithm, byte[] digest) {
     }
 
     Mono sign(SignatureAlgorithm algorithm, byte[] digest, Context context) {
+        Objects.requireNonNull(algorithm, "Signature algorithm cannot be null.");
+        Objects.requireNonNull(digest, "Digest content to be signed cannot be null.");
+
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.signAsync(algorithm, digest, context);
+                return cryptographyServiceClient.sign(algorithm, digest, context);
             }
 
-            if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.SIGN)) {
+            if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.SIGN)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
                     "Sign operation is not allowed for key with id: %s", key.getId()))));
             }
 
-            return localKeyCryptographyClient.signAsync(algorithm, digest, key, context);
+            return localKeyCryptographyClient.signAsync(algorithm, digest, context, key);
         });
     }
 
@@ -590,8 +624,7 @@ Mono sign(SignatureAlgorithm algorithm, byte[] digest, Context conte
      * 

Verifies the signature against the specified digest. Subscribes to the call asynchronously and prints out the * verification details when a response has been received.

* - * + * *
      * byte[] myData = new byte[100];
      * new Random(0x1234567L).nextBytes(myData);
@@ -605,8 +638,7 @@ Mono sign(SignatureAlgorithm algorithm, byte[] digest, Context conte
      *     .subscribe(verifyResult ->
      *         System.out.printf("Verification status: %s.%n", verifyResult.isValid()));
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param digest The content from which signature was created. @@ -629,17 +661,21 @@ public Mono verify(SignatureAlgorithm algorithm, byte[] digest, by } Mono verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context) { + Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); + Objects.requireNonNull(digest, "Digest content cannot be null."); + Objects.requireNonNull(signature, "Signature to be verified cannot be null."); + return ensureValidKeyAvailable().flatMap(available -> { if (!available) { - return implClient.verifyAsync(algorithm, digest, signature, context); + return cryptographyServiceClient.verify(algorithm, digest, signature, context); } - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.VERIFY)) { + if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.VERIFY)) { return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format( "Verify operation is not allowed for key with id: %s", key.getId())))); } - return localKeyCryptographyClient.verifyAsync(algorithm, digest, signature, key, context); + return localKeyCryptographyClient.verifyAsync(algorithm, digest, signature, context, key); }); } @@ -660,8 +696,7 @@ Mono verify(SignatureAlgorithm algorithm, byte[] digest, byte[] si *

Wraps the key content. Subscribes to the call asynchronously and prints out the wrapped key details when a * response has been received.

* - * + * *
      * byte[] key = new byte[100];
      * new Random(0x1234567L).nextBytes(key);
@@ -694,24 +729,26 @@ public Mono wrapKey(KeyWrapAlgorithm algorithm, byte[] key) {
     }
 
     Mono wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context) {
+        Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null.");
+        Objects.requireNonNull(key, "Key content to be wrapped cannot be null.");
+
         return ensureValidKeyAvailable().flatMap(available -> {
             if (!available) {
-                return implClient.wrapKeyAsync(algorithm, key, context);
+                return cryptographyServiceClient.wrapKey(algorithm, key, context);
             }
 
             if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.WRAP_KEY)) {
                 return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format(
-                    "Wrap kKey operation is not allowed for key with id: %s", this.key.getId()))));
+                    "Wrap Key operation is not allowed for key with id: %s", this.key.getId()))));
             }
 
-            return localKeyCryptographyClient.wrapKeyAsync(algorithm, key, this.key, context);
+            return localKeyCryptographyClient.wrapKeyAsync(algorithm, key, context, this.key);
         });
     }
 
     /**
      * Unwraps a symmetric key using the configured key that was initially used for wrapping that key. This operation
-     * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap.
-     * This
+     * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap. This
      * operation requires the {@code keys/unwrapKey} permission for non-local operations.
      *
      * 

The {@link KeyWrapAlgorithm wrap algorithm} indicates the type of algorithm to use for unwrapping the @@ -726,8 +763,7 @@ Mono wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context *

Unwraps the key content. Subscribes to the call asynchronously and prints out the unwrapped key details when * a response has been received.

* - * + * *
      * byte[] keyToWrap = new byte[100];
      * new Random(0x1234567L).nextBytes(key);
@@ -739,8 +775,7 @@ Mono wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context
      *             .subscribe(keyUnwrapResult ->
      *                 System.out.printf("Received key of length: %d.%n", keyUnwrapResult.getKey().length)));
      * 
- * + * * * @param algorithm The encryption algorithm to use for wrapping the key. * @param encryptedKey The encrypted key content to unwrap. @@ -762,17 +797,20 @@ public Mono unwrapKey(KeyWrapAlgorithm algorithm, byte[] encrypted } Mono unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context) { + Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); + Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); + return ensureValidKeyAvailable().flatMap(available -> { if (!available) { - return implClient.unwrapKeyAsync(algorithm, encryptedKey, context); + return cryptographyServiceClient.unwrapKey(algorithm, encryptedKey, context); } - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.UNWRAP_KEY)) { + if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.UNWRAP_KEY)) { return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format( - "Unwrap key operation is not allowed for key with id: %s", key.getId())))); + "Unwrap Key operation is not allowed for key with id: %s", this.key.getId())))); } - return localKeyCryptographyClient.unwrapKeyAsync(algorithm, encryptedKey, key, context); + return localKeyCryptographyClient.unwrapKeyAsync(algorithm, encryptedKey, context, key); }); } @@ -792,8 +830,7 @@ Mono unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Co *

Signs the raw data. Subscribes to the call asynchronously and prints out the signature details when a * response has been received.

* - * + * *
      * byte[] data = new byte[100];
      * new Random(0x1234567L).nextBytes(data);
@@ -804,8 +841,7 @@ Mono unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Co
      *         System.out.printf("Received signature of length: %d, with algorithm: %s.%n",
      *             signResult.getSignature().length, signResult.getAlgorithm()));
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param data The content from which signature is to be created. @@ -827,17 +863,20 @@ public Mono signData(SignatureAlgorithm algorithm, byte[] data) { } Mono signData(SignatureAlgorithm algorithm, byte[] data, Context context) { + Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); + Objects.requireNonNull(data, "Data to be signed cannot be null."); + return ensureValidKeyAvailable().flatMap(available -> { if (!available) { - return implClient.signDataAsync(algorithm, data, context); + return cryptographyServiceClient.signData(algorithm, data, context); } - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.SIGN)) { + if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.SIGN)) { return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format( - "Sign operation is not allowed for key with id: %s", key.getId())))); + "Sign Operation is not allowed for key with id: %s", this.key.getId())))); } - return localKeyCryptographyClient.signDataAsync(algorithm, data, key, context); + return localKeyCryptographyClient.signDataAsync(algorithm, data, context, key); }); } @@ -858,9 +897,7 @@ Mono signData(SignatureAlgorithm algorithm, byte[] data, Context con *

Verifies the signature against the raw data. Subscribes to the call asynchronously and prints out the * verification details when a response has been received.

* - * + * *
      * byte[] myData = new byte[100];
      * new Random(0x1234567L).nextBytes(myData);
@@ -871,9 +908,7 @@ Mono signData(SignatureAlgorithm algorithm, byte[] data, Context con
      *     .subscribe(verifyResult ->
      *         System.out.printf("Verification status: %s.%n", verifyResult.isValid()));
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param data The raw content against which signature is to be verified. @@ -896,34 +931,68 @@ public Mono verifyData(SignatureAlgorithm algorithm, byte[] data, } Mono verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context) { + Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); + Objects.requireNonNull(data, "Data cannot be null."); + Objects.requireNonNull(signature, "Signature to be verified cannot be null."); + return ensureValidKeyAvailable().flatMap(available -> { if (!available) { - return implClient.verifyDataAsync(algorithm, data, signature, context); + return cryptographyServiceClient.verifyData(algorithm, data, signature, context); } - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.VERIFY)) { + if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.VERIFY)) { return Mono.error(LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format( - "Verify operation is not allowed for key with id: %s", key.getId())))); + "Verify operation is not allowed for key with id: %s", this.key.getId())))); } - return localKeyCryptographyClient.verifyDataAsync(algorithm, data, signature, key, context); + return localKeyCryptographyClient.verifyDataAsync(algorithm, data, signature, context, key); }); } + private void unpackAndValidateId(String keyId) { + if (CoreUtils.isNullOrEmpty(keyId)) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("'keyId' cannot be null or empty.")); + } + + try { + URL url = new URL(keyId); + String[] tokens = url.getPath().split("/"); + String endpoint = url.getProtocol() + "://" + url.getHost(); + + if (url.getPort() != -1) { + endpoint += ":" + url.getPort(); + } + + String keyName = (tokens.length >= 3 ? tokens[2] : null); + this.keyCollection = (tokens.length >= 2 ? tokens[1] : null); + + if (Strings.isNullOrEmpty(endpoint)) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Key endpoint in key identifier is invalid.")); + } else if (Strings.isNullOrEmpty(keyName)) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Key name in key identifier is invalid.")); + } + } catch (MalformedURLException e) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException("The key identifier is malformed.", e)); + } + } + + private boolean checkKeyPermissions(List operations, KeyOperation keyOperation) { + return operations.contains(keyOperation); + } + private Mono ensureValidKeyAvailable() { boolean keyNotAvailable = (key == null && keyCollection != null); boolean keyNotValid = (key != null && !key.isValid()); if (keyNotAvailable || keyNotValid) { - if (keyCollection.equals(CryptographyClientImpl.SECRETS_COLLECTION)) { + if (keyCollection.equals(SECRETS_COLLECTION)) { return getSecretKey().map(jsonWebKey -> { key = (jsonWebKey); if (key.isValid()) { - if (localKeyCryptographyClient == null) { - localKeyCryptographyClient = initializeCryptoClient(key, implClient); - } - + initializeCryptoClients(); return true; } else { return false; @@ -934,10 +1003,7 @@ private Mono ensureValidKeyAvailable() { key = (keyVaultKey.getKey()); if (key.isValid()) { - if (localKeyCryptographyClient == null) { - localKeyCryptographyClient = initializeCryptoClient(key, implClient); - } - + initializeCryptoClients(); return true; } else { return false; @@ -949,7 +1015,11 @@ private Mono ensureValidKeyAvailable() { } } - CryptographyClientImpl getImplClient() { - return implClient; + CryptographyServiceClient getCryptographyServiceClient() { + return cryptographyServiceClient; + } + + void setCryptographyServiceClient(CryptographyServiceClient serviceClient) { + this.cryptographyServiceClient = serviceClient; } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java index 8d167066d61a7..80ae53e2f5821 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClient.java @@ -10,7 +10,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService; import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; @@ -23,17 +22,9 @@ import com.azure.security.keyvault.keys.cryptography.models.UnwrapResult; import com.azure.security.keyvault.keys.cryptography.models.VerifyResult; import com.azure.security.keyvault.keys.cryptography.models.WrapResult; -import com.azure.security.keyvault.keys.models.JsonWebKey; -import com.azure.security.keyvault.keys.models.KeyOperation; import com.azure.security.keyvault.keys.models.KeyVaultKey; import reactor.core.publisher.Mono; -import java.util.Objects; - -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.checkKeyPermissions; -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.initializeCryptoClient; -import static com.azure.security.keyvault.keys.cryptography.CryptographyClientImpl.unpackAndValidateId; - /** * The {@link CryptographyClient} provides synchronous methods to perform cryptographic operations using asymmetric and @@ -63,60 +54,15 @@ */ @ServiceClient(builder = CryptographyClientBuilder.class, serviceInterfaces = CryptographyService.class) public class CryptographyClient { - private static final ClientLogger LOGGER = new ClientLogger(CryptographyClient.class); - - private final String keyCollection; - private final HttpPipeline pipeline; - - private LocalKeyCryptographyClient localKeyCryptographyClient; - - final CryptographyClientImpl implClient; - final String keyId; - - JsonWebKey key; + private final CryptographyAsyncClient client; /** * Creates a {@link CryptographyClient} that uses a given {@link HttpPipeline pipeline} to service requests. * - * @param keyId The Azure Key Vault key identifier to use for cryptography operations. - * @param pipeline {@link HttpPipeline} that the HTTP requests and responses flow through. - * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. - */ - CryptographyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { - this.keyCollection = unpackAndValidateId(keyId); - this.keyId = keyId; - this.pipeline = pipeline; - this.implClient = new CryptographyClientImpl(keyId, pipeline, version); - this.key = null; - } - - /** - * Creates a {@link CryptographyAsyncClient} that uses a {@link JsonWebKey} to perform local cryptography - * operations. - * - * @param jsonWebKey The {@link JsonWebKey} to use for local cryptography operations. + * @param client The {@link CryptographyAsyncClient} that the client routes its request through. */ - CryptographyClient(JsonWebKey jsonWebKey) { - Objects.requireNonNull(jsonWebKey, "The JSON Web Key is required."); - - if (!jsonWebKey.isValid()) { - throw new IllegalArgumentException("The JSON Web Key is not valid."); - } - - if (jsonWebKey.getKeyOps() == null) { - throw new IllegalArgumentException("The JSON Web Key's key operations property is not configured."); - } - - if (jsonWebKey.getKeyType() == null) { - throw new IllegalArgumentException("The JSON Web Key's key type property is not configured."); - } - - this.keyCollection = null; - this.key = jsonWebKey; - this.keyId = jsonWebKey.getId(); - this.pipeline = null; - this.implClient = null; - this.localKeyCryptographyClient = initializeCryptoClient(key, null); + CryptographyClient(CryptographyAsyncClient client) { + this.client = client; } /** @@ -124,8 +70,8 @@ public class CryptographyClient { * the {@code keys/get} permission for non-local operations. * *

Code Samples

- *

Gets the configured key in the client and prints out the returned key details when a response has been - * received.

+ *

Gets the configured key in the client. Subscribes to the call asynchronously and prints out the returned key + * details when a response has been received.

* * *
@@ -149,8 +95,8 @@ public KeyVaultKey getKey() {
      * the {@code keys/get} permission for non-local operations.
      *
      * 

Code Samples

- *

Gets the configured key in the client and prints out the returned key details when a response has been - * received.

+ *

Gets the configured key in the client. Subscribes to the call asynchronously and prints out the returned key + * details when a response has been received.

* * *
@@ -170,25 +116,11 @@ public KeyVaultKey getKey() {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getKeyWithResponse(Context context) {
-        if (implClient != null) {
-            return implClient.getKey(context);
-        } else {
-            throw LOGGER.logExceptionAsError(
-                new UnsupportedOperationException("Operation not supported when in operating local-only mode"));
-        }
-    }
-
-    JsonWebKey getSecretKey() {
-        try {
-            return implClient.getSecretKey(Context.NONE).getValue();
-        } catch (RuntimeException e) {
-            throw LOGGER.logExceptionAsError(e);
-        }
+        return client.getKeyWithResponse(context).block();
     }
 
     /**
-     * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports
-     * a
+     * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports a
      * single block of data, the size of which is dependent on the target key and the encryption algorithm to be used.
      * The encrypt operation is supported for both symmetric keys and asymmetric keys. In case of asymmetric keys, the
      * public portion of the key is used for encryption. This operation requires the {@code keys/encrypt} permission
@@ -208,10 +140,10 @@ JsonWebKey getSecretKey() {
      * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Encrypts the content and prints out the encrypted content details when a response has been received.

+ *

Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when + * a response has been received.

* - * + * *
      * byte[] plaintext = new byte[100];
      * new Random(0x1234567L).nextBytes(plaintext);
@@ -240,8 +172,7 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext) {
 
     /**
      * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports
-     * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be
-     * used.
+     * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used.
      * The encrypt operation is supported for both symmetric keys and asymmetric keys. In case of asymmetric keys, the
      * public portion of the key is used for encryption. This operation requires the {@code keys/encrypt} permission
      * for non-local operations.
@@ -260,10 +191,10 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext) {
      * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Encrypts the content prints out the encrypted content details when a response has been received.

+ *

Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when + * a response has been received.

* - * + * *
      * byte[] plaintextToEncrypt = new byte[100];
      * new Random(0x1234567L).nextBytes(plaintextToEncrypt);
@@ -274,8 +205,7 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext) {
      * System.out.printf("Received encrypted content of length: %d, with algorithm: %s.%n",
      *     encryptionResult.getCipherText().length, encryptionResult.getAlgorithm());
      * 
- * + * * * @param algorithm The algorithm to be used for encryption. * @param plaintext The content to be encrypted. @@ -290,24 +220,12 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext) { */ @ServiceMethod(returns = ReturnType.SINGLE) public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.encrypt(algorithm, plaintext, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.ENCRYPT)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Encrypt operation is missing permission/not supported for key with id: %s", - key.getId()))); - } - - return localKeyCryptographyClient.encrypt(algorithm, plaintext, key, context); + return client.encrypt(algorithm, plaintext, context).block(); } /** * Encrypts an arbitrary sequence of bytes using the configured key. Note that the encrypt operation only supports - * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be - * used. + * a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. * The encrypt operation is supported for both symmetric keys and asymmetric keys. In case of asymmetric keys, the * public portion of the key is used for encryption. This operation requires the {@code keys/encrypt} permission * for non-local operations. @@ -326,11 +244,10 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Co * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Encrypts the content prints out the encrypted content details when a response has been received.

+ *

Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when + * a response has been received.

* - * + * *
      * byte[] myPlaintext = new byte[100];
      * new Random(0x1234567L).nextBytes(myPlaintext);
@@ -359,24 +276,12 @@ public EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Co
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public EncryptResult encrypt(EncryptParameters encryptParameters, Context context) {
-        if (!ensureValidKeyAvailable()) {
-            return implClient.encrypt(encryptParameters, context);
-        }
-
-        if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.ENCRYPT)) {
-            throw LOGGER.logExceptionAsError(
-                new UnsupportedOperationException(
-                    String.format("Encrypt operation is missing permission/not supported for key with id: %s",
-                        key.getId())));
-        }
-
-        return localKeyCryptographyClient.encrypt(encryptParameters, key, context);
+        return client.encrypt(encryptParameters, context).block();
     }
 
     /**
      * Decrypts a single block of encrypted data using the configured key and specified algorithm. Note that only a
-     * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm
-     * to
+     * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to
      * be used. The decrypt operation is supported for both asymmetric and symmetric keys. This operation requires
      * the {@code keys/decrypt} permission for non-local operations.
      *
@@ -394,11 +299,10 @@ public EncryptResult encrypt(EncryptParameters encryptParameters, Context contex
      * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Decrypts the encrypted content prints out the decrypted content details when a response has been - * received.

+ *

Decrypts the encrypted content. Subscribes to the call asynchronously and prints out the decrypted content + * details when a response has been received.

* - * + * *
      * byte[] ciphertext = new byte[100];
      * new Random(0x1234567L).nextBytes(ciphertext);
@@ -412,8 +316,7 @@ public EncryptResult encrypt(EncryptParameters encryptParameters, Context contex
      * @param algorithm The algorithm to be used for decryption.
      * @param ciphertext The content to be decrypted. Microsoft recommends you not use CBC without first ensuring the
      * integrity of the ciphertext using an HMAC, for example.
-     * See Timing vulnerabilities
-     * with CBC-mode symmetric decryption using padding for more information.
+     * See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
      *
      * @return The {@link DecryptResult} whose {@link DecryptResult#getPlainText() plain text} contains the decrypted
      * content.
@@ -429,8 +332,7 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext) {
 
     /**
      * Decrypts a single block of encrypted data using the configured key and specified algorithm. Note that only a
-     * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm
-     * to
+     * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to
      * be used. The decrypt operation is supported for both asymmetric and symmetric keys. This operation requires
      * the {@code keys/decrypt} permission for non-local operations.
      *
@@ -448,11 +350,10 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext) {
      * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Decrypts the encrypted content prints out the decrypted content details when a response has been - * received.

+ *

Decrypts the encrypted content. Subscribes to the call asynchronously and prints out the decrypted content + * details when a response has been received.

* - * + * *
      * byte[] ciphertextToDecrypt = new byte[100];
      * new Random(0x1234567L).nextBytes(ciphertextToDecrypt);
@@ -462,14 +363,12 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext) {
      *
      * System.out.printf("Received decrypted content of length: %d.%n", decryptionResult.getPlainText().length);
      * 
- * + * * * @param algorithm The algorithm to be used for decryption. * @param ciphertext The content to be decrypted. Microsoft recommends you not use CBC without first ensuring the * integrity of the ciphertext using an HMAC, for example. - * See Timing vulnerabilities - * with CBC-mode symmetric decryption using padding for more information. + * See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information. * @param context Additional context that is passed through the {@link HttpPipeline} during the service call. * * @return The {@link DecryptResult} whose {@link DecryptResult#getPlainText() plain text} contains the decrypted @@ -481,23 +380,12 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext) { */ @ServiceMethod(returns = ReturnType.SINGLE) public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.decrypt(algorithm, ciphertext, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.DECRYPT)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Decrypt operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.decrypt(algorithm, ciphertext, key, context); + return client.decrypt(algorithm, ciphertext, context).block(); } /** * Decrypts a single block of encrypted data using the configured key and specified algorithm. Note that only a - * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm - * to + * single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to * be used. The decrypt operation is supported for both asymmetric and symmetric keys. This operation requires * the {@code keys/decrypt} permission for non-local operations. * @@ -515,12 +403,10 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, C * {@link EncryptionAlgorithm#A256GCM A256GCM}.

* *

Code Samples

- *

Decrypts the encrypted content prints out the decrypted content details when a response has been - * received.

+ *

Decrypts the encrypted content. Subscribes to the call asynchronously and prints out the decrypted content + * details when a response has been received.

* - * + * *
      * byte[] myCiphertext = new byte[100];
      * new Random(0x1234567L).nextBytes(myCiphertext);
@@ -538,8 +424,7 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, C
      *
      * @param decryptParameters The parameters to use in the decryption operation. Microsoft recommends you not use CBC
      * without first ensuring the integrity of the ciphertext using an HMAC, for example.
-     * See Timing vulnerabilities
-     * with CBC-mode symmetric decryption using padding for more information.
+     * See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
      * @param context Additional context that is passed through the {@link HttpPipeline} during the service call.
      *
      * @return The {@link DecryptResult} whose {@link DecryptResult#getPlainText() plain text} contains the decrypted
@@ -551,17 +436,7 @@ public DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, C
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public DecryptResult decrypt(DecryptParameters decryptParameters, Context context) {
-        if (!ensureValidKeyAvailable()) {
-            return implClient.decrypt(decryptParameters, context);
-        }
-
-        if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.DECRYPT)) {
-            throw LOGGER.logExceptionAsError(
-                new UnsupportedOperationException(
-                    String.format("Decrypt operation is not allowed for key with id: %s", key.getId())));
-        }
-
-        return localKeyCryptographyClient.decrypt(decryptParameters, key, context);
+        return client.decrypt(decryptParameters, context).block();
     }
 
     /**
@@ -577,7 +452,8 @@ public DecryptResult decrypt(DecryptParameters decryptParameters, Context contex
      * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Sings the digest prints out the signature details when a response has been received.

+ *

Sings the digest. Subscribes to the call asynchronously and prints out the signature details when a response + * has been received.

* * *
@@ -605,7 +481,7 @@ public DecryptResult decrypt(DecryptParameters decryptParameters, Context contex
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public SignResult sign(SignatureAlgorithm algorithm, byte[] digest) {
-        return sign(algorithm, digest, Context.NONE);
+        return client.sign(algorithm, digest, Context.NONE).block();
     }
 
     /**
@@ -621,10 +497,10 @@ public SignResult sign(SignatureAlgorithm algorithm, byte[] digest) {
      * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Sings the digest prints out the signature details when a response has been received.

+ *

Sings the digest. Subscribes to the call asynchronously and prints out the signature details when a response + * has been received.

* - * + * *
      * byte[] dataToVerify = new byte[100];
      * new Random(0x1234567L).nextBytes(dataToVerify);
@@ -638,8 +514,7 @@ public SignResult sign(SignatureAlgorithm algorithm, byte[] digest) {
      * System.out.printf("Received signature of length: %d, with algorithm: %s.%n", signResponse.getSignature().length,
      *     signResponse.getAlgorithm());
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param digest The content from which signature is to be created. @@ -653,17 +528,7 @@ public SignResult sign(SignatureAlgorithm algorithm, byte[] digest) { */ @ServiceMethod(returns = ReturnType.SINGLE) public SignResult sign(SignatureAlgorithm algorithm, byte[] digest, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.sign(algorithm, digest, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.SIGN)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Sign operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.sign(algorithm, digest, key, context); + return client.sign(algorithm, digest, context).block(); } /** @@ -680,11 +545,10 @@ public SignResult sign(SignatureAlgorithm algorithm, byte[] digest, Context cont * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Verifies the signature against the specified digest prints out the verification details when a response has - * been received.

+ *

Verifies the signature against the specified digest. Subscribes to the call asynchronously and prints out the + * verification details when a response has been received.

* - * + * *
      * byte[] myData = new byte[100];
      * new Random(0x1234567L).nextBytes(myData);
@@ -697,8 +561,7 @@ public SignResult sign(SignatureAlgorithm algorithm, byte[] digest, Context cont
      *
      * System.out.printf("Verification status: %s.%n", verifyResult.isValid());
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param digest The content from which signature was created. @@ -729,11 +592,10 @@ public VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] s * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Verifies the signature against the specified digest prints out the verification details when a response has - * been received.

+ *

Verifies the signature against the specified digest. Subscribes to the call asynchronously and prints out the + * verification details when a response has been received.

* - * + * *
      * byte[] dataBytes = new byte[100];
      * new Random(0x1234567L).nextBytes(dataBytes);
@@ -747,8 +609,7 @@ public VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] s
      *
      * System.out.printf("Verification status: %s.%n", verifyResponse.isValid());
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param digest The content from which signature was created. @@ -763,17 +624,7 @@ public VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] s */ @ServiceMethod(returns = ReturnType.SINGLE) public VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.verify(algorithm, digest, signature, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.VERIFY)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Verify operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.verify(algorithm, digest, signature, key, context); + return client.verify(algorithm, digest, signature, context).block(); } /** @@ -790,7 +641,8 @@ public VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] s * {@link EncryptionAlgorithm#A192KW A192KW} and {@link EncryptionAlgorithm#A256KW A256KW}.

* *

Code Samples

- *

Wraps the key content prints out the wrapped key details when a response has been received.

+ *

Wraps the key content. Subscribes to the call asynchronously and prints out the wrapped key details when a + * response has been received.

* * *
@@ -833,10 +685,10 @@ public WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) {
      * {@link EncryptionAlgorithm#A192KW A192KW} and {@link EncryptionAlgorithm#A256KW A256KW}.

* *

Code Samples

- *

Wraps the key content prints out the wrapped key details when a response has been received.

+ *

Wraps the key content. Subscribes to the call asynchronously and prints out the wrapped key details when a + * response has been received.

* - * + * *
      * byte[] keyToWrap = new byte[100];
      * new Random(0x1234567L).nextBytes(keyToWrap);
@@ -847,8 +699,7 @@ public WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) {
      * System.out.printf("Received encrypted key of length: %d, with algorithm: %s.%n",
      *     keyWrapResult.getEncryptedKey().length, keyWrapResult.getAlgorithm());
      * 
- * + * * * @param algorithm The encryption algorithm to use for wrapping the key. * @param key The key content to be wrapped. @@ -863,23 +714,12 @@ public WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { */ @ServiceMethod(returns = ReturnType.SINGLE) public WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.wrapKey(algorithm, key, context); - } - - if (!checkKeyPermissions(this.key.getKeyOps(), KeyOperation.WRAP_KEY)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Wrap key operation is not allowed for key with id: %s", this.key.getId()))); - } - - return localKeyCryptographyClient.wrapKey(algorithm, key, this.key, context); + return client.wrapKey(algorithm, key, context).block(); } /** * Unwraps a symmetric key using the configured key that was initially used for wrapping that key. This operation - * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap. - * This + * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap. This * operation requires the {@code keys/unwrapKey} permission for non-local operations. * *

The {@link KeyWrapAlgorithm wrap algorithm} indicates the type of algorithm to use for unwrapping the @@ -891,10 +731,10 @@ public WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context contex * {@link KeyWrapAlgorithm#A192KW A192KW} and {@link KeyWrapAlgorithm#A256KW A256KW}.

* *

Code Samples

- *

Unwraps the key content prints out the unwrapped key details when a response has been received.

+ *

Unwraps the key content. Subscribes to the call asynchronously and prints out the unwrapped key details when + * a response has been received.

* - * + * *
      * byte[] keyContent = new byte[100];
      * new Random(0x1234567L).nextBytes(keyContent);
@@ -925,8 +765,7 @@ public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) {
 
     /**
      * Unwraps a symmetric key using the configured key that was initially used for wrapping that key. This operation
-     * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap.
-     * This
+     * is the reverse of the wrap operation. The unwrap operation supports asymmetric and symmetric keys to unwrap. This
      * operation requires the {@code keys/unwrapKey} permission for non-local operations.
      *
      * 

The {@link KeyWrapAlgorithm wrap algorithm} indicates the type of algorithm to use for unwrapping the @@ -938,10 +777,10 @@ public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) { * {@link KeyWrapAlgorithm#A192KW A192KW} and {@link KeyWrapAlgorithm#A256KW A256KW}.

* *

Code Samples

- *

Unwraps the key content prints out the unwrapped key details when a response has been received.

+ *

Unwraps the key content. Subscribes to the call asynchronously and prints out the unwrapped key details when + * a response has been received.

* - * + * *
      * byte[] keyContentToWrap = new byte[100];
      * new Random(0x1234567L).nextBytes(keyContentToWrap);
@@ -954,9 +793,7 @@ public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) {
      *
      * System.out.printf("Received key of length %d", unwrapKeyResponse.getKey().length);
      * 
- * + * * * @param algorithm The encryption algorithm to use for wrapping the key. * @param encryptedKey The encrypted key content to unwrap. @@ -971,17 +808,7 @@ public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) { */ @ServiceMethod(returns = ReturnType.SINGLE) public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.unwrapKey(algorithm, encryptedKey, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.UNWRAP_KEY)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Unwrap key operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.unwrapKey(algorithm, encryptedKey, key, context); + return client.unwrapKey(algorithm, encryptedKey, context).block(); } /** @@ -997,10 +824,10 @@ public UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, C * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Signs the raw data prints out the signature details when a response has been received.

+ *

Signs the raw data. Subscribes to the call asynchronously and prints out the signature details when a + * response has been received.

* - * + * *
      * byte[] data = new byte[100];
      * new Random(0x1234567L).nextBytes(data);
@@ -1039,10 +866,10 @@ public SignResult signData(SignatureAlgorithm algorithm, byte[] data) {
      * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Signs the raw data prints out the signature details when a response has been received.

+ *

Signs the raw data. Subscribes to the call asynchronously and prints out the signature details when a + * response has been received.

* - * + * *
      * byte[] plainTextData = new byte[100];
      * new Random(0x1234567L).nextBytes(plainTextData);
@@ -1052,8 +879,7 @@ public SignResult signData(SignatureAlgorithm algorithm, byte[] data) {
      * System.out.printf("Received signature of length: %d, with algorithm: %s.%n",
      *     signingResult.getSignature().length, new Context("key1", "value1"));
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param data The content from which signature is to be created. @@ -1067,17 +893,7 @@ public SignResult signData(SignatureAlgorithm algorithm, byte[] data) { */ @ServiceMethod(returns = ReturnType.SINGLE) public SignResult signData(SignatureAlgorithm algorithm, byte[] data, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.signData(algorithm, data, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.SIGN)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Sign operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.signData(algorithm, data, key, context); + return client.signData(algorithm, data, context).block(); } /** @@ -1094,11 +910,10 @@ public SignResult signData(SignatureAlgorithm algorithm, byte[] data, Context co * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Verifies the signature against the raw data prints out the verification details when a response has been - * received.

+ *

Verifies the signature against the raw data. Subscribes to the call asynchronously and prints out the + * verification details when a response has been received.

* - * + * *
      * byte[] myData = new byte[100];
      * new Random(0x1234567L).nextBytes(myData);
@@ -1108,9 +923,7 @@ public SignResult signData(SignatureAlgorithm algorithm, byte[] data, Context co
      *
      * System.out.printf("Verification status: %s.%n", verifyResult.isValid());
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param data The raw content against which signature is to be verified. @@ -1141,12 +954,10 @@ public VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] * {@link SignatureAlgorithm#RS384 RS384}, and {@link SignatureAlgorithm#RS512 RS512}.

* *

Code Samples

- *

Verifies the signature against the raw data prints out the verification details when a response has been - * received.

+ *

Verifies the signature against the raw data. Subscribes to the call asynchronously and prints out the + * verification details when a response has been received.

* - * + * *
      * byte[] dataToVerify = new byte[100];
      * new Random(0x1234567L).nextBytes(dataToVerify);
@@ -1157,9 +968,7 @@ public VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[]
      *
      * System.out.printf("Verification status: %s.%n", verificationResult.isValid());
      * 
- * + * * * @param algorithm The algorithm to use for signing. * @param data The raw content against which signature is to be verified. @@ -1174,45 +983,10 @@ public VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] */ @ServiceMethod(returns = ReturnType.SINGLE) public VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context) { - if (!ensureValidKeyAvailable()) { - return implClient.verifyData(algorithm, data, signature, context); - } - - if (!checkKeyPermissions(key.getKeyOps(), KeyOperation.VERIFY)) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException( - String.format("Verify operation is not allowed for key with id: %s", key.getId()))); - } - - return localKeyCryptographyClient.verifyData(algorithm, data, signature, key, context); - } - - private boolean ensureValidKeyAvailable() { - boolean keyNotAvailable = (key == null && keyCollection != null); - boolean keyNotValid = (key != null && !key.isValid()); - - if (keyNotAvailable || keyNotValid) { - if (keyCollection.equals(CryptographyClientImpl.SECRETS_COLLECTION)) { - key = getSecretKey(); - } else { - key = getKey().getKey(); - } - - if (key.isValid()) { - if (localKeyCryptographyClient == null) { - localKeyCryptographyClient = initializeCryptoClient(key, implClient); - } - - return true; - } else { - return false; - } - } else { - return true; - } + return client.verifyData(algorithm, data, signature, context).block(); } - CryptographyClientImpl getImplClient() { - return implClient; + CryptographyServiceClient getServiceClient() { + return client.getCryptographyServiceClient(); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java index 312347aabed7c..8cf2914f9aa7a 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilder.java @@ -173,32 +173,7 @@ public CryptographyClientBuilder() { * and {@link #retryPolicy(RetryPolicy)} have been set. */ public CryptographyClient buildClient() { - if (jsonWebKey == null) { - if (Strings.isNullOrEmpty(keyId)) { - throw LOGGER.logExceptionAsError(new IllegalStateException( - "An Azure Key Vault key identifier is required to build the cryptography client if a JSON Web Key" - + " is not provided.")); - } - - CryptographyServiceVersion serviceVersion = - version != null ? version : CryptographyServiceVersion.getLatest(); - - if (pipeline != null) { - return new CryptographyClient(keyId, pipeline, serviceVersion); - } - - if (credential == null) { - throw LOGGER.logExceptionAsError(new IllegalStateException( - "Azure Key Vault credentials are required to build the cryptography client if a JSON Web Key is not" - + " provided.")); - } - - HttpPipeline pipeline = setupPipeline(); - - return new CryptographyClient(keyId, pipeline, serviceVersion); - } else { - return new CryptographyClient(jsonWebKey); - } + return new CryptographyClient(buildAsyncClient()); } /** @@ -230,8 +205,7 @@ public CryptographyAsyncClient buildAsyncClient() { + " is not provided.")); } - CryptographyServiceVersion serviceVersion = - version != null ? version : CryptographyServiceVersion.getLatest(); + CryptographyServiceVersion serviceVersion = version != null ? version : CryptographyServiceVersion.getLatest(); if (pipeline != null) { return new CryptographyAsyncClient(keyId, pipeline, serviceVersion); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientImpl.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientImpl.java deleted file mode 100644 index 73a88ae428278..0000000000000 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientImpl.java +++ /dev/null @@ -1,635 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.security.keyvault.keys.cryptography; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService; -import com.azure.security.keyvault.keys.cryptography.implementation.KeyOperationParameters; -import com.azure.security.keyvault.keys.cryptography.implementation.KeyOperationResult; -import com.azure.security.keyvault.keys.cryptography.implementation.KeySignRequest; -import com.azure.security.keyvault.keys.cryptography.implementation.KeyVerifyRequest; -import com.azure.security.keyvault.keys.cryptography.implementation.KeyVerifyResponse; -import com.azure.security.keyvault.keys.cryptography.implementation.KeyWrapUnwrapRequest; -import com.azure.security.keyvault.keys.cryptography.implementation.SecretKey; -import com.azure.security.keyvault.keys.cryptography.implementation.SecretRequestAttributes; -import com.azure.security.keyvault.keys.cryptography.implementation.SecretRequestParameters; -import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; -import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; -import com.azure.security.keyvault.keys.cryptography.models.EncryptParameters; -import com.azure.security.keyvault.keys.cryptography.models.EncryptResult; -import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.SignResult; -import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; -import com.azure.security.keyvault.keys.cryptography.models.UnwrapResult; -import com.azure.security.keyvault.keys.cryptography.models.VerifyResult; -import com.azure.security.keyvault.keys.cryptography.models.WrapResult; -import com.azure.security.keyvault.keys.models.JsonWebKey; -import com.azure.security.keyvault.keys.models.KeyOperation; -import com.azure.security.keyvault.keys.models.KeyType; -import com.azure.security.keyvault.keys.models.KeyVaultKey; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import reactor.core.publisher.Mono; - -import java.net.MalformedURLException; -import java.net.URL; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Base64; -import java.util.List; -import java.util.Objects; - -import static com.azure.security.keyvault.keys.models.KeyType.EC; -import static com.azure.security.keyvault.keys.models.KeyType.EC_HSM; -import static com.azure.security.keyvault.keys.models.KeyType.OCT; -import static com.azure.security.keyvault.keys.models.KeyType.OCT_HSM; -import static com.azure.security.keyvault.keys.models.KeyType.RSA; -import static com.azure.security.keyvault.keys.models.KeyType.RSA_HSM; - -class CryptographyClientImpl { - private static final ClientLogger LOGGER = new ClientLogger(CryptographyClientImpl.class); - private static final ObjectMapper MAPPER = new ObjectMapper(); - private static final String HTTP_REST_PROXY_SYNC_PROXY_ENABLE = "com.azure.core.http.restproxy.syncproxy.enable"; - - static final String SECRETS_COLLECTION = "secrets"; - - private final CryptographyService service; - private final String serviceVersion; - private final String keyId; - - private String vaultUrl; - private String keyName; - private String version; - - static final String ACCEPT_LANGUAGE = "en-US"; - static final String CONTENT_TYPE_HEADER_VALUE = "application/json"; - - - CryptographyClientImpl(String keyId, HttpPipeline pipeline, CryptographyServiceVersion serviceVersion) { - Objects.requireNonNull(keyId); - - unpackId(keyId); - - this.keyId = keyId; - this.service = RestProxy.create(CryptographyService.class, pipeline); - this.serviceVersion = serviceVersion.getVersion(); - } - - String getVaultUrl() { - return vaultUrl; - } - - Mono getKeyIdAsync() { - return Mono.defer(() -> Mono.just(this.keyId)); - } - - String getKeyId() { - return this.keyId; - } - - Mono> getKeyAsync(Context context) { - if (version == null) { - version = ""; - } - - return getKeyAsync(keyName, version, context); - } - - Response getKey(Context context) { - if (version == null) { - version = ""; - } - - return getKey(keyName, version, context); - } - - private Mono> getKeyAsync(String name, String version, Context context) { - return service.getKeyAsync(vaultUrl, name, version, serviceVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Retrieving key - {}", name)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved key - {}", response.getValue().getName())) - .doOnError(error -> LOGGER.warning("Failed to get key - {}", name, error)); - } - - private Response getKey(String name, String version, Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.getKey(vaultUrl, name, version, serviceVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - - Mono> getSecretKeyAsync(Context context) { - return service.getSecretAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, - context) - .doOnRequest(ignored -> LOGGER.verbose("Retrieving key - {}", keyName)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved key - {}", response.getValue().getName())) - .doOnError(error -> LOGGER.warning("Failed to get key - {}", keyName, error)) - .flatMap((stringResponse -> { - try { - return Mono.just(new SimpleResponse<>(stringResponse.getRequest(), - stringResponse.getStatusCode(), - stringResponse.getHeaders(), transformSecretKey(stringResponse.getValue()))); - } catch (JsonProcessingException e) { - return Mono.error(e); - } - })); - } - - Response getSecretKey(Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response secretKeyResponse = - service.getSecret(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, - context); - - try { - return new SimpleResponse<>(secretKeyResponse.getRequest(), secretKeyResponse.getStatusCode(), - secretKeyResponse.getHeaders(), transformSecretKey(secretKeyResponse.getValue())); - } catch (JsonProcessingException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - Mono> setSecretKeyAsync(SecretKey secret, Context context) { - Objects.requireNonNull(secret, "The secret key cannot be null."); - - SecretRequestParameters parameters = new SecretRequestParameters() - .setValue(secret.getValue()) - .setTags(secret.getProperties().getTags()) - .setContentType(secret.getProperties().getContentType()) - .setSecretAttributes(new SecretRequestAttributes(secret.getProperties())); - - return service.setSecretAsync(vaultUrl, secret.getName(), serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Setting secret - {}", secret.getName())) - .doOnSuccess(response -> LOGGER.verbose("Set secret - {}", response.getValue().getName())) - .doOnError(error -> LOGGER.warning("Failed to set secret - {}", secret.getName(), error)); - } - - Response setSecretKey(SecretKey secret, Context context) { - Objects.requireNonNull(secret, "The Secret input parameter cannot be null."); - - SecretRequestParameters parameters = new SecretRequestParameters() - .setValue(secret.getValue()) - .setTags(secret.getProperties().getTags()) - .setContentType(secret.getProperties().getContentType()) - .setSecretAttributes(new SecretRequestAttributes(secret.getProperties())); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.setSecret(vaultUrl, secret.getName(), serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context); - } - - JsonWebKey transformSecretKey(SecretKey secretKey) throws JsonProcessingException { - ObjectNode rootNode = MAPPER.createObjectNode(); - ArrayNode a = MAPPER.createArrayNode(); - - a.add(KeyOperation.WRAP_KEY.toString()); - a.add(KeyOperation.UNWRAP_KEY.toString()); - a.add(KeyOperation.ENCRYPT.toString()); - a.add(KeyOperation.DECRYPT.toString()); - - rootNode.put("k", Base64.getUrlDecoder().decode(secretKey.getValue())); - rootNode.put("kid", this.keyId); - rootNode.put("kty", KeyType.OCT.toString()); - rootNode.set("key_ops", a); - - return MAPPER.treeToValue(rootNode, JsonWebKey.class); - } - - Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(algorithm) - .setValue(plaintext); - - return encryptAsync(parameters, context); - } - - Mono encryptAsync(EncryptParameters encryptParameters, Context context) { - Objects.requireNonNull(encryptParameters, "Encrypt parameters cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(encryptParameters.getAlgorithm()) - .setValue(encryptParameters.getPlainText()) - .setIv(encryptParameters.getIv()) - .setAdditionalAuthenticatedData(encryptParameters.getAdditionalAuthenticatedData()); - - return encryptAsync(parameters, context); - } - - private Mono encryptAsync(KeyOperationParameters keyOperationParameters, Context context) { - EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); - - return service.encryptAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, keyOperationParameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Encrypting content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved encrypted content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to encrypt content with algorithm - {}", algorithm, error)) - .map(keyOperationResultResponse -> { - KeyOperationResult keyOperationResult = keyOperationResultResponse.getValue(); - - return new EncryptResult(keyOperationResult.getResult(), algorithm, keyId, - keyOperationResult.getIv(), keyOperationResult.getAuthenticationTag(), - keyOperationResult.getAdditionalAuthenticatedData()); - }); - } - - EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(algorithm) - .setValue(plaintext); - - return encrypt(parameters, context); - } - - EncryptResult encrypt(EncryptParameters encryptParameters, Context context) { - Objects.requireNonNull(encryptParameters, "Encrypt parameters cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(encryptParameters.getAlgorithm()) - .setValue(encryptParameters.getPlainText()) - .setIv(encryptParameters.getIv()) - .setAdditionalAuthenticatedData(encryptParameters.getAdditionalAuthenticatedData()); - - return encrypt(parameters, context); - } - - EncryptResult encrypt(KeyOperationParameters keyOperationParameters, Context context) { - EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - Response encryptResult = - service.encrypt(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, keyOperationParameters, - CONTENT_TYPE_HEADER_VALUE, context); - KeyOperationResult keyOperationResult = encryptResult.getValue(); - - return new EncryptResult(keyOperationResult.getResult(), algorithm, keyId, keyOperationResult.getIv(), - keyOperationResult.getAuthenticationTag(), keyOperationResult.getAdditionalAuthenticatedData()); - } - - Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(algorithm) - .setValue(ciphertext); - - return decryptAsync(parameters, context); - } - - Mono decryptAsync(DecryptParameters decryptParameters, Context context) { - Objects.requireNonNull(decryptParameters, "Decrypt parameters cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(decryptParameters.getAlgorithm()) - .setValue(decryptParameters.getCipherText()) - .setIv(decryptParameters.getIv()) - .setAdditionalAuthenticatedData(decryptParameters.getAdditionalAuthenticatedData()) - .setAuthenticationTag(decryptParameters.getAuthenticationTag()); - - return decryptAsync(parameters, context); - } - - private Mono decryptAsync(KeyOperationParameters keyOperationParameters, Context context) { - EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); - - return service.decryptAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, keyOperationParameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Decrypting content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved decrypted content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to decrypt content with algorithm - {}", algorithm, error)) - .flatMap(keyOperationResultResponse -> Mono.just( - new DecryptResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); - } - - DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(algorithm) - .setValue(ciphertext); - - return decrypt(parameters, context); - } - - DecryptResult decrypt(DecryptParameters decryptParameters, Context context) { - Objects.requireNonNull(decryptParameters, "Decrypt parameters cannot be null."); - - KeyOperationParameters parameters = new KeyOperationParameters() - .setAlgorithm(decryptParameters.getAlgorithm()) - .setValue(decryptParameters.getCipherText()) - .setIv(decryptParameters.getIv()) - .setAdditionalAuthenticatedData(decryptParameters.getAdditionalAuthenticatedData()) - .setAuthenticationTag(decryptParameters.getAuthenticationTag()); - - return decrypt(parameters, context); - } - - private DecryptResult decrypt(KeyOperationParameters keyOperationParameters, Context context) { - EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response decryptResult = - service.decrypt(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, keyOperationParameters, - CONTENT_TYPE_HEADER_VALUE, context); - - return new DecryptResult(decryptResult.getValue().getResult(), algorithm, keyId); - } - - Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - - KeySignRequest parameters = new KeySignRequest() - .setAlgorithm(algorithm) - .setValue(digest); - - return service.signAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Signing content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved signed content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to sign content with algorithm - {}", algorithm, error)) - .flatMap(keyOperationResultResponse -> - Mono.just(new SignResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); - } - - SignResult sign(SignatureAlgorithm algorithm, byte[] digest, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - - KeySignRequest parameters = new KeySignRequest() - .setAlgorithm(algorithm) - .setValue(digest); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response signResponse = - service.sign(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context); - - return new SignResult(signResponse.getValue().getResult(), algorithm, keyId); - } - - Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); - - KeyVerifyRequest parameters = new KeyVerifyRequest() - .setAlgorithm(algorithm) - .setDigest(digest) - .setSignature(signature); - - return service.verifyAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Verifying content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved verified content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to verify content with algorithm - {}", algorithm, error)) - .flatMap(response -> Mono.just(new VerifyResult(response.getValue().getValue(), algorithm, keyId))); - } - - VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); - - KeyVerifyRequest parameters = new KeyVerifyRequest() - .setAlgorithm(algorithm) - .setDigest(digest) - .setSignature(signature); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response verifyResult = - service.verify(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context); - - return new VerifyResult(verifyResult.getValue().getValue(), algorithm, keyId); - } - - Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(key, "Key content to be wrapped cannot be null."); - - KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() - .setAlgorithm(algorithm) - .setValue(key); - - return service.wrapKeyAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Wrapping key content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved wrapped key content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to verify content with algorithm - {}", algorithm, error)) - .flatMap(keyOperationResultResponse -> - Mono.just(new WrapResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); - } - - WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(key, "Key content to be wrapped cannot be null."); - - KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() - .setAlgorithm(algorithm) - .setValue(key); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response wrapResponse = - service.wrapKey(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context); - - return new WrapResult(wrapResponse.getValue().getResult(), algorithm, keyId); - } - - Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - - KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() - .setAlgorithm(algorithm) - .setValue(encryptedKey); - - return service.unwrapKeyAsync(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context) - .doOnRequest(ignored -> LOGGER.verbose("Unwrapping key content with algorithm - {}", algorithm)) - .doOnSuccess(response -> LOGGER.verbose("Retrieved unwrapped key content with algorithm - {}", algorithm)) - .doOnError(error -> LOGGER.warning("Failed to unwrap key content with algorithm - {}", algorithm, error)) - .flatMap(response -> Mono.just(new UnwrapResult(response.getValue().getResult(), algorithm, keyId))); - } - - UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - - KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() - .setAlgorithm(algorithm) - .setValue(encryptedKey); - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - Response unwrapResponse = - service.unwrapKey(vaultUrl, keyName, version, serviceVersion, ACCEPT_LANGUAGE, parameters, - CONTENT_TYPE_HEADER_VALUE, context); - - return new UnwrapResult(unwrapResponse.getValue().getResult(), algorithm, keyId); - } - - - Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(data, "Data to be signed cannot be null."); - - try { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - md.update(data); - byte[] digest = md.digest(); - - return signAsync(algorithm, digest, context); - } catch (NoSuchAlgorithmException e) { - return Mono.error(e); - } - } - - SignResult signData(SignatureAlgorithm algorithm, byte[] data, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(data, "Data to be signed cannot be null."); - - try { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - md.update(data); - byte[] digest = md.digest(); - - return sign(algorithm, digest, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(data, "Data to verify cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); - - try { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - md.update(data); - byte[] digest = md.digest(); - - return verifyAsync(algorithm, digest, signature, context); - } catch (NoSuchAlgorithmException e) { - return Mono.error(e); - } - } - - VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(data, "Data to verify cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); - - try { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - md.update(data); - byte[] digest = md.digest(); - - return verify(algorithm, digest, signature, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - private void unpackId(String keyId) { - if (keyId != null && keyId.length() > 0) { - try { - URL url = new URL(keyId); - String[] tokens = url.getPath().split("/"); - this.vaultUrl = url.getProtocol() + "://" + url.getHost(); - - if (url.getPort() != -1) { - this.vaultUrl += ":" + url.getPort(); - } - - this.keyName = (tokens.length >= 3 ? tokens[2] : null); - this.version = (tokens.length >= 4 ? tokens[3] : ""); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - } - - private Context enableSyncRestProxy(Context context) { - return context.addData(HTTP_REST_PROXY_SYNC_PROXY_ENABLE, true); - } - - static String unpackAndValidateId(String keyId) { - if (CoreUtils.isNullOrEmpty(keyId)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'keyId' cannot be null or empty.")); - } - - try { - URL url = new URL(keyId); - String[] tokens = url.getPath().split("/"); - String endpoint = url.getProtocol() + "://" + url.getHost(); - - if (url.getPort() != -1) { - endpoint += ":" + url.getPort(); - } - - String keyName = (tokens.length >= 3 ? tokens[2] : null); - String keyCollection = (tokens.length >= 2 ? tokens[1] : null); - - if (Strings.isNullOrEmpty(endpoint)) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Key endpoint in key identifier is invalid.")); - } else if (Strings.isNullOrEmpty(keyName)) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Key name in key identifier is invalid.")); - } - - return keyCollection; - } catch (MalformedURLException e) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("The key identifier is malformed.", e)); - } - } - - static LocalKeyCryptographyClient initializeCryptoClient(JsonWebKey jsonWebKey, - CryptographyClientImpl implClient) { - if (jsonWebKey.getKeyType().equals(RSA) || jsonWebKey.getKeyType().equals(RSA_HSM)) { - return new RsaKeyCryptographyClient(jsonWebKey, implClient); - } else if (jsonWebKey.getKeyType().equals(EC) || jsonWebKey.getKeyType().equals(EC_HSM)) { - return new EcKeyCryptographyClient(jsonWebKey, implClient); - } else if (jsonWebKey.getKeyType().equals(OCT) || jsonWebKey.getKeyType().equals(OCT_HSM)) { - return new AesKeyCryptographyClient(jsonWebKey, implClient); - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The JSON Web Key type: %s is not supported.", jsonWebKey.getKeyType().toString()))); - } - } - - static boolean checkKeyPermissions(List operations, KeyOperation keyOperation) { - return operations.contains(keyOperation); - } -} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceClient.java new file mode 100644 index 0000000000000..83cbd2639a5ec --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/CryptographyServiceClient.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.security.keyvault.keys.cryptography; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService; +import com.azure.security.keyvault.keys.cryptography.implementation.KeyOperationParameters; +import com.azure.security.keyvault.keys.cryptography.implementation.KeyOperationResult; +import com.azure.security.keyvault.keys.cryptography.implementation.KeySignRequest; +import com.azure.security.keyvault.keys.cryptography.implementation.KeyVerifyRequest; +import com.azure.security.keyvault.keys.cryptography.implementation.KeyWrapUnwrapRequest; +import com.azure.security.keyvault.keys.cryptography.implementation.SecretKey; +import com.azure.security.keyvault.keys.cryptography.implementation.SecretRequestAttributes; +import com.azure.security.keyvault.keys.cryptography.implementation.SecretRequestParameters; +import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; +import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; +import com.azure.security.keyvault.keys.cryptography.models.EncryptParameters; +import com.azure.security.keyvault.keys.cryptography.models.EncryptResult; +import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; +import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; +import com.azure.security.keyvault.keys.cryptography.models.SignResult; +import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; +import com.azure.security.keyvault.keys.cryptography.models.UnwrapResult; +import com.azure.security.keyvault.keys.cryptography.models.VerifyResult; +import com.azure.security.keyvault.keys.cryptography.models.WrapResult; +import com.azure.security.keyvault.keys.models.JsonWebKey; +import com.azure.security.keyvault.keys.models.KeyOperation; +import com.azure.security.keyvault.keys.models.KeyType; +import com.azure.security.keyvault.keys.models.KeyVaultKey; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import reactor.core.publisher.Mono; + +import java.net.MalformedURLException; +import java.net.URL; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; +import java.util.Objects; + +class CryptographyServiceClient { + private static final ClientLogger LOGGER = new ClientLogger(CryptographyServiceClient.class); + private static final ObjectMapper MAPPER = new ObjectMapper(); + + private final CryptographyService service; + private final String keyId; + + private String keyName; + private String vaultUrl; + private String version; + + static final String ACCEPT_LANGUAGE = "en-US"; + static final String CONTENT_TYPE_HEADER_VALUE = "application/json"; + + final String apiVersion; + + CryptographyServiceClient(String keyId, CryptographyService service, CryptographyServiceVersion serviceVersion) { + Objects.requireNonNull(keyId); + unpackId(keyId); + + this.keyId = keyId; + this.service = service; + apiVersion = serviceVersion.getVersion(); + } + + String getVaultUrl() { + return vaultUrl; + } + + Mono> getKey(Context context) { + if (version == null) { + version = ""; + } + + return getKey(keyName, version, context); + } + + private Mono> getKey(String name, String version, Context context) { + context = context == null ? Context.NONE : context; + + return service.getKey(vaultUrl, name, version, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Retrieving key - {}", name)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved key - {}", response.getValue().getName())) + .doOnError(error -> LOGGER.warning("Failed to get key - {}", name, error)); + } + + Mono> getSecretKey(Context context) { + return service.getSecret(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, + context) + .doOnRequest(ignored -> LOGGER.verbose("Retrieving key - {}", keyName)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved key - {}", response.getValue().getName())) + .doOnError(error -> LOGGER.warning("Failed to get key - {}", keyName, error)) + .flatMap((stringResponse -> { + try { + return Mono.just(new SimpleResponse<>(stringResponse.getRequest(), + stringResponse.getStatusCode(), + stringResponse.getHeaders(), transformSecretKey(stringResponse.getValue()))); + } catch (JsonProcessingException e) { + return Mono.error(e); + } + })); + } + + Mono> setSecretKey(SecretKey secret, Context context) { + Objects.requireNonNull(secret, "The Secret input parameter cannot be null."); + + SecretRequestParameters parameters = new SecretRequestParameters() + .setValue(secret.getValue()) + .setTags(secret.getProperties().getTags()) + .setContentType(secret.getProperties().getContentType()) + .setSecretAttributes(new SecretRequestAttributes(secret.getProperties())); + context = context == null ? Context.NONE : context; + + return service.setSecret(vaultUrl, secret.getName(), apiVersion, ACCEPT_LANGUAGE, parameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Setting secret - {}", secret.getName())) + .doOnSuccess(response -> LOGGER.verbose("Set secret - {}", response.getValue().getName())) + .doOnError(error -> LOGGER.warning("Failed to set secret - {}", secret.getName(), error)); + } + + JsonWebKey transformSecretKey(SecretKey secretKey) throws JsonProcessingException { + ObjectNode rootNode = MAPPER.createObjectNode(); + ArrayNode a = MAPPER.createArrayNode(); + + a.add(KeyOperation.WRAP_KEY.toString()); + a.add(KeyOperation.UNWRAP_KEY.toString()); + a.add(KeyOperation.ENCRYPT.toString()); + a.add(KeyOperation.DECRYPT.toString()); + + rootNode.put("k", Base64.getUrlDecoder().decode(secretKey.getValue())); + rootNode.put("kid", this.keyId); + rootNode.put("kty", KeyType.OCT.toString()); + rootNode.set("key_ops", a); + + return MAPPER.treeToValue(rootNode, JsonWebKey.class); + } + + Mono encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(plaintext, "'plaintext' cannot be null."); + + KeyOperationParameters parameters = new KeyOperationParameters() + .setAlgorithm(algorithm) + .setValue(plaintext); + context = context == null ? Context.NONE : context; + + return encrypt(parameters, context); + } + + Mono encrypt(EncryptParameters encryptParameters, Context context) { + Objects.requireNonNull(encryptParameters, "'encryptParameters' cannot be null."); + + KeyOperationParameters parameters = new KeyOperationParameters() + .setAlgorithm(encryptParameters.getAlgorithm()) + .setValue(encryptParameters.getPlainText()) + .setIv(encryptParameters.getIv()) + .setAdditionalAuthenticatedData(encryptParameters.getAdditionalAuthenticatedData()); + context = context == null ? Context.NONE : context; + + return encrypt(parameters, context); + } + + private Mono encrypt(KeyOperationParameters keyOperationParameters, Context context) { + EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); + context = context == null ? Context.NONE : context; + + return service.encrypt(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, keyOperationParameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Encrypting content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved encrypted content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to encrypt content with algorithm - {}", algorithm, error)) + .map(keyOperationResultResponse -> { + KeyOperationResult keyOperationResult = keyOperationResultResponse.getValue(); + + return new EncryptResult(keyOperationResult.getResult(), algorithm, keyId, + keyOperationResult.getIv(), keyOperationResult.getAuthenticationTag(), + keyOperationResult.getAdditionalAuthenticatedData()); + }); + } + + Mono decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context) { + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(ciphertext, "'ciphertext' cannot be null."); + + KeyOperationParameters parameters = new KeyOperationParameters() + .setAlgorithm(algorithm) + .setValue(ciphertext); + context = context == null ? Context.NONE : context; + + return decrypt(parameters, context); + } + + Mono decrypt(DecryptParameters decryptParameters, Context context) { + Objects.requireNonNull(decryptParameters, "'decryptParameters' cannot be null."); + + KeyOperationParameters parameters = new KeyOperationParameters() + .setAlgorithm(decryptParameters.getAlgorithm()) + .setValue(decryptParameters.getCipherText()) + .setIv(decryptParameters.getIv()) + .setAdditionalAuthenticatedData(decryptParameters.getAdditionalAuthenticatedData()) + .setAuthenticationTag(decryptParameters.getAuthenticationTag()); + context = context == null ? Context.NONE : context; + + return decrypt(parameters, context); + } + + private Mono decrypt(KeyOperationParameters keyOperationParameters, Context context) { + Objects.requireNonNull(keyOperationParameters, "'decryptParameters' cannot be null."); + + EncryptionAlgorithm algorithm = keyOperationParameters.getAlgorithm(); + context = context == null ? Context.NONE : context; + + return service.decrypt(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, keyOperationParameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Decrypting content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved decrypted content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to decrypt content with algorithm - {}", algorithm, error)) + .flatMap(keyOperationResultResponse -> Mono.just( + new DecryptResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); + } + + Mono sign(SignatureAlgorithm algorithm, byte[] digest, Context context) { + KeySignRequest parameters = new KeySignRequest() + .setAlgorithm(algorithm) + .setValue(digest); + context = context == null ? Context.NONE : context; + + return service.sign(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, parameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Signing content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved signed content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to sign content with algorithm - {}", algorithm, error)) + .flatMap(keyOperationResultResponse -> + Mono.just(new SignResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); + } + + Mono verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context) { + KeyVerifyRequest parameters = new KeyVerifyRequest() + .setAlgorithm(algorithm) + .setDigest(digest) + .setSignature(signature); + context = context == null ? Context.NONE : context; + + return service.verify(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, parameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Verifying content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved verified content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to verify content with algorithm - {}", algorithm, error)) + .flatMap(response -> Mono.just(new VerifyResult(response.getValue().getValue(), algorithm, keyId))); + } + + Mono wrapKey(KeyWrapAlgorithm algorithm, byte[] key, Context context) { + KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() + .setAlgorithm(algorithm) + .setValue(key); + context = context == null ? Context.NONE : context; + + return service.wrapKey(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, parameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Wrapping key content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved wrapped key content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to verify content with algorithm - {}", algorithm, error)) + .flatMap(keyOperationResultResponse -> + Mono.just(new WrapResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); + } + + Mono unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context) { + KeyWrapUnwrapRequest parameters = new KeyWrapUnwrapRequest() + .setAlgorithm(algorithm) + .setValue(encryptedKey); + context = context == null ? Context.NONE : context; + + return service.unwrapKey(vaultUrl, keyName, version, apiVersion, ACCEPT_LANGUAGE, parameters, + CONTENT_TYPE_HEADER_VALUE, context) + .doOnRequest(ignored -> LOGGER.verbose("Unwrapping key content with algorithm - {}", algorithm)) + .doOnSuccess(response -> LOGGER.verbose("Retrieved unwrapped key content with algorithm - {}", algorithm)) + .doOnError(error -> LOGGER.warning("Failed to unwrap key content with algorithm - {}", algorithm, error)) + .flatMap(response -> Mono.just(new UnwrapResult(response.getValue().getResult(), algorithm, keyId))); + } + + + Mono signData(SignatureAlgorithm algorithm, byte[] data, Context context) { + try { + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); + + return sign(algorithm, digest, context); + } catch (NoSuchAlgorithmException e) { + return Mono.error(e); + } + } + + Mono verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context) { + try { + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); + + return verify(algorithm, digest, signature, context); + } catch (NoSuchAlgorithmException e) { + return Mono.error(e); + } + } + + private void unpackId(String keyId) { + if (keyId != null && keyId.length() > 0) { + try { + URL url = new URL(keyId); + String[] tokens = url.getPath().split("/"); + this.vaultUrl = url.getProtocol() + "://" + url.getHost(); + + if (url.getPort() != -1) { + this.vaultUrl += ":" + url.getPort(); + } + + this.keyName = (tokens.length >= 3 ? tokens[2] : null); + this.version = (tokens.length >= 4 ? tokens[3] : ""); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/EcKeyCryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/EcKeyCryptographyClient.java index a8c207e613410..9b51bcdf56f26 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/EcKeyCryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/EcKeyCryptographyClient.java @@ -20,16 +20,15 @@ import reactor.core.publisher.Mono; import java.security.KeyPair; -import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.Provider; import java.security.Security; -import java.util.Objects; +import java.security.MessageDigest; class EcKeyCryptographyClient extends LocalKeyCryptographyClient { private static final ClientLogger LOGGER = new ClientLogger(EcKeyCryptographyClient.class); - private final CryptographyClientImpl serviceClient; + private final CryptographyServiceClient serviceClient; private final Provider provider; private KeyPair keyPair; @@ -39,16 +38,14 @@ class EcKeyCryptographyClient extends LocalKeyCryptographyClient { * * @param serviceClient the client to use for service side cryptography operations. */ - EcKeyCryptographyClient(CryptographyClientImpl serviceClient) { + EcKeyCryptographyClient(CryptographyServiceClient serviceClient) { super(serviceClient); - this.serviceClient = serviceClient; this.provider = null; } - EcKeyCryptographyClient(JsonWebKey key, CryptographyClientImpl serviceClient) { + EcKeyCryptographyClient(JsonWebKey key, CryptographyServiceClient serviceClient) { super(serviceClient); - this.provider = Security.getProvider("SunEC"); this.keyPair = key.toEc(key.hasPrivateKey(), provider); this.serviceClient = serviceClient; @@ -58,81 +55,55 @@ private KeyPair getKeyPair(JsonWebKey key) { if (keyPair == null) { keyPair = key.toEc(key.hasPrivateKey()); } - return keyPair; } @Override - Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey key, Context context) { - return Mono.error(new UnsupportedOperationException("Encrypt operation is not supported for EC key")); - } - - @Override - EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Encrypt operation is not supported for EC key")); + Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, JsonWebKey key) { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException( + "Encrypt operation is not supported for EC key")); } @Override - Mono encryptAsync(EncryptParameters options, JsonWebKey key, Context context) { - return Mono.error(new UnsupportedOperationException("Encrypt operation is not supported for EC key")); + Mono encryptAsync(EncryptParameters options, Context context, JsonWebKey key) { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException( + "Encrypt operation is not supported for EC key")); } @Override - EncryptResult encrypt(EncryptParameters options, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Encrypt operation is not supported for EC key")); + Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, JsonWebKey key) { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException( + "Encrypt operation is not supported for EC key")); } @Override - Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey key, Context context) { - return Mono.error(new UnsupportedOperationException("Encrypt operation is not supported for EC key")); + Mono decryptAsync(DecryptParameters options, Context context, JsonWebKey key) { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException( + "Decrypt operation is not supported for EC key")); } @Override - DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Encrypt operation is not supported for EC key")); - } - - @Override - Mono decryptAsync(DecryptParameters options, JsonWebKey key, Context context) { - return Mono.error(new UnsupportedOperationException("Decrypt operation is not supported for EC key")); - } - - @Override - DecryptResult decrypt(DecryptParameters options, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Decrypt operation is not supported for EC key")); - } - - @Override - Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - + Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, Context context, JsonWebKey key) { keyPair = getKeyPair(key); // Interpret the requested algorithm Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.signAsync(algorithm, digest, context); + if (serviceCryptoAvailable()) { + return serviceClient.sign(algorithm, digest, context); } - return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.signAsync(algorithm, digest, context); + if (serviceCryptoAvailable()) { + return serviceClient.sign(algorithm, digest, context); } - - return Mono.error( - new IllegalArgumentException("Private portion of the key not available to perform sign operation")); + return Mono.error(new IllegalArgumentException( + "Private portion of the key not available to perform sign operation")); } Ecdsa algo; @@ -152,60 +123,8 @@ Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, JsonWebK } @Override - SignResult sign(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - - keyPair = getKeyPair(key); - - // Interpret the requested algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.sign(algorithm, digest, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.sign(algorithm, digest, context); - } - - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Private portion of the key not available to perform sign operation")); - } - - Ecdsa algo; - if (baseAlgorithm instanceof Ecdsa) { - algo = (Ecdsa) baseAlgorithm; - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - ISignatureTransform signer = algo.createSignatureTransform(keyPair, provider); - - try { - return new SignResult(signer.sign(digest), algorithm, key.getId()); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - } - - @Override - Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); + Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context, + JsonWebKey key) { keyPair = getKeyPair(key); @@ -213,26 +132,23 @@ Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.verifyAsync(algorithm, digest, signature, context); + if (serviceCryptoAvailable()) { + return serviceClient.verify(algorithm, digest, signature, context); } - return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.verifyAsync(algorithm, digest, signature, context); + if (serviceCryptoAvailable()) { + return serviceClient.verify(algorithm, digest, signature, context); } - - return Mono.error( - new IllegalArgumentException("Public portion of the key not available to perform verify operation")); + return Mono.error(new IllegalArgumentException( + "Public portion of the key not available to perform verify operation")); } Ecdsa algo; - if (baseAlgorithm instanceof Ecdsa) { algo = (Ecdsa) baseAlgorithm; } else { @@ -249,127 +165,46 @@ Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte } @Override - VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { - Objects.requireNonNull(algorithm, "Signature algorithm cannot be null."); - Objects.requireNonNull(digest, "Digest content cannot be null."); - Objects.requireNonNull(signature, "Signature to be verified cannot be null."); - - keyPair = getKeyPair(key); - - // Interpret the requested algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.verify(algorithm, digest, signature, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricSignatureAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.verify(algorithm, digest, signature, context); - } - - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Public portion of the key not available to perform verify operation")); - } - - Ecdsa algo; - if (baseAlgorithm instanceof Ecdsa) { - algo = (Ecdsa) baseAlgorithm; - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - ISignatureTransform signer = algo.createSignatureTransform(keyPair, provider); - - try { - return new VerifyResult(signer.verify(digest, signature), algorithm, key.getId()); - } catch (Exception e) { - if (e instanceof RuntimeException) { - throw LOGGER.logExceptionAsError((RuntimeException) e); - } else { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - } - - @Override - Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey webKey, Context context) { + Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, Context context, JsonWebKey webKey) { return Mono.error(new UnsupportedOperationException("Wrap key operation is not supported for EC key")); } @Override - WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey webKey, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Wrap key operation is not supported for EC key")); + Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context, + JsonWebKey key) { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException( + "Unwrap key operation is not supported for Ec key")); } @Override - Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey key, - Context context) { - return Mono.error(new UnsupportedOperationException("Unwrap key operation is not supported for EC key")); - } - - @Override - UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey key, Context context) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Unwrap key operation is not supported for EC key")); - } - - @Override - Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { + Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, Context context, JsonWebKey key) { try { - return signAsync(algorithm, calculateDigest(algorithm, data), key, context); + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); + return signAsync(algorithm, digest, context, key); } catch (NoSuchAlgorithmException e) { return Mono.error(e); } } @Override - SignResult signData(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { + Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context, + JsonWebKey key) { try { - return sign(algorithm, calculateDigest(algorithm, data), key, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); - @Override - Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { - try { - return verifyAsync(algorithm, calculateDigest(algorithm, data), signature, key, context); + return verifyAsync(algorithm, digest, signature, context, key); } catch (NoSuchAlgorithmException e) { return Mono.error(e); } } - @Override - VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { - try { - return verify(algorithm, calculateDigest(algorithm, data), signature, key, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - private byte[] calculateDigest(SignatureAlgorithm algorithm, byte[] data) throws NoSuchAlgorithmException { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - - md.update(data); - - return md.digest(); - } - - private boolean serviceClientAvailable() { + private boolean serviceCryptoAvailable() { return serviceClient != null; } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java index e1ebf974fe23a..beaf7012d1429 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyAsyncClient.java @@ -23,7 +23,7 @@ public final class KeyEncryptionKeyAsyncClient extends CryptographyAsyncClient i private static final ClientLogger LOGGER = new ClientLogger(KeyEncryptionKeyAsyncClient.class); /** - * Creates a {@link KeyEncryptionKeyAsyncClient} that uses {@code pipeline} to service requests. + * Creates a {@link KeyEncryptionKeyAsyncClient} that uses {@code pipeline} to service requests * * @param keyId The identifier of the key to use for cryptography operations. * @param pipeline The {@link HttpPipeline} that the HTTP requests and responses flow through. @@ -34,7 +34,7 @@ public final class KeyEncryptionKeyAsyncClient extends CryptographyAsyncClient i } /** - * Creates a {@link KeyEncryptionKeyAsyncClient} that uses {@code pipeline} to service requests. + * Creates a KeyEncryptionKeyAsyncClient that uses {@code pipeline} to service requests * * @param jsonWebKey The {@link JsonWebKey} to use for local cryptography operations. */ @@ -49,7 +49,7 @@ public final class KeyEncryptionKeyAsyncClient extends CryptographyAsyncClient i */ @Override public Mono getKeyId() { - return Mono.defer(() -> Mono.just(this.keyId)); + return super.getKeyId(); } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java index 9a3be82d909eb..e3f91ee158fcb 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClient.java @@ -8,33 +8,21 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.cryptography.KeyEncryptionKey; import com.azure.core.http.HttpPipeline; -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; -import com.azure.security.keyvault.keys.models.JsonWebKey; /** * A key client which is used to synchronously wrap or unwrap another key. */ @ServiceClient(builder = KeyEncryptionKeyClientBuilder.class) -public final class KeyEncryptionKeyClient extends CryptographyClient implements KeyEncryptionKey { +public final class KeyEncryptionKeyClient implements KeyEncryptionKey { + private final KeyEncryptionKeyAsyncClient client; /** * Creates a {@link KeyEncryptionKeyClient} that uses a given {@link HttpPipeline pipeline} to service requests. * - * @param keyId The identifier of the key to use for cryptography operations. - * @param pipeline The {@link HttpPipeline} that the HTTP requests and responses flow through. - * @param version {@link CryptographyServiceVersion} of the service to be used when making requests. + * @param client The {@link KeyEncryptionKeyAsyncClient} that the client routes its request through. */ - KeyEncryptionKeyClient(String keyId, HttpPipeline pipeline, CryptographyServiceVersion version) { - super(keyId, pipeline, version); - } - - /** - * Creates a {@link KeyEncryptionKeyClient} that uses {@code pipeline} to service requests. - * - * @param jsonWebKey The {@link JsonWebKey} to use for local cryptography operations. - */ - KeyEncryptionKeyClient(JsonWebKey jsonWebKey) { - super(jsonWebKey); + KeyEncryptionKeyClient(KeyEncryptionKeyAsyncClient client) { + this.client = client; } /** @@ -44,7 +32,7 @@ public final class KeyEncryptionKeyClient extends CryptographyClient implements */ @Override public String getKeyId() { - return this.keyId; + return client.getKeyId().block(); } /** @@ -53,9 +41,7 @@ public String getKeyId() { @Override @ServiceMethod(returns = ReturnType.SINGLE) public byte[] wrapKey(String algorithm, byte[] key) { - KeyWrapAlgorithm wrapAlgorithm = KeyWrapAlgorithm.fromString(algorithm); - - return wrapKey(wrapAlgorithm, key).getEncryptedKey(); + return client.wrapKey(algorithm, key).block(); } /** @@ -64,8 +50,10 @@ public byte[] wrapKey(String algorithm, byte[] key) { @Override @ServiceMethod(returns = ReturnType.SINGLE) public byte[] unwrapKey(String algorithm, byte[] encryptedKey) { - KeyWrapAlgorithm wrapAlgorithm = KeyWrapAlgorithm.fromString(algorithm); + return client.unwrapKey(algorithm, encryptedKey).block(); + } - return unwrapKey(wrapAlgorithm, encryptedKey).getKey(); + KeyEncryptionKeyAsyncClient getKeyEncryptionKeyAsyncClient() { + return client; } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java index 0359e0d04daab..ca73f803d336b 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientBuilder.java @@ -88,29 +88,7 @@ public KeyEncryptionKeyClientBuilder() { */ @Override public KeyEncryptionKey buildKeyEncryptionKey(String keyId) { - builder.keyIdentifier(keyId); - - if (Strings.isNullOrEmpty(keyId)) { - throw LOGGER.logExceptionAsError(new IllegalStateException( - "An Azure Key Vault key identifier cannot be null and is required to build the key encryption key " - + "client.")); - } - - CryptographyServiceVersion serviceVersion = - builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); - - if (builder.getPipeline() != null) { - return new KeyEncryptionKeyClient(keyId, builder.getPipeline(), serviceVersion); - } - - if (builder.getCredential() == null) { - throw LOGGER.logExceptionAsError(new IllegalStateException( - "Azure Key Vault credentials cannot be null and are required to build a key encryption key client.")); - } - - HttpPipeline pipeline = builder.setupPipeline(); - - return new KeyEncryptionKeyClient(keyId, pipeline, serviceVersion); + return new KeyEncryptionKeyClient((KeyEncryptionKeyAsyncClient) buildAsyncKeyEncryptionKey(keyId).block()); } /** @@ -127,15 +105,7 @@ public KeyEncryptionKey buildKeyEncryptionKey(String keyId) { * @throws IllegalStateException If {{@code key} is not set. */ public KeyEncryptionKey buildKeyEncryptionKey(JsonWebKey key) { - if (key == null) { - throw LOGGER.logExceptionAsError(new IllegalStateException( - "JSON Web Key cannot be null and is required to build a local key encryption key async client.")); - } else if (key.getId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("JSON Web Key's id property is not configured.")); - } - - return new KeyEncryptionKeyClient(key); + return new KeyEncryptionKeyClient((KeyEncryptionKeyAsyncClient) buildAsyncKeyEncryptionKey(key).block()); } /** @@ -247,7 +217,6 @@ public KeyEncryptionKeyClientBuilder credential(TokenCredential credential) { * * @param logOptions The {@link HttpLogOptions logging configuration} to use when sending and receiving requests to * and from the service. - * * @return The updated {@link KeyEncryptionKeyClientBuilder} object. */ @Override @@ -268,7 +237,6 @@ public KeyEncryptionKeyClientBuilder httpLogOptions(HttpLogOptions logOptions) { * documentation of types that implement this trait to understand the full set of implications.

* * @param policy A {@link HttpPipelinePolicy pipeline policy}. - * * @return The updated {@link KeyEncryptionKeyClientBuilder} object. * * @throws NullPointerException If {@code policy} is {@code null}. @@ -295,7 +263,6 @@ public KeyEncryptionKeyClientBuilder addPolicy(HttpPipelinePolicy policy) { * documentation of types that implement this trait to understand the full set of implications.

* * @param client The {@link HttpClient} to use for requests. - * * @return The updated {@link KeyEncryptionKeyClientBuilder} object. */ @Override @@ -316,7 +283,6 @@ public KeyEncryptionKeyClientBuilder httpClient(HttpClient client) { * documentation of types that implement this trait to understand the full set of implications.

* * @param pipeline {@link HttpPipeline} to use for sending service requests and receiving responses. - * * @return The updated {@link KeyEncryptionKeyClientBuilder} object. */ @Override @@ -390,7 +356,6 @@ public KeyEncryptionKeyClientBuilder retryPolicy(RetryPolicy retryPolicy) { * Setting this is mutually exclusive with using {@link #retryPolicy(RetryPolicy)}. * * @param retryOptions The {@link RetryOptions} to use for all the requests made through the client. - * * @return The updated {@link KeyEncryptionKeyClientBuilder} object. */ @Override @@ -414,10 +379,8 @@ public KeyEncryptionKeyClientBuilder retryOptions(RetryOptions retryOptions) { * documentation of types that implement this trait to understand the full set of implications.

* * @param clientOptions A configured instance of {@link HttpClientOptions}. - * - * @return The updated {@link KeyEncryptionKeyClientBuilder} object. - * * @see HttpClientOptions + * @return The updated {@link KeyEncryptionKeyClientBuilder} object. */ @Override public KeyEncryptionKeyClientBuilder clientOptions(ClientOptions clientOptions) { diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/LocalKeyCryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/LocalKeyCryptographyClient.java index 9acf7ba1946e6..abc00e51f4000 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/LocalKeyCryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/LocalKeyCryptographyClient.java @@ -19,61 +19,38 @@ import reactor.core.publisher.Mono; abstract class LocalKeyCryptographyClient { - final CryptographyClientImpl serviceClient; + final CryptographyServiceClient serviceClient; - LocalKeyCryptographyClient(CryptographyClientImpl serviceClient) { + LocalKeyCryptographyClient(CryptographyServiceClient serviceClient) { this.serviceClient = serviceClient; } - LocalKeyCryptographyClient(JsonWebKey key, CryptographyClientImpl serviceClient) { + LocalKeyCryptographyClient(JsonWebKey key, CryptographyServiceClient serviceClient) { this.serviceClient = serviceClient; } - abstract Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context); + abstract Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, JsonWebKey jsonWebKey); - abstract EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context); + abstract Mono encryptAsync(EncryptParameters encryptParameters, Context context, JsonWebKey jsonWebKey); - abstract Mono encryptAsync(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context); + abstract Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, JsonWebKey jsonWebKey); - abstract EncryptResult encrypt(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context); + abstract Mono decryptAsync(DecryptParameters decryptParameters, Context context, JsonWebKey jsonWebKey); - abstract Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context); - - abstract DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context); - - abstract Mono decryptAsync(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context); - - abstract DecryptResult decrypt(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context); - - abstract Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context); - - abstract SignResult sign(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context); + abstract Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, Context context, JsonWebKey key); abstract Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, - JsonWebKey key, Context context); + Context context, JsonWebKey key); - abstract VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context); + abstract Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, Context context, + JsonWebKey jsonWebKey); - abstract Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey jsonWebKey, - Context context); + abstract Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context, + JsonWebKey jsonWebKey); - abstract WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey jsonWebKey, Context context); - - abstract Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, - Context context); - - abstract UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, - Context context); - - abstract Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context); - - abstract SignResult signData(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context); + abstract Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, Context context, JsonWebKey key); abstract Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, - JsonWebKey key, Context context); - - abstract VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context); + Context context, JsonWebKey key); } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/RsaKeyCryptographyClient.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/RsaKeyCryptographyClient.java index be9b1e1f97fea..316ff9c45f6d2 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/RsaKeyCryptographyClient.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/RsaKeyCryptographyClient.java @@ -4,6 +4,7 @@ package com.azure.security.keyvault.keys.cryptography; import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.security.keyvault.keys.cryptography.models.DecryptParameters; import com.azure.security.keyvault.keys.cryptography.models.DecryptResult; @@ -38,11 +39,11 @@ class RsaKeyCryptographyClient extends LocalKeyCryptographyClient { * * @param keyPair the key pair to use for cryptography operations. */ - RsaKeyCryptographyClient(CryptographyClientImpl serviceClient) { + RsaKeyCryptographyClient(CryptographyServiceClient serviceClient) { super(serviceClient); } - RsaKeyCryptographyClient(JsonWebKey key, CryptographyClientImpl serviceClient) { + RsaKeyCryptographyClient(JsonWebKey key, CryptographyServiceClient serviceClient) { super(serviceClient); keyPair = key.toRsa(key.hasPrivateKey()); @@ -57,19 +58,33 @@ private KeyPair getKeyPair(JsonWebKey key) { } @Override - Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); + Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, + JsonWebKey jsonWebKey) { + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(plaintext, "'plaintext' cannot be null."); + return encryptInternal(algorithm, plaintext, context, jsonWebKey); + } + + @Override + Mono encryptAsync(EncryptParameters encryptParameters, Context context, JsonWebKey jsonWebKey) { + Objects.requireNonNull(encryptParameters, "'encryptParameters' cannot be null."); + Objects.requireNonNull(encryptParameters.getAlgorithm(), "encryptParameters.getAlgorithm() cannot be null."); + Objects.requireNonNull(encryptParameters.getPlainText(), "encryptParameters.getPlainText() cannot be null."); + + return encryptInternal(encryptParameters.getAlgorithm(), encryptParameters.getPlainText(), context, jsonWebKey); + } + + private Mono encryptInternal(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, + JsonWebKey jsonWebKey) { keyPair = getKeyPair(jsonWebKey); // Interpret the requested algorithm Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.encryptAsync(algorithm, plaintext, context); + if (serviceCryptoAvailable()) { + return serviceClient.encrypt(algorithm, plaintext, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); @@ -78,8 +93,8 @@ Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext } if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.encryptAsync(algorithm, plaintext, context); + if (serviceCryptoAvailable()) { + return serviceClient.encrypt(algorithm, plaintext, context); } return Mono.error(new IllegalArgumentException( @@ -96,94 +111,44 @@ Mono encryptAsync(EncryptionAlgorithm algorithm, byte[] plaintext return Mono.just(new EncryptResult(transform.doFinal(plaintext), algorithm, jsonWebKey.getId())); } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { + | NoSuchAlgorithmException + | NoSuchPaddingException + | IllegalBlockSizeException + | BadPaddingException e) { return Mono.error(e); } } @Override - EncryptResult encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(plaintext, "Plaintext cannot be null."); - - keyPair = getKeyPair(jsonWebKey); - - // Interpret the requested algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.encrypt(algorithm, plaintext, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.encrypt(algorithm, plaintext, context); - } + Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context, + JsonWebKey jsonWebKey) { + Objects.requireNonNull(algorithm, "'algorithm' cannot be null."); + Objects.requireNonNull(ciphertext, "'ciphertext' cannot be null."); - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Public portion of the key not available to perform encrypt operation")); - } - - AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = algo.createEncryptor(keyPair); - - return new EncryptResult(transform.doFinal(plaintext), algorithm, jsonWebKey.getId()); - } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { - - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } + return decryptInternal(algorithm, ciphertext, context, jsonWebKey); } @Override - Mono encryptAsync(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context) { - try { - EncryptResult encryptResult = encrypt(encryptParameters, jsonWebKey, context); + Mono decryptAsync(DecryptParameters decryptParameters, Context context, JsonWebKey jsonWebKey) { + Objects.requireNonNull(decryptParameters, "'decryptOptions' cannot be null."); + Objects.requireNonNull(decryptParameters.getAlgorithm(), "decryptParameters.getAlgorithm() cannot be null."); + Objects.requireNonNull(decryptParameters.getCipherText(), "decryptParameters.getCipherText() cannot be null."); - return Mono.just(encryptResult); - } catch (Exception e) { - return Mono.error(e); - } + return decryptInternal(decryptParameters.getAlgorithm(), decryptParameters.getCipherText(), context, + jsonWebKey); } - @Override - EncryptResult encrypt(EncryptParameters encryptParameters, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(encryptParameters, "Encrypt parameters cannot be null."); - - return encrypt(encryptParameters.getAlgorithm(), encryptParameters.getPlainText(), jsonWebKey, context); - } - - @Override - Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertext, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - + Mono decryptInternal(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context, + JsonWebKey jsonWebKey) { keyPair = getKeyPair(jsonWebKey); // Interpret the requested algorithm Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.decryptAsync(algorithm, ciphertext, context); + if (serviceCryptoAvailable()) { + return serviceClient.decrypt(algorithm, ciphertext, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); @@ -192,8 +157,8 @@ Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertex } if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.decryptAsync(algorithm, ciphertext, context); + if (serviceCryptoAvailable()) { + return serviceClient.decrypt(algorithm, ciphertext, context); } return Mono.error(new IllegalArgumentException( @@ -210,134 +175,45 @@ Mono decryptAsync(EncryptionAlgorithm algorithm, byte[] ciphertex return Mono.just(new DecryptResult(transform.doFinal(ciphertext), algorithm, jsonWebKey.getId())); } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { + | NoSuchAlgorithmException + | NoSuchPaddingException + | IllegalBlockSizeException + | BadPaddingException e) { return Mono.error(e); } } @Override - DecryptResult decrypt(EncryptionAlgorithm algorithm, byte[] ciphertext, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); - Objects.requireNonNull(ciphertext, "Ciphertext cannot be null."); - - keyPair = getKeyPair(jsonWebKey); - - // Interpret the requested algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.decrypt(algorithm, ciphertext, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.decrypt(algorithm, ciphertext, context); - } - - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Private portion of the key not available to perform decrypt operation")); - } - - AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = algo.createDecryptor(keyPair); - - return new DecryptResult(transform.doFinal(ciphertext), algorithm, jsonWebKey.getId()); - } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { - - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - Mono decryptAsync(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context) { - try { - DecryptResult decryptResult = decrypt(decryptParameters, jsonWebKey, context); - - return Mono.just(decryptResult); - } catch (Exception e) { - return Mono.error(e); - } - } - - @Override - DecryptResult decrypt(DecryptParameters decryptParameters, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(decryptParameters, "Decrypt parameters cannot be null."); - - return decrypt(decryptParameters.getAlgorithm(), decryptParameters.getCipherText(), jsonWebKey, - context); - } - - @Override - Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { - if (serviceClientAvailable()) { - return serviceClient.signAsync(algorithm, digest, context); - } else { - return Mono.error( - new UnsupportedOperationException("Sign operation on Local RSA key is not supported currently.")); - } - } - - @Override - SignResult sign(SignatureAlgorithm algorithm, byte[] digest, JsonWebKey key, Context context) { - if (serviceClientAvailable()) { + Mono signAsync(SignatureAlgorithm algorithm, byte[] digest, Context context, JsonWebKey key) { + if (serviceCryptoAvailable()) { return serviceClient.sign(algorithm, digest, context); } else { - throw LOGGER.logExceptionAsError( + return FluxUtil.monoError(LOGGER, new UnsupportedOperationException("Sign operation on Local RSA key is not supported currently.")); } } @Override - Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { - if (serviceClientAvailable()) { - return serviceClient.verifyAsync(algorithm, digest, signature, context); - } else { - return Mono.error( - new UnsupportedOperationException("Verify operation on Local RSA key is not supported currently.")); - } - } - - VerifyResult verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, JsonWebKey key, - Context context) { - if (serviceClientAvailable()) { + Mono verifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, Context context, + JsonWebKey key) { + if (serviceCryptoAvailable()) { return serviceClient.verify(algorithm, digest, signature, context); } else { - throw LOGGER.logExceptionAsError( + return FluxUtil.monoError(LOGGER, new UnsupportedOperationException("Verify operation on Local RSA key is not supported currently.")); } } @Override - Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(key, "Key content to be wrapped cannot be null."); - + Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, Context context, JsonWebKey jsonWebKey) { keyPair = getKeyPair(jsonWebKey); Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.wrapKeyAsync(algorithm, key, context); + if (serviceCryptoAvailable()) { + return serviceClient.wrapKey(algorithm, key, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { @@ -345,8 +221,8 @@ Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey } if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.wrapKeyAsync(algorithm, key, context); + if (serviceCryptoAvailable()) { + return serviceClient.wrapKey(algorithm, key, context); } return Mono.error(new IllegalArgumentException( "Public portion of the key not available to perform wrap key operation")); @@ -360,73 +236,25 @@ Mono wrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey transform = algo.createEncryptor(keyPair); return Mono.just(new WrapResult(transform.doFinal(key), algorithm, jsonWebKey.getId())); } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { + | NoSuchAlgorithmException + | NoSuchPaddingException + | IllegalBlockSizeException + | BadPaddingException e) { return Mono.error(e); } } @Override - WrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(key, "Key content to be wrapped cannot be null."); - - keyPair = getKeyPair(jsonWebKey); - - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.wrapKey(algorithm, key, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPublic() == null) { - if (serviceClientAvailable()) { - return serviceClient.wrapKey(algorithm, key, context); - } - - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Public portion of the key not available to perform wrap key operation")); - } - - AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = algo.createEncryptor(keyPair); - return new WrapResult(transform.doFinal(key), algorithm, jsonWebKey.getId()); - } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { - - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, - Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - + Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKey, Context context, + JsonWebKey jsonWebKey) { keyPair = getKeyPair(jsonWebKey); // Interpret the requested algorithm Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.unwrapKeyAsync(algorithm, encryptedKey, context); + if (serviceCryptoAvailable()) { + return serviceClient.unwrapKey(algorithm, encryptedKey, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { @@ -434,8 +262,8 @@ Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKe } if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.unwrapKeyAsync(algorithm, encryptedKey, context); + if (serviceCryptoAvailable()) { + return serviceClient.unwrapKey(algorithm, encryptedKey, context); } return Mono.error(new IllegalArgumentException( "Private portion of the key not available to perform unwrap operation")); @@ -449,107 +277,42 @@ Mono unwrapKeyAsync(KeyWrapAlgorithm algorithm, byte[] encryptedKe transform = algo.createDecryptor(keyPair); return Mono.just(new UnwrapResult(transform.doFinal(encryptedKey), algorithm, jsonWebKey.getId())); } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { + | NoSuchAlgorithmException + | NoSuchPaddingException + | IllegalBlockSizeException + | BadPaddingException e) { return Mono.error(e); } } @Override - UnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey, JsonWebKey jsonWebKey, Context context) { - Objects.requireNonNull(algorithm, "Key wrap algorithm cannot be null."); - Objects.requireNonNull(encryptedKey, "Encrypted key content to be unwrapped cannot be null."); - - keyPair = getKeyPair(jsonWebKey); - - // Interpret the requested algorithm - Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString()); - - if (baseAlgorithm == null) { - if (serviceClientAvailable()) { - return serviceClient.unwrapKey(algorithm, encryptedKey, context); - } - - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { - throw LOGGER.logExceptionAsError(new RuntimeException(new NoSuchAlgorithmException(algorithm.toString()))); - } - - if (keyPair.getPrivate() == null) { - if (serviceClientAvailable()) { - return serviceClient.unwrapKey(algorithm, encryptedKey, context); - } - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Private portion of the key not available to perform unwrap operation")); - } - - AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; - - ICryptoTransform transform; - - try { - transform = algo.createDecryptor(keyPair); - return new UnwrapResult(transform.doFinal(encryptedKey), algorithm, jsonWebKey.getId()); - } catch (InvalidKeyException - | NoSuchAlgorithmException - | NoSuchPaddingException - | IllegalBlockSizeException - | BadPaddingException e) { - - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { + Mono signDataAsync(SignatureAlgorithm algorithm, byte[] data, Context context, JsonWebKey key) { try { - return signAsync(algorithm, calculateDigest(algorithm, data), key, context); + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); + return signAsync(algorithm, digest, context, key); } catch (NoSuchAlgorithmException e) { return Mono.error(e); } } @Override - SignResult signData(SignatureAlgorithm algorithm, byte[] data, JsonWebKey key, Context context) { - try { - return sign(algorithm, calculateDigest(algorithm, data), key, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - @Override - Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { + Mono verifyDataAsync(SignatureAlgorithm algorithm, byte[] data, byte[] signature, Context context, + JsonWebKey key) { + HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); try { - return verifyAsync(algorithm, calculateDigest(algorithm, data), signature, key, context); + MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); + md.update(data); + byte[] digest = md.digest(); + return verifyAsync(algorithm, digest, signature, context, key); } catch (NoSuchAlgorithmException e) { return Mono.error(e); } } - @Override - VerifyResult verifyData(SignatureAlgorithm algorithm, byte[] data, byte[] signature, JsonWebKey key, - Context context) { - try { - return verify(algorithm, calculateDigest(algorithm, data), signature, key, context); - } catch (NoSuchAlgorithmException e) { - throw LOGGER.logExceptionAsError(new RuntimeException(e)); - } - } - - private byte[] calculateDigest(SignatureAlgorithm algorithm, byte[] data) throws NoSuchAlgorithmException { - HashAlgorithm hashAlgorithm = SignatureHashResolver.DEFAULT.get(algorithm); - MessageDigest md = MessageDigest.getInstance(hashAlgorithm.toString()); - - md.update(data); - - return md.digest(); - } - - private boolean serviceClientAvailable() { + private boolean serviceCryptoAvailable() { return serviceClient != null; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyService.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyService.java index 8aac6d1b05812..ef3ae8f4042d6 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyService.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/implementation/CryptographyService.java @@ -33,242 +33,128 @@ @Host("{url}") @ServiceInterface(name = "KeyVault") public interface CryptographyService { - @Post("keys/{key-name}/{key-version}/encrypt") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> encryptAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyOperationParameters parameters, - @HeaderParam("Content-Type") String type, - Context context); @Post("keys/{key-name}/{key-version}/encrypt") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response encrypt(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyOperationParameters parameters, - @HeaderParam("Content-Type") String type, - Context context); - + Mono> encrypt(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeyOperationParameters parameters, + @HeaderParam("Content-Type") String type, + Context context); - @Post("keys/{key-name}/{key-version}/decrypt") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> decryptAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyOperationParameters parameters, - @HeaderParam("Content-Type") String type, - Context context); @Post("keys/{key-name}/{key-version}/decrypt") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response decrypt(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyOperationParameters parameters, - @HeaderParam("Content-Type") String type, - Context context); + Mono> decrypt(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeyOperationParameters parameters, + @HeaderParam("Content-Type") String type, + Context context); - @Post("keys/{key-name}/{key-version}/sign") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> signAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeySignRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); @Post("keys/{key-name}/{key-version}/sign") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response sign(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeySignRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); + Mono> sign(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeySignRequest parameters, + @HeaderParam("Content-Type") String type, + Context context); @Post("keys/{key-name}/{key-version}/verify") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> verifyAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyVerifyRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); + Mono> verify(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeyVerifyRequest parameters, + @HeaderParam("Content-Type") String type, + Context context); - @Post("keys/{key-name}/{key-version}/verify") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response verify(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyVerifyRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); @Post("keys/{key-name}/{key-version}/wrapkey") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> wrapKeyAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyWrapUnwrapRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); - - @Post("keys/{key-name}/{key-version}/wrapkey") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response wrapKey(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyWrapUnwrapRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); + Mono> wrapKey(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeyWrapUnwrapRequest parameters, + @HeaderParam("Content-Type") String type, + Context context); @Post("keys/{key-name}/{key-version}/unwrapkey") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> unwrapKeyAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyWrapUnwrapRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); - - @Post("keys/{key-name}/{key-version}/unwrapkey") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response unwrapKey(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") KeyWrapUnwrapRequest parameters, - @HeaderParam("Content-Type") String type, - Context context); + Mono> unwrapKey(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @BodyParam("application/json") KeyWrapUnwrapRequest parameters, + @HeaderParam("Content-Type") String type, + Context context); @Get("keys/{key-name}/{key-version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) @UnexpectedResponseExceptionType(code = {403}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyAsync(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Content-Type") String type, - Context context); - - @Get("keys/{key-name}/{key-version}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) - @UnexpectedResponseExceptionType(code = {403}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKey(@HostParam("url") String url, - @PathParam("key-name") String keyName, - @PathParam("key-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Content-Type") String type, - Context context); - - @Get("secrets/{secret-name}/{secret-version}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) - @UnexpectedResponseExceptionType(code = {403}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSecretAsync(@HostParam("url") String url, - @PathParam("secret-name") String keyName, - @PathParam("secret-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Content-Type") String type, - Context context); + Mono> getKey(@HostParam("url") String url, + @PathParam("key-name") String keyName, + @PathParam("key-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @HeaderParam("Content-Type") String type, + Context context); @Get("secrets/{secret-name}/{secret-version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {404}, value = ResourceNotFoundException.class) @UnexpectedResponseExceptionType(code = {403}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSecret(@HostParam("url") String url, - @PathParam("secret-name") String keyName, - @PathParam("secret-version") String keyVersion, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @HeaderParam("Content-Type") String type, - Context context); + Mono> getSecret(@HostParam("url") String url, + @PathParam("secret-name") String keyName, + @PathParam("secret-version") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("accept-language") String acceptLanguage, + @HeaderParam("Content-Type") String type, + Context context); @Put("secrets/{secret-name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> setSecretAsync(@HostParam("url") String url, + Mono> setSecret(@HostParam("url") String url, @PathParam("secret-name") String secretName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept-language") String acceptLanguage, @BodyParam("application/json") SecretRequestParameters parameters, @HeaderParam("Content-Type") String type, Context context); - - @Put("secrets/{secret-name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(code = {400}, value = ResourceModifiedException.class) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response setSecret(@HostParam("url") String url, - @PathParam("secret-name") String secretName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept-language") String acceptLanguage, - @BodyParam("application/json") SecretRequestParameters parameters, - @HeaderParam("Content-Type") String type, - Context context); } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyClientImpl.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyClientImpl.java index 4dc818b084a08..2bd64770812c1 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyClientImpl.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyClientImpl.java @@ -22,9 +22,7 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.Page; import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; @@ -36,7 +34,6 @@ import com.azure.core.util.polling.PollResponse; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingContext; -import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.keys.KeyServiceVersion; import com.azure.security.keyvault.keys.cryptography.CryptographyClientBuilder; import com.azure.security.keyvault.keys.cryptography.CryptographyServiceVersion; @@ -91,7 +88,8 @@ public class KeyClientImpl { * @param keyServiceVersion {@link KeyServiceVersion} of the service to be used when making requests. */ public KeyClientImpl(String vaultUrl, HttpPipeline pipeline, KeyServiceVersion keyServiceVersion) { - Objects.requireNonNull(vaultUrl, KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED); + Objects.requireNonNull(vaultUrl, + KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); this.vaultUrl = vaultUrl; this.service = RestProxy.create(KeyService.class, pipeline); @@ -889,35 +887,22 @@ private KeyRequestParameters validateAndCreateUpdateKeyRequestParameters(KeyProp public PollerFlux beginDeleteKeyAsync(String name) { return new PollerFlux<>(getDefaultPollingInterval(), - activationOperationAsync(name), - createPollOperationAsync(name), + activationOperation(name), + createPollOperation(name), (context, firstResponse) -> Mono.empty(), (context) -> Mono.empty()); } - public SyncPoller beginDeleteKey(String name, Context context) { - return SyncPoller.createPoller(getDefaultPollingInterval(), - cxt -> new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, - activationOperation(name, context).apply(cxt)), - createPollOperation(name, context), - (pollingContext, firstResponse) -> null, - (pollingContext) -> null); - } - - private Function, Mono> activationOperationAsync(String name) { - return (pollingContext) -> withContext(context -> deleteKeyWithResponseAsync(name, context)) + private Function, Mono> activationOperation(String name) { + return (pollingContext) -> withContext(context -> deleteKeyWithResponse(name, context)) .flatMap(deletedKeyResponse -> Mono.just(deletedKeyResponse.getValue())); } - private Function, DeletedKey> activationOperation(String name, Context context) { - return (pollingContext) -> deleteKeyWithResponse(name, context).getValue(); - } - /* - * Async polling operation to poll on create delete key operation status. + * Polling operation to poll on create delete key operation status. */ - private Function, Mono>> createPollOperationAsync(String keyName) { - return (pollingContext) -> + private Function, Mono>> createPollOperation(String keyName) { + return pollingContext -> withContext(context -> service.getDeletedKeyPollerAsync(vaultUrl, keyName, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context)) .flatMap(deletedKeyResponse -> { @@ -937,36 +922,7 @@ private Function, Mono>> cre pollingContext.getLatestResponse().getValue())); } - /** - * Sync polling operation to poll on the delete key operation status. - */ - private Function, PollResponse> createPollOperation(String keyName, - Context context) { - return (pollingContext) -> { - try { - Context contextToUse = context; - contextToUse = enableSyncRestProxy(contextToUse); - Response deletedKeyResponse = service.getDeletedKeyPoller(vaultUrl, keyName, - keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, contextToUse); - - if (deletedKeyResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { - return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, - pollingContext.getLatestResponse().getValue()); - } - - return new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - deletedKeyResponse.getValue()); - } catch (HttpResponseException e) { - // This means either vault has soft-delete disabled or permission is not granted for the get deleted key - // operation. In both cases deletion operation was successful when activation operation succeeded before - // reaching here. - return new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - pollingContext.getLatestResponse().getValue()); - } - }; - } - - private Mono> deleteKeyWithResponseAsync(String name, Context context) { + private Mono> deleteKeyWithResponse(String name, Context context) { return service.deleteKeyAsync(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> LOGGER.verbose("Deleting key - {}", name)) @@ -974,13 +930,6 @@ private Mono> deleteKeyWithResponseAsync(String name, Conte .doOnError(error -> LOGGER.warning("Failed to delete key - {}", name, error)); } - private Response deleteKeyWithResponse(String name, Context context) { - context = enableSyncRestProxy(context); - - return service.deleteKey(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, - CONTENT_TYPE_HEADER_VALUE, context); - } - public Mono> getDeletedKeyWithResponseAsync(String name, Context context) { return service.getDeletedKeyAsync(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1015,35 +964,22 @@ public Response purgeDeletedKeyWithResponse(String name, Context context) public PollerFlux beginRecoverDeletedKeyAsync(String name) { return new PollerFlux<>(getDefaultPollingInterval(), - recoverActivationOperationAsync(name), - createRecoverPollOperationAsync(name), + recoverActivationOperation(name), + createRecoverPollOperation(name), (context, firstResponse) -> Mono.empty(), context -> Mono.empty()); } - public SyncPoller beginRecoverDeletedKey(String name, Context context) { - return SyncPoller.createPoller(getDefaultPollingInterval(), - cxt -> new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, - recoverActivationOperation(name, context).apply(cxt)), - createRecoverPollOperation(name, context), - (pollingContext, firstResponse) -> null, - (pollingContext) -> null); - } - - private Function, Mono> recoverActivationOperationAsync(String name) { - return (pollingContext) -> withContext(context -> recoverDeletedKeyWithResponseAsync(name, context)) + private Function, Mono> recoverActivationOperation(String name) { + return (pollingContext) -> withContext(context -> recoverDeletedKeyWithResponse(name, context)) .flatMap(keyResponse -> Mono.just(keyResponse.getValue())); } - private Function, KeyVaultKey> recoverActivationOperation(String name, Context context) { - return (pollingContext) -> recoverDeletedKeyWithResponse(name, context).getValue(); - } - /* - * Async polling operation to poll on create delete key operation status. + * Polling operation to poll on create delete key operation status. */ - private Function, Mono>> createRecoverPollOperationAsync(String keyName) { - return (pollingContext) -> + private Function, Mono>> createRecoverPollOperation(String keyName) { + return pollingContext -> withContext(context -> service.getKeyPollerAsync(vaultUrl, keyName, "", keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context)) @@ -1062,35 +998,7 @@ private Function, Mono>> c pollingContext.getLatestResponse().getValue())); } - /** - * Sync polling operation to poll on the delete key operation status. - */ - private Function, PollResponse> createRecoverPollOperation(String keyName, Context context) { - return (pollingContext) -> { - try { - Context contextToUse = context; - contextToUse = enableSyncRestProxy(contextToUse); - Response keyResponse = - service.getKeyPoller(vaultUrl, keyName, "", keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, - CONTENT_TYPE_HEADER_VALUE, contextToUse); - - if (keyResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { - return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, - pollingContext.getLatestResponse().getValue()); - } - - return new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - keyResponse.getValue()); - } catch (HttpResponseException e) { - // This means permission is not granted for the get deleted key operation. In both cases the deletion - // operation was successful when activation operation succeeded before reaching here. - return new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - pollingContext.getLatestResponse().getValue()); - } - }; - } - - private Mono> recoverDeletedKeyWithResponseAsync(String name, Context context) { + private Mono> recoverDeletedKeyWithResponse(String name, Context context) { return service.recoverDeletedKeyAsync(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> LOGGER.verbose("Recovering deleted key - {}", name)) @@ -1098,13 +1006,6 @@ private Mono> recoverDeletedKeyWithResponseAsync(String na .doOnError(error -> LOGGER.warning("Failed to recover deleted key - {}", name, error)); } - private Response recoverDeletedKeyWithResponse(String name, Context context) { - context = enableSyncRestProxy(context); - - return service.recoverDeletedKey(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, - CONTENT_TYPE_HEADER_VALUE, context); - } - public Mono> backupKeyWithResponseAsync(String name, Context context) { return service.backupKeyAsync(vaultUrl, name, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1145,15 +1046,20 @@ public Response restoreKeyBackupWithResponse(byte[] backup, Context CONTENT_TYPE_HEADER_VALUE, context); } - public PagedFlux listPropertiesOfKeysAsync() { + public PagedFlux listPropertiesOfKeys() { try { - return new PagedFlux<>(() -> withContext(this::listKeysFirstPageAsync), - continuationToken -> withContext(context -> listKeysNextPageAsync(continuationToken, context))); + return new PagedFlux<>(() -> withContext(this::listKeysFirstPage), + continuationToken -> withContext(context -> listKeysNextPage(continuationToken, context))); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(LOGGER, ex)); } } + public PagedFlux listPropertiesOfKeys(Context context) { + return new PagedFlux<>(() -> listKeysFirstPage(context), + continuationToken -> listKeysNextPage(continuationToken, context)); + } + /** * Gets attributes of the first 25 keys that can be found on a given key vault. * @@ -1163,7 +1069,7 @@ public PagedFlux listPropertiesOfKeysAsync() { * @return A {@link Mono} of {@link PagedResponse} containing {@link KeyProperties} instances from the next page of * results. */ - private Mono> listKeysFirstPageAsync(Context context) { + private Mono> listKeysFirstPage(Context context) { try { return service.getKeysAsync(vaultUrl, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1176,8 +1082,8 @@ private Mono> listKeysFirstPageAsync(Context contex } /** - * Gets attributes of all the keys given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listPropertiesOfKeysAsync()}. + * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to + * {@link KeyClientImpl#listPropertiesOfKeys()}. * * @param continuationToken The {@link PagedResponse#getContinuationToken()} from a previous, successful call to one * of the list operations. @@ -1185,7 +1091,7 @@ private Mono> listKeysFirstPageAsync(Context contex * @return A {@link Mono} of {@link PagedResponse} containing {@link KeyProperties} instances from the next page of * results. */ - private Mono> listKeysNextPageAsync(String continuationToken, Context context) { + private Mono> listKeysNextPage(String continuationToken, Context context) { try { return service.getKeysAsync(vaultUrl, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1198,59 +1104,20 @@ private Mono> listKeysNextPageAsync(String continua } } - public PagedIterable listPropertiesOfKeys() { - return new PagedIterable<>( - () -> listKeysFirstPage(Context.NONE), - continuationToken -> listKeysNextPage(continuationToken, Context.NONE)); - } - - public PagedIterable listPropertiesOfKeys(Context context) { - return new PagedIterable<>( - () -> listKeysFirstPage(context), - continuationToken -> listKeysNextPage(continuationToken, context)); - } - - /** - * Gets attributes of the first 25 keys that can be found on a given key vault. - * - * @param context Additional {@link Context} that is passed through the {@link HttpPipeline} during the service - * call. - * - * @return A {@link PagedResponse} containing {@link KeyProperties} instances from the next page of results. - */ - private PagedResponse listKeysFirstPage(Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.getKeys(vaultUrl, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), - ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - - /** - * Gets attributes of all the keys given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listPropertiesOfKeys(Context)}. - * - * @param continuationToken The {@link PagedResponse#getContinuationToken()} from a previous, successful call to one - * of the list operations. - * - * @return A {@link PagedResponse} containing {@link KeyProperties} instances from the next page of results. - */ - private PagedResponse listKeysNextPage(String continuationToken, Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.getKeys(vaultUrl, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - - public PagedFlux listDeletedKeysAsync() { + public PagedFlux listDeletedKeys() { try { - return new PagedFlux<>(() -> withContext(this::listDeletedKeysFirstPageAsync), - continuationToken -> withContext(context -> listDeletedKeysNextPageAsync(continuationToken, context))); + return new PagedFlux<>(() -> withContext(this::listDeletedKeysFirstPage), + continuationToken -> withContext(context -> listDeletedKeysNextPage(continuationToken, context))); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(LOGGER, ex)); } } + public PagedFlux listDeletedKeys(Context context) { + return new PagedFlux<>(() -> listDeletedKeysFirstPage(context), + continuationToken -> listDeletedKeysNextPage(continuationToken, context)); + } + /** * Gets attributes of the first 25 deleted keys that can be found on a given key vault. * @@ -1260,7 +1127,7 @@ public PagedFlux listDeletedKeysAsync() { * @return A {@link Mono} of {@link PagedResponse} containing {@link KeyProperties} instances from the next page of * results. */ - private Mono> listDeletedKeysFirstPageAsync(Context context) { + private Mono> listDeletedKeysFirstPage(Context context) { try { return service.getDeletedKeysAsync(vaultUrl, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1273,8 +1140,8 @@ private Mono> listDeletedKeysFirstPageAsync(Context co } /** - * Gets attributes of all the keys given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listDeletedKeysAsync()}. + * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to + * {@link KeyClientImpl#listDeletedKeys()}. * * @param continuationToken The {@link PagedResponse#getContinuationToken()} from a previous, successful call to * one of the list operations. @@ -1282,7 +1149,7 @@ private Mono> listDeletedKeysFirstPageAsync(Context co * @return A {@link Mono} of {@link PagedResponse} containing {@link DeletedKey} instances from the next page of * results. */ - private Mono> listDeletedKeysNextPageAsync(String continuationToken, Context context) { + private Mono> listDeletedKeysNextPage(String continuationToken, Context context) { try { return service.getDeletedKeysAsync(vaultUrl, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1295,55 +1162,20 @@ private Mono> listDeletedKeysNextPageAsync(String cont } } - public PagedIterable listDeletedKeys() { - return new PagedIterable<>( - () -> listDeletedKeysFirstPage(Context.NONE), - continuationToken -> listDeletedKeysNextPage(continuationToken, Context.NONE)); - } - - public PagedIterable listDeletedKeys(Context context) { - return new PagedIterable<>( - () -> listDeletedKeysFirstPage(context), - continuationToken -> listDeletedKeysNextPage(continuationToken, context)); - } - - /** - * Gets attributes of the first 25 deleted keys that can be found on a given key vault. - * - * @param context Additional {@link Context} that is passed through the {@link HttpPipeline} during the service - * call. - * - * @return A {@link PagedResponse} containing {@link KeyProperties} instances from the next page of results. - */ - private PagedResponse listDeletedKeysFirstPage(Context context) { - return service.getDeletedKeys(vaultUrl, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), - ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - - /** - * Gets attributes of all the keys given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listDeletedKeys()}. - * - * @param continuationToken The {@link Page#getContinuationToken()} from a previous, successful call to one of the - * list operations. - * - * @return A {@link PagedResponse} that contains {@link DeletedKey} from the next page of results. - */ - private PagedResponse listDeletedKeysNextPage(String continuationToken, Context context) { - return service.getDeletedKeys(vaultUrl, continuationToken, ACCEPT_LANGUAGE, - CONTENT_TYPE_HEADER_VALUE, context); - } - - public PagedFlux listPropertiesOfKeyVersionsAsync(String name) { + public PagedFlux listPropertiesOfKeyVersions(String name) { try { - return new PagedFlux<>( - () -> withContext(context -> listKeyVersionsFirstPageAsync(name, context)), - continuationToken -> withContext(context -> listKeyVersionsNextPageAsync(continuationToken, context))); + return new PagedFlux<>(() -> withContext(context -> listKeyVersionsFirstPage(name, context)), + continuationToken -> withContext(context -> listKeyVersionsNextPage(continuationToken, context))); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(LOGGER, ex)); } } + public PagedFlux listPropertiesOfKeyVersions(String name, Context context) { + return new PagedFlux<>(() -> listKeyVersionsFirstPage(name, context), + continuationToken -> listKeyVersionsNextPage(continuationToken, context)); + } + /** * Gets attributes of the first 25 versions of a key. * @@ -1353,7 +1185,7 @@ public PagedFlux listPropertiesOfKeyVersionsAsync(String name) { * @return A {@link Mono} of {@link PagedResponse} containing {@link KeyProperties} instances from the next page of * results. */ - private Mono> listKeyVersionsFirstPageAsync(String name, Context context) { + private Mono> listKeyVersionsFirstPage(String name, Context context) { try { return service.getKeyVersionsAsync(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1366,8 +1198,8 @@ private Mono> listKeyVersionsFirstPageAsync(String } /** - * Gets attributes of versions of a key given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listPropertiesOfKeyVersionsAsync(String)}. + * Gets attributes of versions of a key given by the {@code nextPageLink} that was retrieved from a call to + * {@link KeyClientImpl#listPropertiesOfKeyVersions(String)}. * * @param continuationToken The {@link PagedResponse#getContinuationToken()} from a previous, successful call to one * of the list operations. @@ -1375,7 +1207,7 @@ private Mono> listKeyVersionsFirstPageAsync(String * @return A {@link Mono} of {@link PagedResponse} containing {@link KeyProperties} instances from the next page of * results. */ - private Mono> listKeyVersionsNextPageAsync(String continuationToken, Context context) { + private Mono> listKeyVersionsNextPage(String continuationToken, Context context) { try { return service.getKeysAsync(vaultUrl, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) @@ -1388,50 +1220,6 @@ private Mono> listKeyVersionsNextPageAsync(String c } } - public PagedIterable listPropertiesOfKeyVersions(String name) { - return new PagedIterable<>( - () -> listKeyVersionsFirstPage(name, Context.NONE), - continuationToken -> listKeyVersionsNextPage(continuationToken, Context.NONE)); - } - - public PagedIterable listPropertiesOfKeyVersions(String name, Context context) { - return new PagedIterable<>( - () -> listKeyVersionsFirstPage(name, context), - continuationToken -> listKeyVersionsNextPage(continuationToken, context)); - } - - /** - * Gets attributes of the first 25 versions of a key. - * - * @param context Additional {@link Context} that is passed through the {@link HttpPipeline} during the service - * call. - * - * @return A {@link PagedResponse} containing {@link KeyProperties} instances from the next page of results. - */ - private PagedResponse listKeyVersionsFirstPage(String name, Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.getKeyVersions(vaultUrl, name, DEFAULT_MAX_PAGE_RESULTS, keyServiceVersion.getVersion(), - ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - - /** - * Gets attributes of versions of a key given by the {@code continuationToken} that was retrieved from a call to - * {@link KeyClientImpl#listPropertiesOfKeyVersions(String)}. - * - * @param continuationToken The {@link PagedResponse#getContinuationToken()} from a previous, successful call to one - * of the list operations. - * - * @return A {@link PagedResponse} containing {@link KeyProperties} instances from the next page of results. - */ - private PagedResponse listKeyVersionsNextPage(String continuationToken, Context context) { - context = context == null ? Context.NONE : context; - context = enableSyncRestProxy(context); - - return service.getKeys(vaultUrl, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context); - } - public Mono> getRandomBytesWithResponseAsync(int count, Context context) { try { return service.getRandomBytesAsync(vaultUrl, keyServiceVersion.getVersion(), diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyVaultErrorCodeStrings.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyVaultErrorCodeStrings.java index 345878813a07f..9810a2e08c892 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyVaultErrorCodeStrings.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyVaultErrorCodeStrings.java @@ -3,8 +3,47 @@ package com.azure.security.keyvault.keys.implementation; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + public final class KeyVaultErrorCodeStrings { - public static final String CREDENTIALS_REQUIRED = "Azure Key Vault credentials are required."; - public static final String VAULT_END_POINT_REQUIRED = "Azure Key Vault endpoint url is required."; - public static final String PARAMETER_REQUIRED = "%s cannot be null."; + static final String ERROR_STRINGS_FILE_NAME = "kvErrorStrings.properties"; + private static Properties errorStrings; + + /** + * The property name of Azure Key Vault Credentials required error string. + */ + public static final String CREDENTIAL_REQUIRED = "credential_required"; + + /** + * The property name of Azure Key Vault Endpoint required error string. + */ + public static final String VAULT_END_POINT_REQUIRED = "vault_endpoint_required"; + + /** + * Gets the error String for the specified property. + * + * @param propertyName the property name for which error string is required. + * @return The {@link String value} containing the error message. + */ + public static String getErrorString(String propertyName) { + loadProperties(); + return errorStrings.getProperty(propertyName); + } + + private static synchronized void loadProperties() { + if (errorStrings == null) { + try (InputStream fileInputStream = + KeyVaultErrorCodeStrings.class.getClassLoader().getResource((ERROR_STRINGS_FILE_NAME)).openStream()) { + errorStrings = new Properties(); + errorStrings.load(fileInputStream); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } } + + + diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/resources/kvErrorStrings.properties b/sdk/keyvault/azure-security-keyvault-keys/src/main/resources/kvErrorStrings.properties new file mode 100644 index 0000000000000..ff2560ce762e6 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/resources/kvErrorStrings.properties @@ -0,0 +1,2 @@ +credential_required=Azure Key Vault credentials are required. +vault_endpoint_required=Azure Key Vault endpoint url is required. diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java index 9bad06010a1c3..dd127400fc4d0 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java @@ -94,14 +94,14 @@ public void createKey() { System.out.printf("Created key with name: %s and id: %s%n", ecKey.getName(), ecKey.getId()); // END: com.azure.security.keyvault.keys.KeyClient.createEcKey#CreateOctKeyOptions - // BEGIN: com.azure.security.keyvault.keys.KeyClient.createOctKey#CreateOctKeyOptions + // BEGIN: com.azure.security.keyvault.keys.async.KeyClient.createOctKey#CreateOctKeyOptions CreateOctKeyOptions createOctKeyOptions = new CreateOctKeyOptions("keyName") .setNotBefore(OffsetDateTime.now().plusDays(1)) .setExpiresOn(OffsetDateTime.now().plusYears(1)); KeyVaultKey octKey = keyClient.createOctKey(createOctKeyOptions); System.out.printf("Created key with name: %s and id: %s%n", octKey.getName(), octKey.getId()); - // END: com.azure.security.keyvault.keys.KeyClient.createOctKey#CreateOctKeyOptions + // END: com.azure.security.keyvault.keys.async.KeyClient.createOctKey#CreateOctKeyOptions } /** @@ -214,7 +214,7 @@ public void createKeyWithResponse() { createEcKeyResponse.getValue().getId()); // END: com.azure.security.keyvault.keys.KeyClient.createEcKeyWithResponse#CreateEcKeyOptions-Context - // BEGIN: com.azure.security.keyvault.keys.KeyClient.createOctKey#CreateOctKeyOptions-Context + // BEGIN: com.azure.security.keyvault.keys.async.KeyClient.createOctKey#CreateOctKeyOptions-Context CreateOctKeyOptions createOctKeyOptions = new CreateOctKeyOptions("keyName") .setNotBefore(OffsetDateTime.now().plusDays(1)) .setExpiresOn(OffsetDateTime.now().plusYears(1)); @@ -223,7 +223,7 @@ public void createKeyWithResponse() { System.out.printf("Created key with name: %s and: id %s%n", createOctKeyResponse.getValue().getName(), createOctKeyResponse.getValue().getId()); - // END: com.azure.security.keyvault.keys.KeyClient.createOctKey#CreateOctKeyOptions-Context + // END: com.azure.security.keyvault.keys.async.KeyClient.createOctKey#CreateOctKeyOptions-Context } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java index f803dc05011d0..7d394849f669c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java @@ -7,7 +7,10 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpRequest; import com.azure.core.test.TestMode; +import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.Context; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; @@ -38,8 +41,8 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; +import java.util.function.BiFunction; -import static com.azure.security.keyvault.keys.TestUtils.buildAsyncAssertingClient; import static com.azure.security.keyvault.keys.cryptography.TestHelper.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -74,6 +77,20 @@ protected void createKeyAsyncClient(HttpClient httpClient, KeyServiceVersion ser keyAsyncClient = new KeyAsyncClient(implClient); } + private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { + //skip paging and polling requests until their sync stack support is landed in azure-core. + BiFunction skipRequestFunction = (request, context) -> { + String callerMethod = (String) context.getData("caller-method").orElse(""); + return (callerMethod.contains("list") || callerMethod.contains("getKeys") + || callerMethod.contains("getKeyVersions") || callerMethod.contains("delete") + || callerMethod.contains("recover") || callerMethod.contains("Cryptography")); + }; + return new AssertingHttpClientBuilder(httpClient) + .skipRequest(skipRequestFunction) + .assertAsync() + .build(); + } + /** * Tests that a key can be created in the key vault. */ diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java index 2ce397ad240b4..ddc703e23479c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java @@ -7,7 +7,10 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpRequest; import com.azure.core.test.TestMode; +import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.Context; import com.azure.core.util.polling.PollResponse; import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.keys.cryptography.CryptographyClient; @@ -35,8 +38,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.function.BiFunction; -import static com.azure.security.keyvault.keys.TestUtils.buildSyncAssertingClient; import static com.azure.security.keyvault.keys.cryptography.TestHelper.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -72,6 +75,20 @@ protected void createKeyClient(HttpClient httpClient, KeyServiceVersion serviceV keyClient = new KeyClient(implClient); } + private HttpClient buildSyncAssertingClient(HttpClient httpClient) { + //skip paging and polling requests until their sync stack support is landed in azure-core. + BiFunction skipRequestFunction = (request, context) -> { + String callerMethod = (String) context.getData("caller-method").orElse(""); + return (callerMethod.contains("list") || callerMethod.contains("getKeys") + || callerMethod.contains("getKeyVersions") || callerMethod.contains("delete") + || callerMethod.contains("recover") || callerMethod.contains("Cryptography")); + }; + return new AssertingHttpClientBuilder(httpClient) + .skipRequest(skipRequestFunction) + .assertSync() + .build(); + } + /** * Tests that a key can be created in the key vault. */ diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/TestUtils.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/TestUtils.java index 2b3688e2f8d58..279f3e220a4f8 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/TestUtils.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/TestUtils.java @@ -5,13 +5,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.credential.TokenCredential; import com.azure.core.credential.TokenRequestContext; -import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipelineCallContext; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.HttpResponse; import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.test.http.AssertingHttpClientBuilder; import reactor.core.publisher.Mono; import java.time.OffsetDateTime; @@ -55,16 +53,4 @@ public Mono getToken(TokenRequestContext request) { return Mono.just(new AccessToken("TestAccessToken", OffsetDateTime.now().plusHours(1))); } } - - public static HttpClient buildSyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient) - .assertSync() - .build(); - } - - public static HttpClient buildAsyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient) - .assertAsync() - .build(); - } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilderTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilderTest.java index 59a0089e35fd7..79108eb5f75c8 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilderTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientBuilderTest.java @@ -82,7 +82,7 @@ public void buildSyncClientWithPortInKeyIdentifierTest() { assertNotNull(cryptographyClient); assertEquals(CryptographyClient.class.getSimpleName(), cryptographyClient.getClass().getSimpleName()); - assertTrue(cryptographyClient.getImplClient().getVaultUrl().contains(":443")); + assertTrue(cryptographyClient.getServiceClient().getVaultUrl().contains(":443")); } @Test diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java index d4e2687b65cb5..d421a9283cfdc 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java @@ -5,6 +5,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; +import com.azure.core.util.Context; import com.azure.security.keyvault.keys.KeyClient; import com.azure.security.keyvault.keys.KeyClientBuilder; import com.azure.security.keyvault.keys.cryptography.models.EncryptParameters; @@ -33,7 +34,6 @@ import java.util.Map; import java.util.Random; -import static com.azure.security.keyvault.keys.TestUtils.buildSyncAssertingClient; import static com.azure.security.keyvault.keys.cryptography.TestHelper.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -49,18 +49,15 @@ protected void beforeTest() { } private void initializeKeyClient(HttpClient httpClient) { - pipeline = getHttpPipeline(buildSyncAssertingClient( - interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient)); + pipeline = getHttpPipeline(httpClient); client = new KeyClientBuilder() .pipeline(pipeline) .vaultUrl(getEndpoint()) .buildClient(); } - private CryptographyClient initializeCryptographyClient(String keyId, HttpClient httpClient, - CryptographyServiceVersion serviceVersion) { - pipeline = getHttpPipeline(buildSyncAssertingClient( - interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient)); + private CryptographyClient initializeCryptographyClient(String keyId, HttpClient httpClient, CryptographyServiceVersion serviceVersion) { + pipeline = getHttpPipeline(httpClient); return new CryptographyClientBuilder() .pipeline(pipeline) @@ -78,11 +75,10 @@ public void encryptDecryptRsa(HttpClient httpClient, CryptographyServiceVersion JsonWebKey key = JsonWebKey.fromRsa(keyPair); String keyName = testResourceNamer.randomName("testRsaKey", 20); KeyVaultKey importedKey = client.importKey(keyName, key); - CryptographyClient cryptoClient = - initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); + CryptographyClient cryptoClient = initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); + CryptographyServiceClient serviceClient = cryptoClient.getServiceClient(); - List algorithms = Arrays.asList(EncryptionAlgorithm.RSA1_5, - EncryptionAlgorithm.RSA_OAEP, EncryptionAlgorithm.RSA_OAEP_256); + List algorithms = Arrays.asList(EncryptionAlgorithm.RSA1_5, EncryptionAlgorithm.RSA_OAEP, EncryptionAlgorithm.RSA_OAEP_256); for (EncryptionAlgorithm algorithm : algorithms) { // Test variables @@ -91,11 +87,11 @@ public void encryptDecryptRsa(HttpClient httpClient, CryptographyServiceVersion new Random(0x1234567L).nextBytes(plaintext); byte[] ciphertext = cryptoClient.encrypt(algorithm, plaintext).getCipherText(); - byte[] decryptedText = cryptoClient.decrypt(algorithm, ciphertext).getPlainText(); + byte[] decryptedText = serviceClient.decrypt(algorithm, ciphertext, Context.NONE).block().getPlainText(); assertArrayEquals(decryptedText, plaintext); - ciphertext = cryptoClient.encrypt(algorithm, plaintext).getCipherText(); + ciphertext = serviceClient.encrypt(algorithm, plaintext, Context.NONE).block().getCipherText(); decryptedText = cryptoClient.decrypt(algorithm, ciphertext).getPlainText(); assertArrayEquals(decryptedText, plaintext); @@ -108,8 +104,7 @@ public void encryptDecryptRsaLocal() throws Exception { encryptDecryptRsaRunner(keyPair -> { JsonWebKey key = JsonWebKey.fromRsa(keyPair, Arrays.asList(KeyOperation.ENCRYPT, KeyOperation.DECRYPT)); CryptographyClient cryptoClient = initializeCryptographyClient(key); - List algorithms = - Arrays.asList(EncryptionAlgorithm.RSA1_5, EncryptionAlgorithm.RSA_OAEP); + List algorithms = Arrays.asList(EncryptionAlgorithm.RSA1_5, EncryptionAlgorithm.RSA_OAEP); for (EncryptionAlgorithm algorithm : algorithms) { // Test variables @@ -134,10 +129,9 @@ public void wrapUnwrapRsa(HttpClient httpClient, CryptographyServiceVersion serv JsonWebKey key = JsonWebKey.fromRsa(keyPair); String keyName = testResourceNamer.randomName("testRsaKeyWrapUnwrap", 25); KeyVaultKey importedKey = client.importKey(keyName, key); - CryptographyClient cryptoClient = - initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); - List algorithms = Arrays.asList(KeyWrapAlgorithm.RSA1_5, KeyWrapAlgorithm.RSA_OAEP, - KeyWrapAlgorithm.RSA_OAEP_256); + CryptographyClient cryptoClient = initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); + CryptographyServiceClient serviceClient = cryptoClient.getServiceClient(); + List algorithms = Arrays.asList(KeyWrapAlgorithm.RSA1_5, KeyWrapAlgorithm.RSA_OAEP, KeyWrapAlgorithm.RSA_OAEP_256); for (KeyWrapAlgorithm algorithm : algorithms) { // Test variables @@ -146,11 +140,11 @@ public void wrapUnwrapRsa(HttpClient httpClient, CryptographyServiceVersion serv new Random(0x1234567L).nextBytes(plaintext); byte[] encryptedKey = cryptoClient.wrapKey(algorithm, plaintext).getEncryptedKey(); - byte[] decryptedKey = cryptoClient.unwrapKey(algorithm, encryptedKey).getKey(); + byte[] decryptedKey = serviceClient.unwrapKey(algorithm, encryptedKey, Context.NONE).block().getKey(); assertArrayEquals(decryptedKey, plaintext); - encryptedKey = cryptoClient.wrapKey(algorithm, plaintext).getEncryptedKey(); + encryptedKey = serviceClient.wrapKey(algorithm, plaintext, Context.NONE).block().getEncryptedKey(); decryptedKey = cryptoClient.unwrapKey(algorithm, encryptedKey).getKey(); assertArrayEquals(decryptedKey, plaintext); @@ -202,8 +196,7 @@ public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion servi curveToSpec.put(KeyCurveName.P_521, "secp521r1"); curveToSpec.put(KeyCurveName.P_256K, "secp256k1"); - List curveList = - Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K); + List curveList = Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K); String algorithmName = "EC"; Provider[] providers = Security.getProviders(); Provider provider = null; @@ -234,8 +227,8 @@ public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion servi JsonWebKey key = JsonWebKey.fromEc(keyPair, provider); String keyName = testResourceNamer.randomName("testEcKey" + crv.toString(), 20); KeyVaultKey imported = client.importKey(keyName, key); - CryptographyClient cryptoClient = - initializeCryptographyClient(imported.getId(), httpClient, serviceVersion); + CryptographyClient cryptoClient = initializeCryptographyClient(imported.getId(), httpClient, serviceVersion); + CryptographyServiceClient serviceClient = cryptoClient.getServiceClient(); byte[] plaintext = new byte[100]; @@ -243,12 +236,11 @@ public void signVerifyEc(HttpClient httpClient, CryptographyServiceVersion servi byte[] signature = cryptoClient.signData(curveToSignature.get(crv), plaintext).getSignature(); - Boolean verifyStatus = - cryptoClient.verifyData(curveToSignature.get(crv), plaintext, signature).isValid(); + Boolean verifyStatus = serviceClient.verifyData(curveToSignature.get(crv), plaintext, signature, Context.NONE).block().isValid(); assertTrue(verifyStatus); - signature = cryptoClient.signData(curveToSignature.get(crv), plaintext).getSignature(); + signature = serviceClient.signData(curveToSignature.get(crv), plaintext, Context.NONE).block().getSignature(); verifyStatus = cryptoClient.verifyData(curveToSignature.get(crv), plaintext, signature).isValid(); if (!interceptorManager.isPlaybackMode()) { @@ -266,10 +258,9 @@ public void signVerifyRsa(HttpClient httpClient, CryptographyServiceVersion serv JsonWebKey key = JsonWebKey.fromRsa(keyPair); String keyName = testResourceNamer.randomName("testRsaKeySignVerify", 25); KeyVaultKey importedKey = client.importKey(keyName, key); - CryptographyClient cryptoClient = - initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); - List algorithms = - Arrays.asList(SignatureAlgorithm.RS256, SignatureAlgorithm.RS384, SignatureAlgorithm.RS512); + CryptographyClient cryptoClient = initializeCryptographyClient(importedKey.getId(), httpClient, serviceVersion); + CryptographyServiceClient serviceClient = cryptoClient.getServiceClient(); + List algorithms = Arrays.asList(SignatureAlgorithm.RS256, SignatureAlgorithm.RS384, SignatureAlgorithm.RS512); for (SignatureAlgorithm algorithm : algorithms) { // Test variables @@ -278,11 +269,11 @@ public void signVerifyRsa(HttpClient httpClient, CryptographyServiceVersion serv new Random(0x1234567L).nextBytes(plaintext); byte[] signature = cryptoClient.signData(algorithm, plaintext).getSignature(); - Boolean verifyStatus = cryptoClient.verifyData(algorithm, plaintext, signature).isValid(); + Boolean verifyStatus = serviceClient.verifyData(algorithm, plaintext, signature, Context.NONE).block().isValid(); assertTrue(verifyStatus); - signature = cryptoClient.signData(algorithm, plaintext).getSignature(); + signature = serviceClient.signData(algorithm, plaintext, Context.NONE).block().getSignature(); verifyStatus = cryptoClient.verifyData(algorithm, plaintext, signature).isValid(); assertTrue(verifyStatus); @@ -307,8 +298,7 @@ public void signVerifyEcLocal() throws NoSuchAlgorithmException, InvalidAlgorith curveToSpec.put(KeyCurveName.P_521, "secp521r1"); curveToSpec.put(KeyCurveName.P_256K, "secp256k1"); - List curveList = - Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K); + List curveList = Arrays.asList(KeyCurveName.P_256, KeyCurveName.P_384, KeyCurveName.P_521, KeyCurveName.P_256K); String algorithmName = "EC"; Provider[] providers = Security.getProviders(); Provider provider = null; @@ -337,8 +327,7 @@ public void signVerifyEcLocal() throws NoSuchAlgorithmException, InvalidAlgorith KeyPair keyPair = generator.generateKeyPair(); - JsonWebKey key = - JsonWebKey.fromEc(keyPair, provider, Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY)); + JsonWebKey key = JsonWebKey.fromEc(keyPair, provider, Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY)); CryptographyClient cryptoClient = initializeCryptographyClient(key); byte[] plainText = new byte[100]; diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java index e7817bfbaed98..f0259fefd1ece 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/KeyEncryptionKeyClientTest.java @@ -6,7 +6,9 @@ import com.azure.core.cryptography.KeyEncryptionKey; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; +import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; +import com.azure.security.keyvault.keys.cryptography.implementation.CryptographyService; import com.azure.security.keyvault.keys.cryptography.implementation.SecretKey; import com.azure.security.keyvault.keys.models.JsonWebKey; import com.azure.security.keyvault.keys.models.KeyOperation; @@ -18,7 +20,6 @@ import java.util.Arrays; import java.util.Base64; -import static com.azure.security.keyvault.keys.TestUtils.buildSyncAssertingClient; import static com.azure.security.keyvault.keys.cryptography.TestHelper.DISPLAY_NAME_WITH_ARGUMENTS; import static org.junit.jupiter.api.Assertions.assertArrayEquals; @@ -32,14 +33,14 @@ protected void beforeTest() { } private void setupSecretKeyAndClient(byte[] kek, HttpClient httpClient, CryptographyServiceVersion serviceVersion) { - HttpPipeline pipeline = getHttpPipeline(buildSyncAssertingClient( - interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient)); + HttpPipeline pipeline = getHttpPipeline(httpClient); if (secretKey == null) { - CryptographyClientImpl implClient = - new CryptographyClientImpl(getEndpoint(), pipeline, serviceVersion); - secretKey = implClient.setSecretKey(new SecretKey(testResourceNamer.randomName("secretKey", 20), - Base64.getEncoder().encodeToString(kek)), Context.NONE).getValue(); + CryptographyServiceClient serviceClient = + new CryptographyServiceClient(getEndpoint(), RestProxy.create(CryptographyService.class, pipeline), + serviceVersion); + secretKey = serviceClient.setSecretKey(new SecretKey(testResourceNamer.randomName("secretKey", 20), + Base64.getEncoder().encodeToString(kek)), Context.NONE).block().getValue(); keyEncryptionKey = new KeyEncryptionKeyClientBuilder() .pipeline(pipeline) .serviceVersion(serviceVersion) diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcPadLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcPadLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes128CbcPadLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcPadLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcPadLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes192CbcPadLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcPadLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcPadLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptAes256CbcPadLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsaLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsaLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsaLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsa[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsa[1].json new file mode 100644 index 0000000000000..b5d2ac3a7adea --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.encryptDecryptRsa[1].json @@ -0,0 +1,509 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:38 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fffeff9e-49cc-4edc-af3b-5711ad9fffbd" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "1902", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "key": { + "kty": "RSA", + "key_ops": [], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB", + "d": "UulbjVtdXTpxO-hl9FviHZmVXxNgqtJx7J2shQlPXClq_KG4CJXJtSVg2tLZnCki7CCrOTHLOoQArPkpltj-aGWJxDYkDhXnVTdtki9I-BDgW6aWAI5BfWJM5asziLDkkFvaz06SeQKqOp3iYKKm3-fjnXv42uMHh0kuew1E0fXRVTGHBL0wgOJfQTbL1yfQ_A2Qe9bNkr9TFWx3ireY7D8MzDZIN1_h66t2UPuHFq2OqIbVBTRlZEHihNZirfNjbk8e47ImZqDd1dpyVKLgmdejdg_aWCxH61TG1iKP8qWQ61pRENwaJ6804Io_mH0JVp2nl0K3hfmhSzTeBj7V4Q", + "dp": "cY-_W0rXJ5b3fiZaLzNXot0xH1bs-tLpePdfdPj1cJSXN9bujvF8zeh5e7DnJrG5mK05F9bAiIpDyLqUmNb5PaGDSrooMae08D7dU06n3-pQ1X9MS3eeJ-w3hBUnTHkzgAhwi_UZ4ty-hsIqOZ0FHMvwSRAAhV8aHB-MR4tKbRE", + "dq": "cs6ABkG5NF38KZ0F7KVReUBGxJxVUM2YTZFZayUrMMJZNpnFKnN_P8i7ar222utYz8PewkMQffwj6-4F4ETeMUq8NjlE7Ge9mSDoPNjvEde0lct1s4HLrRb6AlLQ4dRdnUCIW4VCybFOy_h7CH2KtElLEAwAjy4NYNSFGRIcqZE", + "qi": "AxKlWeYxM4LeyHiRbwn4IgypPbdnHql53fJy9xAkkIJxVV3Ry2lI0otUo64n2QKDZ3eF3ta2EjZtsAL0bM9AkT_-2ZXDdJk5viHQ0DOejWEjPYFgMxOIt-gEpG-QCJXFFL-OLJXOsnV1DAG_ELbAoy33am82ydDfy4gpMhL51sQ", + "p": "-TZjzm_whbXKjamp6gizCmWHaTLIz2CpoCLFvw-E6p8HlN2yjsdjFuGu-h9u0V_xRsMMuvDqh3bzVryQulsWvReHrshFgHHlL46NSdLVrOcc3pqW02O5xcxJp6TAlGf2nY5wx3jQrmGHeH8mtcro-ThG87oiD37LomfmAFbWCJs", + "q": "3eCaCf5Cdq6WDzaGMQx-qhDdcGSRzFcgNLxjtpTIGQtv0WYZzgOuhh5TmHbOSyGCPTqbsfSPp1Es8NVStBGIXKaEEo1MieITOgylywdcHQKAg2qVPUXYqQ-kg4sDE8-XK1dF5e_3x1JP9JSHrlo8mnx7Hz0s7x37YvYaPOK61vE" + }, + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "299ca0d0-b51e-4183-9822-b6693894fa7b" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ff60b163-4bc1-45cb-932a-bf9c4d39602f" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "BUc5KaThKG_ispPJk-DizIwnWvHGWhvZbjPpl-WIGB9vvqQk5Ws4be3qwtcpdjeIkKdFKtarwWI11ritz5tKI2IaGYLvjdvTIaV2DUH74p0rbCu0hY7i7cmnwbitWB4YlPNzggaVw85d8obseOk9SruLjHUJ0TimnSISAnORi5ip6ONfIubSlf8erOVYsP9rIDN2EyKRXfheFQp-KqkvwxyWaPfsw-Av7jBfgJmNpfQIDerpJc-WsZdVvrYwkRusRJylzdfLuXXI_u0YtmOI7N5mu9YULxFNmCQ-R0p3c5QibXipMpdPsXm1sbj5ZMLNoCmYr8Aki-K2cnmb2ppNfA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "644ba66b-e84e-4b08-95fa-b7ecf294f8b0" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/encrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "161", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3b889f1b-037b-475e-9f03-3887a6c5a827" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "Zp3T45I2walEMnjk6PUUFMchXajF-7tyi952G6KMvmPv0SVClt9sVpam5qx4FPTwV-bWKI9k5l-gCZxw9KX17yHyHIb8EJKS4a10hpEkE2F3uDBHQZ5Jiq9VkOq3smmpZYPUvb837-UpjnGqapYYFpRpU2YeB9UjzIwtFxTm73JAtrN9AveJWd7BZjrjvPYbkShwyg2S0P-dpwWbSF1oHScXZKzdPAAR6HCK7yBXZ3LB3xGbWykKpTN-CaTMkFYVSFNqlFLJCcDrcEEVx9qO_VB3kjR-sDGNKAYfSmFcrJGkmNUMiPBasRlrUyYZi8H5zvJwQFpPZGKHBQ_ZHlFC9w" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "Zp3T45I2walEMnjk6PUUFMchXajF-7tyi952G6KMvmPv0SVClt9sVpam5qx4FPTwV-bWKI9k5l-gCZxw9KX17yHyHIb8EJKS4a10hpEkE2F3uDBHQZ5Jiq9VkOq3smmpZYPUvb837-UpjnGqapYYFpRpU2YeB9UjzIwtFxTm73JAtrN9AveJWd7BZjrjvPYbkShwyg2S0P-dpwWbSF1oHScXZKzdPAAR6HCK7yBXZ3LB3xGbWykKpTN-CaTMkFYVSFNqlFLJCcDrcEEVx9qO_VB3kjR-sDGNKAYfSmFcrJGkmNUMiPBasRlrUyYZi8H5zvJwQFpPZGKHBQ_ZHlFC9w" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "15c2f232-1dd1-4fad-b414-e2e3edb2e25a" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "FIfmP1BcfzfMLYXXW1N0FesOhwoRydQDTtMHUIJkx8krx--dWT1uSHzBfCVTC9lChb_AQ0mSxaJph8xgfAc8qLClBGMvnt9xkSIcQQkTZOyAGggxR1-Cwldp_e9MgjyuSiXsQyCGrIf-Yp-fcfiFzgRXnzNMFdv6keUUzi9r8fwOsOVIdeIHhkqMQ1k2dQkhfhjBE4mmfJdG6AA42bFn_HA2d3sNqrx7Q8hckfPmbAfZ8JSWbi4XL7kU3q0rCNbfnvPbeD2A9kaT4ITx7Id9_gA-0_2Nzb8J7iQsYQJDaGCBXGEnrQTiv0lEIPaAElljSkVic1HrY6nPmP_66wWo1A" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e3786747-e061-4115-8432-760979d94ae1" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/encrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "163", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8042fa8d-8011-4c95-bf9b-4eeeb090a248" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "KfuUsOakS_n3GPtS0fK8dWuU1XJImoBYXEdOeMy4Z_wqLnowia87gE_JuUIE8J9C3iLMDjb_S8AdLB9KhwTvuNQaiOFO-u6yiJOkGwXnDz2L8818-xtXwhjWpeWaq7RlYPWVGlpswQPHXw9nYoRSdom6-R--opxpR1UG1l6qsKtuO9zziau4cWh_j3au3SMjIFlPNqQOULNVc_dWV5Xw-HMTnc4BldGpIqfEQwH-4680Z8ADLymq2DpYiAaWamXX4xvJdfGdKrNRHquayX5KNb6wW8BWqJWKIJYbKXrJfRSV80qWy9cKBKmCAHEh-3RfgLwkEY1oH3oHjmS1bhAtuA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "KfuUsOakS_n3GPtS0fK8dWuU1XJImoBYXEdOeMy4Z_wqLnowia87gE_JuUIE8J9C3iLMDjb_S8AdLB9KhwTvuNQaiOFO-u6yiJOkGwXnDz2L8818-xtXwhjWpeWaq7RlYPWVGlpswQPHXw9nYoRSdom6-R--opxpR1UG1l6qsKtuO9zziau4cWh_j3au3SMjIFlPNqQOULNVc_dWV5Xw-HMTnc4BldGpIqfEQwH-4680Z8ADLymq2DpYiAaWamXX4xvJdfGdKrNRHquayX5KNb6wW8BWqJWKIJYbKXrJfRSV80qWy9cKBKmCAHEh-3RfgLwkEY1oH3oHjmS1bhAtuA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7516e2ca-9439-4e79-a781-2b34324b3ee9" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/encrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "167", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9725f134-1385-43bb-b078-175c1011d973" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "v8vD4IULI0dklvAefxUnZl8BcpGnLhuSaWoXrcrN0Ev9nerd9WgDEk_UMOFLexCODRlZ-zsjICGCK7D47t1fieZxY1VZHmBan7ZHST01akh68buZDphMS3_8gJdmF0go5-GGmgWL78iZqMVrLMZnDUUv4qQ8J6o3Zx6_Olphehlrdz6tVsZuI3Pq_tk6oXxiE31e4vgwQDL4XnzvQw5kHl29CUg9cbGqjQZpeOAQ9BdbyNKu-XfHIEqyEH2tKvThDRTwS0Qo5mkmTWL5_aSaIkEIWxu1FjkrE-gls2_l6nYDq_frII6eO9aQg51GT_ajIL-LfuZnRuxAHTj9IwrjBQ" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "375", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "v8vD4IULI0dklvAefxUnZl8BcpGnLhuSaWoXrcrN0Ev9nerd9WgDEk_UMOFLexCODRlZ-zsjICGCK7D47t1fieZxY1VZHmBan7ZHST01akh68buZDphMS3_8gJdmF0go5-GGmgWL78iZqMVrLMZnDUUv4qQ8J6o3Zx6_Olphehlrdz6tVsZuI3Pq_tk6oXxiE31e4vgwQDL4XnzvQw5kHl29CUg9cbGqjQZpeOAQ9BdbyNKu-XfHIEqyEH2tKvThDRTwS0Qo5mkmTWL5_aSaIkEIWxu1FjkrE-gls2_l6nYDq_frII6eO9aQg51GT_ajIL-LfuZnRuxAHTj9IwrjBQ" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8cc0805a-42ef-4c4a-a285-f6f063f08e47" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/encrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "167", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7f31440c-b4f4-48a0-97c7-c79b10890cd6" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "xQfSuDQTS4LW6YrccKpdt5yRtvZKm3WkrR7RuU6jfzYoYvLTvHw9G5VQF6FPGuUqpKlY_8dvpHshKUl72Qjvf9bcwpny52W3nvEmcC51brzsM009VuraJFcAOdI4ycIIadcEWGfkiM_ze_IljYxgr3C9G5Y9mkcJu3ivMp9k0-CGXH0OPP7og_Nvfte-yZo6Ultgcwn0sg8KhWBao4t0nVufIZNlHXkYg3nb_Czr8scfA8wItAeVvYHOmwvVbxX4o3oK9mQzrgvt5MvXrmjoxTYBOf0D-FE2f-Hk7jJGCAG5oNRIdmTSIr42peznsFDnQxOMVlU5hvwb3rge3Bqo2w" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927/decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "375", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "xQfSuDQTS4LW6YrccKpdt5yRtvZKm3WkrR7RuU6jfzYoYvLTvHw9G5VQF6FPGuUqpKlY_8dvpHshKUl72Qjvf9bcwpny52W3nvEmcC51brzsM009VuraJFcAOdI4ycIIadcEWGfkiM_ze_IljYxgr3C9G5Y9mkcJu3ivMp9k0-CGXH0OPP7og_Nvfte-yZo6Ultgcwn0sg8KhWBao4t0nVufIZNlHXkYg3nb_Czr8scfA8wItAeVvYHOmwvVbxX4o3oK9mQzrgvt5MvXrmjoxTYBOf0D-FE2f-Hk7jJGCAG5oNRIdmTSIr42peznsFDnQxOMVlU5hvwb3rge3Bqo2w" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "250", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "57da7ecd-1cce-4e04-8a3c-90937372eb28" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakey47643f3/b7ddc9e185464573867c10677b285927", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + } + ], + "Variables": { + "0": "testrsakey47643f3" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.signVerifyRsa[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.signVerifyRsa[1].json new file mode 100644 index 0000000000000..6411fe11e14f4 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.signVerifyRsa[1].json @@ -0,0 +1,579 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:38 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6ae6fe08-e0c2-435e-9e11-22f360701321" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "1902", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "key": { + "kty": "RSA", + "key_ops": [], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB", + "d": "UulbjVtdXTpxO-hl9FviHZmVXxNgqtJx7J2shQlPXClq_KG4CJXJtSVg2tLZnCki7CCrOTHLOoQArPkpltj-aGWJxDYkDhXnVTdtki9I-BDgW6aWAI5BfWJM5asziLDkkFvaz06SeQKqOp3iYKKm3-fjnXv42uMHh0kuew1E0fXRVTGHBL0wgOJfQTbL1yfQ_A2Qe9bNkr9TFWx3ireY7D8MzDZIN1_h66t2UPuHFq2OqIbVBTRlZEHihNZirfNjbk8e47ImZqDd1dpyVKLgmdejdg_aWCxH61TG1iKP8qWQ61pRENwaJ6804Io_mH0JVp2nl0K3hfmhSzTeBj7V4Q", + "dp": "cY-_W0rXJ5b3fiZaLzNXot0xH1bs-tLpePdfdPj1cJSXN9bujvF8zeh5e7DnJrG5mK05F9bAiIpDyLqUmNb5PaGDSrooMae08D7dU06n3-pQ1X9MS3eeJ-w3hBUnTHkzgAhwi_UZ4ty-hsIqOZ0FHMvwSRAAhV8aHB-MR4tKbRE", + "dq": "cs6ABkG5NF38KZ0F7KVReUBGxJxVUM2YTZFZayUrMMJZNpnFKnN_P8i7ar222utYz8PewkMQffwj6-4F4ETeMUq8NjlE7Ge9mSDoPNjvEde0lct1s4HLrRb6AlLQ4dRdnUCIW4VCybFOy_h7CH2KtElLEAwAjy4NYNSFGRIcqZE", + "qi": "AxKlWeYxM4LeyHiRbwn4IgypPbdnHql53fJy9xAkkIJxVV3Ry2lI0otUo64n2QKDZ3eF3ta2EjZtsAL0bM9AkT_-2ZXDdJk5viHQ0DOejWEjPYFgMxOIt-gEpG-QCJXFFL-OLJXOsnV1DAG_ELbAoy33am82ydDfy4gpMhL51sQ", + "p": "-TZjzm_whbXKjamp6gizCmWHaTLIz2CpoCLFvw-E6p8HlN2yjsdjFuGu-h9u0V_xRsMMuvDqh3bzVryQulsWvReHrshFgHHlL46NSdLVrOcc3pqW02O5xcxJp6TAlGf2nY5wx3jQrmGHeH8mtcro-ThG87oiD37LomfmAFbWCJs", + "q": "3eCaCf5Cdq6WDzaGMQx-qhDdcGSRzFcgNLxjtpTIGQtv0WYZzgOuhh5TmHbOSyGCPTqbsfSPp1Es8NVStBGIXKaEEo1MieITOgylywdcHQKAg2qVPUXYqQ-kg4sDE8-XK1dF5e_3x1JP9JSHrlo8mnx7Hz0s7x37YvYaPOK61vE" + }, + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "724", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "43190170-25a0-4816-9f57-d8ae81ab3094" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "724", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fd6943dc-783b-4f18-a36d-329c0a8d72b6" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "69", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS256", + "value": "WLx9s5UrvRtkv6WlfzdbKuXq0FmDkaujAzRlPvCycOI" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "10ac3bd7-553c-4915-8baf-d0a68076cbfe" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "423", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS256", + "digest": "WLx9s5UrvRtkv6WlfzdbKuXq0FmDkaujAzRlPvCycOI", + "value": "VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "186ee901-d5d0-45c8-8f11-856f65398057" + }, + "ResponseBody": { + "value": true + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "69", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS256", + "value": "WLx9s5UrvRtkv6WlfzdbKuXq0FmDkaujAzRlPvCycOI" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "15e5fb6f-b692-4921-9c40-ae039521e40c" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "423", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS256", + "digest": "WLx9s5UrvRtkv6WlfzdbKuXq0FmDkaujAzRlPvCycOI", + "value": "VycNS2AleyY425cgT02DdqHgz0r95vm0UDEsnG8uQiT7IfxflrjKM_d8PvOeV6JA6kamk6lhvFKnJqXyNmFaPcI7RcibAW-e3-9k91TEegUNl4dZpPeuy6AY5-CkafXBBTHCCOAfGuyCeNnr8jJF7teQa_Z246wgoOiGACQx37C2m9jb2x-Q3-mxo8utyi3NFu8LCJs7C9h_AlcszRJ0l9a0dP97YnNFW75GtBpfjt7frZFUGdJNeWvZXBhCzhtYN9ynN6SHIKKVfZEe-Uqc3HvY63oEGvVGcPnWeV2wY8NfQn04gji3hdKKyRH0VLSkwHJpSA7V42EDaPbaQCriQA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7bdccbdd-2e2f-4d72-b3e7-fc8eae5fe390" + }, + "ResponseBody": { + "value": true + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "90", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS384", + "value": "q0U8KRbM0Rwt37cMUYIMhajb1GD82Zg5NGXTtrG9mqticE2ITdzSuKVAgTLBRq0I" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e1b4696e-c381-4060-98b6-68f09095c3b4" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "pgnnttZnG0DrXoJdN4rv-GMtHEnAa7FFXfIKNlC0wXIlXhGHNy_5bq4CUZgd5RO-56gNYr1rJ44nQJoBqS33t4rLjguIkcBMGyJ02ymSpvCaexHEYPh6XiFWeK9ivPXGxc4Sbu08Y387c-xRRLb5e6uw4MOC1VnInyNRwrqFVHho7cEK-n9CXi__U7oSSAG3n98i8id-oX-sWnxuMu7-G601wPa7T42XIZz_cg-0crE3oFFRO467cuFSNSiOy6f6YDPEJK58KBN5i-BomYhwnNKc1Z4ATRvTtUKs2YT-8jHu4yIkN0-LGmd8tQdRWwaoqQiDueJVSAAzp-T7LERbmg" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "444", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS384", + "digest": "q0U8KRbM0Rwt37cMUYIMhajb1GD82Zg5NGXTtrG9mqticE2ITdzSuKVAgTLBRq0I", + "value": "pgnnttZnG0DrXoJdN4rv-GMtHEnAa7FFXfIKNlC0wXIlXhGHNy_5bq4CUZgd5RO-56gNYr1rJ44nQJoBqS33t4rLjguIkcBMGyJ02ymSpvCaexHEYPh6XiFWeK9ivPXGxc4Sbu08Y387c-xRRLb5e6uw4MOC1VnInyNRwrqFVHho7cEK-n9CXi__U7oSSAG3n98i8id-oX-sWnxuMu7-G601wPa7T42XIZz_cg-0crE3oFFRO467cuFSNSiOy6f6YDPEJK58KBN5i-BomYhwnNKc1Z4ATRvTtUKs2YT-8jHu4yIkN0-LGmd8tQdRWwaoqQiDueJVSAAzp-T7LERbmg" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "18edf6c9-2192-454a-b964-a479595bbd63" + }, + "ResponseBody": { + "value": true + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "90", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS384", + "value": "q0U8KRbM0Rwt37cMUYIMhajb1GD82Zg5NGXTtrG9mqticE2ITdzSuKVAgTLBRq0I" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8b5fb2da-00e7-4268-9faf-fbbf05f5d20c" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "pgnnttZnG0DrXoJdN4rv-GMtHEnAa7FFXfIKNlC0wXIlXhGHNy_5bq4CUZgd5RO-56gNYr1rJ44nQJoBqS33t4rLjguIkcBMGyJ02ymSpvCaexHEYPh6XiFWeK9ivPXGxc4Sbu08Y387c-xRRLb5e6uw4MOC1VnInyNRwrqFVHho7cEK-n9CXi__U7oSSAG3n98i8id-oX-sWnxuMu7-G601wPa7T42XIZz_cg-0crE3oFFRO467cuFSNSiOy6f6YDPEJK58KBN5i-BomYhwnNKc1Z4ATRvTtUKs2YT-8jHu4yIkN0-LGmd8tQdRWwaoqQiDueJVSAAzp-T7LERbmg" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "444", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS384", + "digest": "q0U8KRbM0Rwt37cMUYIMhajb1GD82Zg5NGXTtrG9mqticE2ITdzSuKVAgTLBRq0I", + "value": "pgnnttZnG0DrXoJdN4rv-GMtHEnAa7FFXfIKNlC0wXIlXhGHNy_5bq4CUZgd5RO-56gNYr1rJ44nQJoBqS33t4rLjguIkcBMGyJ02ymSpvCaexHEYPh6XiFWeK9ivPXGxc4Sbu08Y387c-xRRLb5e6uw4MOC1VnInyNRwrqFVHho7cEK-n9CXi__U7oSSAG3n98i8id-oX-sWnxuMu7-G601wPa7T42XIZz_cg-0crE3oFFRO467cuFSNSiOy6f6YDPEJK58KBN5i-BomYhwnNKc1Z4ATRvTtUKs2YT-8jHu4yIkN0-LGmd8tQdRWwaoqQiDueJVSAAzp-T7LERbmg" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b9ff992e-6f84-4ffe-93a9-00aa6c3cde80" + }, + "ResponseBody": { + "value": true + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "112", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS512", + "value": "Q6X1janG-T3a0v3t33BTlPWADZcF6RnJhnSUCt20YQGtT699FDbwpJDokRr547wx4-0AmBXrWEvrgONHoYcZ0A" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "edc94333-b733-4dd0-975e-4f27c2acd286" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "EhVnpxaFb6gJcMjT3CJ4P2cOCn45FZFFpfGe3xIXtAX7oDzOeqFxpLKuRoZrXz9B4f2YzP-YwNNwBPISceE6JsA_WZHgOBbn3mnl3U90Z3u9HG5zNLfLOyfcjQ5EcoZ3591By9KHGAy4L1YOVIKdm70XqHCY6Xkm00_LBIZRQEjhsrnOLJ84Yxij5gI6n-TrbCyNxubnpRrb1MMSNkziK5mWFulYMC9p_fppWTDKGcog4s4mS6pg4emCBStPiN2TG4WER_T0oV6aYf9GKrAhZEy_7PhQcRxVFb2oe885iM-GPNXbWfzu4lAc_O7TNAi3aZtcPvBFSkfzPk8e7kVkAA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "466", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS512", + "digest": "Q6X1janG-T3a0v3t33BTlPWADZcF6RnJhnSUCt20YQGtT699FDbwpJDokRr547wx4-0AmBXrWEvrgONHoYcZ0A", + "value": "EhVnpxaFb6gJcMjT3CJ4P2cOCn45FZFFpfGe3xIXtAX7oDzOeqFxpLKuRoZrXz9B4f2YzP-YwNNwBPISceE6JsA_WZHgOBbn3mnl3U90Z3u9HG5zNLfLOyfcjQ5EcoZ3591By9KHGAy4L1YOVIKdm70XqHCY6Xkm00_LBIZRQEjhsrnOLJ84Yxij5gI6n-TrbCyNxubnpRrb1MMSNkziK5mWFulYMC9p_fppWTDKGcog4s4mS6pg4emCBStPiN2TG4WER_T0oV6aYf9GKrAhZEy_7PhQcRxVFb2oe885iM-GPNXbWfzu4lAc_O7TNAi3aZtcPvBFSkfzPk8e7kVkAA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e9d1d919-e0d4-4fc6-9bc2-48bb7cf195e6" + }, + "ResponseBody": { + "value": true + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/sign?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "112", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS512", + "value": "Q6X1janG-T3a0v3t33BTlPWADZcF6RnJhnSUCt20YQGtT699FDbwpJDokRr547wx4-0AmBXrWEvrgONHoYcZ0A" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f37e0525-5eeb-43ab-9bed-7b15c1e9b5b5" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60", + "value": "EhVnpxaFb6gJcMjT3CJ4P2cOCn45FZFFpfGe3xIXtAX7oDzOeqFxpLKuRoZrXz9B4f2YzP-YwNNwBPISceE6JsA_WZHgOBbn3mnl3U90Z3u9HG5zNLfLOyfcjQ5EcoZ3591By9KHGAy4L1YOVIKdm70XqHCY6Xkm00_LBIZRQEjhsrnOLJ84Yxij5gI6n-TrbCyNxubnpRrb1MMSNkziK5mWFulYMC9p_fppWTDKGcog4s4mS6pg4emCBStPiN2TG4WER_T0oV6aYf9GKrAhZEy_7PhQcRxVFb2oe885iM-GPNXbWfzu4lAc_O7TNAi3aZtcPvBFSkfzPk8e7kVkAA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeysignverify51762/d66e74db477d406386ef717faeb1fb60/verify?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "466", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RS512", + "digest": "Q6X1janG-T3a0v3t33BTlPWADZcF6RnJhnSUCt20YQGtT699FDbwpJDokRr547wx4-0AmBXrWEvrgONHoYcZ0A", + "value": "EhVnpxaFb6gJcMjT3CJ4P2cOCn45FZFFpfGe3xIXtAX7oDzOeqFxpLKuRoZrXz9B4f2YzP-YwNNwBPISceE6JsA_WZHgOBbn3mnl3U90Z3u9HG5zNLfLOyfcjQ5EcoZ3591By9KHGAy4L1YOVIKdm70XqHCY6Xkm00_LBIZRQEjhsrnOLJ84Yxij5gI6n-TrbCyNxubnpRrb1MMSNkziK5mWFulYMC9p_fppWTDKGcog4s4mS6pg4emCBStPiN2TG4WER_T0oV6aYf9GKrAhZEy_7PhQcRxVFb2oe885iM-GPNXbWfzu4lAc_O7TNAi3aZtcPvBFSkfzPk8e7kVkAA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "14", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6eb2719c-2421-472c-a827-7df9fe3ed3df" + }, + "ResponseBody": { + "value": true + } + } + ], + "Variables": { + "0": "testrsakeysignverify51762" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsaLocal.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsaLocal.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsaLocal.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsa[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsa[1].json new file mode 100644 index 0000000000000..105337d40b7f9 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/CryptographyClientTest.wrapUnwrapRsa[1].json @@ -0,0 +1,509 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "dc2c16ac-55d6-4786-b5bf-ee20077eb08f" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "1902", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "key": { + "kty": "RSA", + "key_ops": [], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB", + "d": "UulbjVtdXTpxO-hl9FviHZmVXxNgqtJx7J2shQlPXClq_KG4CJXJtSVg2tLZnCki7CCrOTHLOoQArP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EEo1MieITOgylywdcHQKAg2qVPUXYqQ-kg4sDE8-XK1dF5e_3x1JP9JSHrlo8mnx7Hz0s7x37YvYaPOK61vE" + }, + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "724", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4404410c-309b-4d21-95ea-9547ef9823b9" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "724", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "583cc99f-36ca-4d11-837b-c9cfe2e27815" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "1_6ZtP288hEkKML-L6nFyZh1PD1rmAgwbbwjEvTSDK_008BYWhjp_6ULy9BhWtRIytNkPkm9gzaBTrCpp-vyDXPGa836Htp-w8u5JmxoUZchJh576m3m-8ZYWTmZSAp5SpruyKAmLSxPJHEWPXQntnmuTMjb9HBT9Ltrwc0ZDk-jsMLYunDJrNmrRUxQgb0zQ_Tl5fJjj8j-0KVx2RXtbfWFvf5fRdBYyP3m0aUpoopQPwtXszD2LcSKMJ_TnmnvMWr8MOA5aRlBaGdBk7zBgRafvDPam3Q2AvFA9mfcAVncpfZ3JFm73VARw6MofXtRqOHtZ7y4oNbY95xXwU2r6w", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269940, + "updated": 1681269940, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "bLHLOoZrTAsylQ5sgbe9V86UdNMIkUJZBURFVNsjx6DDqb8DDBHuYwGgpz1ql2WXntvc9QtLoN338QDBg1LF7MNFMBaNowLqASleFJ-LbGF6t5N9UYgZA8_ncJzopIvQVlgsYcn-l5D3krsJWPa7p5ry3Wuh7nIsdGBto06Ty96E6DsX3KZ01ByTZXbwodJcWBbtrorc8D1N6nSD6n0s8zew2wWWzsKgy_nkXdK3U7iaLaa5ygMy_09UN-nWGel6--Mlg-TKqWBNUtSw8vkTt22P2olj8vHWtod2cLGvmdvGT8vbTl6GA6oGo0ru1s79WVDfUb69BmFgf8hkHFwcDA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f010a765-3203-4c9e-bb2b-bf66f2b9979d" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "161", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "769a3332-f54f-4e9e-8af7-aa79a3ea5118" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "X4FgxlOtrjDVmoLWrlYGBTIfacfQjgcHAhjlXe7CQlgSppwci7JYA-P0da-GS8wOPSG7zmInEYrc8jw9TWju2OrOjls4ajajwvwYaOmSC3PnwPbao9Z3YpF0Zl6-L7I6hMy48JdJt49aaOMroKRz-g20XHso00aRlbcdaPo9DxWYKXoVOqAKvOhEEtsX99JNvsQxMf_UOF8d0oc0mAvSlAjnQVWlhVp-yhuyomomLDNoN94v8CcmspSqxB1vlC4czex-2Qj8rL6-Y9scnuPZqWO-dXLc-OzKjEdwliVfMa3YNN6IcZ4hKpT7sGB7jupdB9EmZzZIh_XIYEFysP1cNA" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "369", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA1_5", + "value": "X4FgxlOtrjDVmoLWrlYGBTIfacfQjgcHAhjlXe7CQlgSppwci7JYA-P0da-GS8wOPSG7zmInEYrc8jw9TWju2OrOjls4ajajwvwYaOmSC3PnwPbao9Z3YpF0Zl6-L7I6hMy48JdJt49aaOMroKRz-g20XHso00aRlbcdaPo9DxWYKXoVOqAKvOhEEtsX99JNvsQxMf_UOF8d0oc0mAvSlAjnQVWlhVp-yhuyomomLDNoN94v8CcmspSqxB1vlC4czex-2Qj8rL6-Y9scnuPZqWO-dXLc-OzKjEdwliVfMa3YNN6IcZ4hKpT7sGB7jupdB9EmZzZIh_XIYEFysP1cNA" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9ea1db49-4c54-4191-a3f6-882b34c70606" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "Pjt_XKfg86h9ubY_Bzh65Mr7AKB0pdz7XtWRLyVMRNe0d0KEA3jj6Mm33OddIK7A_OPo32PQ89OsRzHuWQW6etjeoFHCYzVMDvjvOor9k4G94LFaCinW3DWefHSJojW6rflBSG9MRDME7fdDb3NxSGW6UKPOP9ihZnBMO9BsMUdHQ71DgqiDrvHdKAk_KQhrZPDUJzHl651DjV9eBkwVzSXD6mm3f_c_62_oMltZnNCftdxN-vqu5w71hIEwmVq9M4hKCMDHKh9mvPokV1EjAISoq7rQ-YuCb2ZMhKoVVKLQHAlrLzlZopo54uB_1CV-KUkWWTdtfQidzCawkxJc8w" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e9af4f07-25da-4075-a8e1-26026f04234e" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "163", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b974f0f3-08e6-4d96-898e-08f21e65f5d1" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "NR3Az2rGmR_qbi0YkrQkdZhMTiTmOUjidCmoVcUq2jjtqXz9YSBakDVF7G4yViggyaBvw1R7iSgxQnAnzmuyJYjXBPkr852IaEggvmFC_TWpTeM-rA_sTahwq6fNIUgekl36AiniCgxnwMGSa-GdKCgNVsI07naBvTImdk1G8qdYz3PT80DO3QiL813jiTcGud58pfiznOTQhU_lCq91_N_xXfCoR_MUA8E9uFSxSb7njVpxw0LoNhARwEMwIFsrYwW7EdbI2URDKhU-OPS_m21ZBGfyRFnjSlzsJPVGF8R7Lz_1SbsbSS96xFCXoakl13jM6iJFqiP7b_nhCDFAhQ" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "NR3Az2rGmR_qbi0YkrQkdZhMTiTmOUjidCmoVcUq2jjtqXz9YSBakDVF7G4yViggyaBvw1R7iSgxQnAnzmuyJYjXBPkr852IaEggvmFC_TWpTeM-rA_sTahwq6fNIUgekl36AiniCgxnwMGSa-GdKCgNVsI07naBvTImdk1G8qdYz3PT80DO3QiL813jiTcGud58pfiznOTQhU_lCq91_N_xXfCoR_MUA8E9uFSxSb7njVpxw0LoNhARwEMwIFsrYwW7EdbI2URDKhU-OPS_m21ZBGfyRFnjSlzsJPVGF8R7Lz_1SbsbSS96xFCXoakl13jM6iJFqiP7b_nhCDFAhQ" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a39e1fd6-6721-4be9-b3f2-33671f7acd62" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "167", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d3f3c3e7-6f77-4fdf-ab00-5fc9b5e49e4b" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "obaFHPP8ozEbUP7OtIv20wYBlUTbHS18mix7DfOzFgKl6xZJpvdAfVUvVPJNyo9IGkN4Neb-eVp8NC7DMM4gJFsxgf5H3_KmTcBzQXiICa78GHR8-iVoGlzsF1X4sb0njI3EZfWXayw5Cwpx5pA3h_qsntmUjIwTJHbfaK4ZC-ZDvUXSuJa34kOCKbRMXC_nMGuZDhUsvAH9yZIz4BrHxYJQwdVw1eUNxXnOjdtw_DTgUVSi6NO0g1FqkgK2Rvov8bdijAnKoosz6AH9LliKM-uL4NvGp77tKUpYEsp2rCKcyoyskZVaDcJdx-UBw3z9Z__5Unb_FlRQluLt-OvMMw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "375", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "obaFHPP8ozEbUP7OtIv20wYBlUTbHS18mix7DfOzFgKl6xZJpvdAfVUvVPJNyo9IGkN4Neb-eVp8NC7DMM4gJFsxgf5H3_KmTcBzQXiICa78GHR8-iVoGlzsF1X4sb0njI3EZfWXayw5Cwpx5pA3h_qsntmUjIwTJHbfaK4ZC-ZDvUXSuJa34kOCKbRMXC_nMGuZDhUsvAH9yZIz4BrHxYJQwdVw1eUNxXnOjdtw_DTgUVSi6NO0g1FqkgK2Rvov8bdijAnKoosz6AH9LliKM-uL4NvGp77tKUpYEsp2rCKcyoyskZVaDcJdx-UBw3z9Z__5Unb_FlRQluLt-OvMMw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "52e6cd3e-7a1b-46d1-a794-b131bb1ea695" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "167", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "466", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3fe4c2b1-7958-44d1-a6ef-95ac54902889" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "BeeokB5KuH_CGEl-DrqqCH8E9WFo6VHsoUIcjiioFGvC-uV-0Qoc1wYHnq5vIBIJHOy7TYIFlEZk9z-MeKN13mEnjBFdRwbOU2Hx5lxXX_APc4OgGZOiM-0tbEX8cK5fU1PyIdghiOf-c-E6ioGRhcANcjRpUnz9FIFSkqmvi9wrVr4H9RGPvV9Itex1y0gNwce0PN4cfJmhi0UgQeeeeoiI-Fn7pm8hJqsPyw4JpQmkXW5tTuTH1BuPPV8xuIc3GoxliSzyalnmdSWgzV5V3TMKaAvSFcaCTIpc9fWnExDsCt-lD7r_tsbY8AsuLBmZeO0Qh2EGbmPw-o0zGihs9A" + } + }, + { + "RequestUri": "https://REDACTED/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "375", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP-256", + "value": "BeeokB5KuH_CGEl-DrqqCH8E9WFo6VHsoUIcjiioFGvC-uV-0Qoc1wYHnq5vIBIJHOy7TYIFlEZk9z-MeKN13mEnjBFdRwbOU2Hx5lxXX_APc4OgGZOiM-0tbEX8cK5fU1PyIdghiOf-c-E6ioGRhcANcjRpUnz9FIFSkqmvi9wrVr4H9RGPvV9Itex1y0gNwce0PN4cfJmhi0UgQeeeeoiI-Fn7pm8hJqsPyw4JpQmkXW5tTuTH1BuPPV8xuIc3GoxliSzyalnmdSWgzV5V3TMKaAvSFcaCTIpc9fWnExDsCt-lD7r_tsbY8AsuLBmZeO0Qh2EGbmPw-o0zGihs9A" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "258", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:25:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "1bfcb84a-270a-4f44-b880-66fa3f3e9eab" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testrsakeywrapunwrap91043/247835fd88314ec8814752308f771e65", + "value": "G9GT23aoJ9lUS5WtxwlS9igODCiTObv_Z7U9HhTbk99t_24WdBcngS2ycvtJ7_VQ6ESEKt1QdoI8UMRwh2UOMalPrw1leEgbwgpOtCPjmzCk2fhuxCHyinA3x0iGnD2jyYaXiw" + } + } + ], + "Variables": { + "0": "testrsakeywrapunwrap91043" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithDefaultSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithDefaultSize[1].json new file mode 100644 index 0000000000000..ce141416060f1 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithDefaultSize[1].json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey4021528/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bcc11e56-d8e0-11ed-8cf0-000d3a612dea", + "x-ms-server-latency": "0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey4021528/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "106", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "434", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bceb30ba-d8e0-11ed-9c0e-000d3a602e9a", + "x-ms-server-latency": "295" + }, + "ResponseBody": { + "attributes": { + "created": 1681269527, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269527 + }, + "key": { + "key_ops": [ + "deriveKey", + "wrapKey", + "verify", + "sign", + "unwrapKey", + "encrypt", + "decrypt" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testoctkey4021528/01949eb3efeb44ab061a8b33ad6c16f5", + "kty": "oct-HSM" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testoctkey4021528" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithInvalidSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithInvalidSize[1].json new file mode 100644 index 0000000000000..bfdce6a413e6b --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithInvalidSize[1].json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey75433d2/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "7f7d7466-d8e2-11ed-bcea-0022488d0014", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey75433d2/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "120", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "key_size": 64, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "120", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "80440acc-d8e2-11ed-bcea-0022488d0014", + "x-ms-server-latency": "18" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key size: \u002764\u0027 (Activity ID: 80440acc-d8e2-11ed-bcea-0022488d0014)" + } + } + } + ], + "Variables": { + "0": "testoctkey75433d2" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithValidSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithValidSize[1].json new file mode 100644 index 0000000000000..9fcc883d871bc --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createOctKeyWithValidSize[1].json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey60259c6/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bbdea6e8-d8e0-11ed-b20e-0022488d0014", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey60259c6/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "121", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "key_size": 256, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "434", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bc046fe0-d8e0-11ed-9c83-000d3a602e9a", + "x-ms-server-latency": "142" + }, + "ResponseBody": { + "attributes": { + "created": 1681269525, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269525 + }, + "key": { + "key_ops": [ + "deriveKey", + "wrapKey", + "verify", + "sign", + "unwrapKey", + "encrypt", + "decrypt" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testoctkey60259c6/6fcd75ba1fc24c368d1b0978903ee224", + "kty": "oct-HSM" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testoctkey60259c6" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json new file mode 100644 index 0000000000000..769f5e4ff3ae8 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json @@ -0,0 +1,100 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testrsakey718891e/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc2dda60-d8e0-11ed-bed5-000d3a602e9a", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey718891e/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "122", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA-HSM", + "key_size": 2048, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 3 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "780", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bc547c4c-d8e0-11ed-8380-000d3a602e9a", + "x-ms-server-latency": "1364" + }, + "ResponseBody": { + "attributes": { + "created": 1681269526, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269526 + }, + "key": { + "e": "Aw", + "key_ops": [ + "wrapKey", + "decrypt", + "encrypt", + "unwrapKey", + "sign", + "verify" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testrsakey718891e/e8d18b5a69b046b88cc525a52838d236", + "kty": "RSA-HSM", + "n": "kBEKPleJ7g9RKPxE6INXuaFVv9mIBYC1TZbZ5XeTu-Safa-i2wdpFL4B_o-mB7dgI_eadPhGZoxF5iCaMpLc7Z0SoNx3B_I-On6yzH467_8wz1-Dm6HQzZGWa4rESfnAvj_BpTZCFKSXfcZWI06WbLfxCK-hlZdoCfRN57GsCgX70RLbw25FOoi1IsBfh741CMsEnbCYLhbMjFUbtm017r3D9l8GmzhHGieVVVbmsO8UlVXGwu7i5dTYxo2WEBwhoLKsuI6iren_oLlAzrMavB1cJZjWGcSYLuHu-XRIXKR5clAvTyK_5-x9BoVqWoyzfp1hQSrkomrDSJ0Bt17D8w" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testrsakey718891e" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKey[1].json new file mode 100644 index 0000000000000..a0c2ad44243f2 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.createRsaKey[1].json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp3716383/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "ba84cb60-d8e0-11ed-9768-000d3a612dea", + "x-ms-server-latency": "12" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp3716383/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "106", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA-HSM", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "783", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bb6f2e1c-d8e0-11ed-b20e-0022488d0014", + "x-ms-server-latency": "589" + }, + "ResponseBody": { + "attributes": { + "created": 1681269524, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269524 + }, + "key": { + "e": "AQAB", + "key_ops": [ + "wrapKey", + "decrypt", + "encrypt", + "unwrapKey", + "sign", + "verify" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/javakeytemp3716383/1355b72195ab4993bf7c57eeed8f7ca8", + "kty": "RSA-HSM", + "n": "uthlLhv62o96FfehzqYU7KOSOx1zPN5n80RBwPtcx_yhe7Mqr3Yk31Kw4OZrV-ueumaB2VLUw78KxMHqcd7Bm2rZ26ypUfgnKBuDJVnhJoJ-3-jUrXzFHcyXRIx6hOLeSoRt7gfzfO-ZNNhx-CM-K1tISxwVZTKBB4A6K_pqauhhCg1WkGOdvAL_n-rTWYtKuNZofh6CId6Ueokq1a2s5HKpEHL_ZV5TwafyrdiVTOo2ARYqwLHFzpXzVZNuhI7a-Bz_aq_gMPIIowiQYqylQyjOYsfRInxg8veLWWW001qIl2_Dc7fqnFfV8WIi3UOb5uAvSgmtOr7yHuvh87p9KQ" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp3716383" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.getRandomBytes[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.getRandomBytes[1].json new file mode 100644 index 0000000000000..94b165c3596d9 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.getRandomBytes[1].json @@ -0,0 +1,61 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/rng?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bcca6f2e-d8e0-11ed-8cf0-000d3a612dea", + "x-ms-server-latency": "0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/rng?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "12", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "count": 12 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bcf7c2a8-d8e0-11ed-826e-000d3a602e9a", + "x-ms-server-latency": "45" + }, + "ResponseBody": { + "value": "WgXanHnnue0vB--S" + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.releaseKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.releaseKey[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientManagedHsmTest.releaseKey[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKeyNotFound[1].json new file mode 100644 index 0000000000000..f27dbd35db31f --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f9aa093f-0611-4e40-991f-a5b8ea74884e" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4a02975e-1b95-4b15-8ac4-360055e5ada3" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKey[1].json new file mode 100644 index 0000000000000..f97a2f8423e8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.backupKey[1].json @@ -0,0 +1,131 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey829743998/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3cee85b1-27e4-452f-9691-7548ee7a79ec" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey829743998/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f4b43d19-e8a2-49d3-93af-381ac4a5c018" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey829743998/2e095f556d8c4015b22066b88b479ae5", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "91NCuFx8oMA7HzES1cib5fnI-e0ANBeHgNicr1mCsOvM5p1uDLTvpOnSlSDXDixOnQ3p54ybYRQrCsbsdg22S6xStIbJkMo2rgF_nzoo9Wg83WjrB9hEgeAvBiPvLtFf8GG-x728nhlq_vM_PRJgxhA6Woedrn1k_Vkk1CEcO0ALyxDzoa2kJ_6KwT_oraDpSNy4cuHPVx-VTDjRI4K6FGD5m_R385P2-sVAw8sVFVeIkrBVVN45KTKHt-6AUWZolRF6EAxmWQmZjVqXVWnOxXoTzRIvPGwrOSV_oUCPLAJ5n2C2L_HHJ9fIo4bqyn6fyGe_7gCLET_boJAV-f8A7Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey829743998/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "12519", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3ca9079a-ad71-4d25-8cfd-77ecaca724f4" + }, + "ResponseBody": { + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAual9nWGQ4LXB6a0J6YzBEdTFwWWd4aWJDNkFuZWIzYTJLM3lsUnE1UmxhaDVLTEVhZFRKSjZ3Y0U0OTBkQXR0aThUUHZnT0RSSzFHR0tQQWJhUE9rdmpfZjBzOElpWklVZlBERHhraHdpZXdmcmN6LUp4NnYwVzZob3pXSG8ybGYtYzZFYmhIUFVQeXltVE16WkM2TTNqTlI0blViYzVQeFRXcDFndXU1dUpSTEZIc3h4NEpVcUE5dEhpWVh4N09UdHRCX3UwcG9lTF9FaTdmYjB2S3J1X2d6NXZsZ0NodnI2T3lBRUo2eUtMMmxLeExiNmtSWnhjRW1rT0d4Rm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dTNyNDY0d2JWWTg3c0x1ZlNuOHVQWmxPWUluSDRpb2RxVXRjd0FpcEhaWEw4ejJ1V285Z2c3ZHBIbWVMa3lFai1sQ2RVWERCenppSlJhR0IzVTFFR1dIalBMdTNjNkQxV0R1eTJSQTBEWXBmZnJocUxXZUtkdDJwMVJtOEhIMjVfSzI1YU9sU0hZVDVzOWIxUmJtY1p0aUlBSGRkcW1OTE40eGhsdnlvRktUMGhaM2FTTW1PWUdONWNQc3pWTWJUYkxaWWVMVnlWSVlXTkE5UUw3QXFtcXpMYzMwSmM4LnpGdktsdTFCeWttNUxHajJTQXdKSnUxWks0V2tDdTJ0NXRDMzBqOUN5RDg" + } + } + ], + "Variables": { + "0": "testkey829743998" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyEmptyName[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyEmptyName[1].json new file mode 100644 index 0000000000000..f028986d99ba5 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyEmptyName[1].json @@ -0,0 +1,76 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys//create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "bff86b4a-0bac-4c3f-9e1d-4c02e2d542d9" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys//create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "69", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8c42a4ec-0902-4b7c-8471-8d55b541f993" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Operation not specified" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNullType[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNullType[1].json new file mode 100644 index 0000000000000..56333e9736da7 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNullType[1].json @@ -0,0 +1,76 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javaKeyTemp/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7ec1c8e6-52cb-4952-b82b-6f6af91449c1" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javaKeyTemp/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "37", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "108", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "cf53e008-7235-48dd-a021-1542de3955b3" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Property has invalid value\r\nProperty has invalid value\r\n" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNull[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNull[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyNull[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyWithMultipleTenants[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyWithMultipleTenants[1].json new file mode 100644 index 0000000000000..fbef2fb501a7f --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKeyWithMultipleTenants[1].json @@ -0,0 +1,177 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp55637e7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e96b86a8-7ec5-4c6c-8f4f-5949d6363ed3" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp55637e7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "51fdb663-3940-45b2-823a-efa0e3df0315" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp55637e7/4a233cdab24f4fa985629fde58b07fe2", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "peaSkCUEzcaKzlRIskGYDhnAsHgwtyy30VxOxEj1VjoWtYVESiJDhy0wWvi7z6WJL1A8kmuJ7LP8AXd0sQlCLyWwXhCpuz7oiSdC9cgcqAxVKycwPoBmQsRGvPaIpt7s3ohzKKkbfYmjftAhol8HhB7mkQcRlidd5TgdSlpDk74GQFEUk1cl1XFlFYGvBpFxvjqOWd2zEsSS62TxkZG6KidNTzHTuAburtiEtj7Kx1W0-NEeP13k-rsqORn9CVdxT7Ja9eL_eULN3xwthnRUpKcm2uP6q17rEMx66N5GZ330md-oD97n_QU2Wz-HRHZzlPgk-FvPvGGwJ0KByLE_2Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp8730681/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7d82acaa-cb6d-4d7f-a20b-cb5cd32c379f" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8730681/644eff7f0f4a432e8be6acd51265423f", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "vMhD3mzMVa4dcXdZS7_1ch2cuuSAs9FFkx939SRu22Ne96i52VOc0dqA-VzyCEJemj6zyVnc0agmh_iptIP8r4OEoJFRPQyTCPTJ4QGjEmOlvYDlOjeX6mWwT4wXbIMgLMmi8jRuCVFwS6rOfZnDwErcxuck_cm4gbeDiCqQXGrNuBi-fQq1tBfFzgZL89x-j1pmFe2TcbAjwo0eHxV-CKDENVG2RNJXb0JgC6J2ky1mgOxWiJgREjHrfJoauOQIM9oGwGwEfQQmtS76FkvxgcEFM5CfA2oLQejkOF5W_LgDCRhDVtCRsjvy3zCpWg_osC79hR4r6s0mLV8qFd-5GQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "f93956d0-b4bf-4784-b96e-eeed7ce42708", + "1": "javakeytemp55637e7", + "2": "javakeytemp8730681" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKey[1].json new file mode 100644 index 0000000000000..754d9d8815186 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createKey[1].json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp10580ed/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "43523bbd-5c16-47d1-ab45-25fabb86e171" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp10580ed/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6d7ac137-2451-4304-bc28-c6df66ecc3e8" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp10580ed/1bca746a82144f1c8ce3297163829b81", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "2BhVJSI_--X5C_qNYqkJnfKtK-p6-D7vEJDunn_Uq7MkNUYrdbeRQQCPWiUVW-f1SexHZWeQ29mcuqhwy7h0m_iWOZS8LGVenBl3JvSbKqTGm9U2hMg90pBvEG-ttObIx5sVckFifAt_Ad18xfjwgk25D534KI5Dl9q4FHxbA9qH4M0fbUuEjSeaBmUviZShCXQs66Xv8dIaBUdk2kYNksCC4FmRrgMFuIJuIMLnjueEOh3Mgn6tp85siKKlIcdccPSy0KSZ_tI08ykGQDTc0UKNGOeP0sG4GtD2rBagTu0S9TERxGFdw6SIxsqeo-71WcwkjKRTzoMGTxhOH7D2ZQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp10580ed" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createRsaKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createRsaKey[1].json new file mode 100644 index 0000000000000..57eee85c04426 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.createRsaKey[1].json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp48817f8/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8af88322-6164-4639-a88a-2d428d74330f" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp48817f8/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "2c82fe1e-4acd-45cb-9245-0617b570ba63" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp48817f8/e3b10ab7c6a34543886bf7024a7da7eb", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "yZi66vVlU-CdjC-69utJoCGoZEHmO7RmizcYzJMumTd_w1DlONmGm1CcjqVvTWLikFWZfAWnrbkViBn3FE_FqwlEs43fi_fmULpE-EsfN6iuh0ZmpSA3A_gmA3epAyOp2P8ViY2zU8ZMTcPVrmnOXTdy7cxZlMIkTtUbbggt6nh7aCgaCi3f8oNTAekFHrXdb9jtKZcJ4IYUKAlNIqeKwTAVCr73gzIY_JXptKtjdb0I20dgeg7h6snNcrLWwe0J1mY01nPqyJb_OUJTBN62S3g4_yD0BX-hSIVDbFNr18njDFLrA-wQVlp_2PTFgy6JhjH92KSESNUeo_5DXXo3JQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp48817f8" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKeyNotFound[1].json new file mode 100644 index 0000000000000..ed2cf5f571f8c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5c4be555-196f-41f6-8278-d4c5d741c656" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "cf0564fb-be1f-49a5-b2da-a5968a5fa96d" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKey[1].json new file mode 100644 index 0000000000000..ae6701638a55d --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.deleteKey[1].json @@ -0,0 +1,246 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey585510f07/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6400d6d0-f479-4874-950d-88f2472f4ba0" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey585510f07/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a2847d88-5f2e-4ae2-8bae-45fe13d76290" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey585510f07/9c780633e3a14dfb93a575865343fa9e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4Cvkw3LUUtnZtcpAfUj-jH-cWFsRHGp5jeWtRU6WWK9ec0Uh2hmH_fpP62L3nPmiXIBoWLFey8FUStpB4K1b9K4YQBI6YfYV9dwklF89lvVzgeR_1rcG1-fbqRhHb_oxPwFkUIDX90vtKFromodHuZc8tB59Cg_irtXBZo5NvIKdvHjttgdetuQh5JJuT0JF1ipfLzMZIpehiTgiDioUfQ0ONUSNDwfKl-rZl7GgWFMt3j_Iwc_k1Am80_m-2wWca-9Vc3oPqINAVIY6zchJbDl_DSmutfav1HjK1OeU2f1UmYEOZWPiKePMu0envh7OOvYYN3QfBOL9vga2UHzktQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey585510f07?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6f0b31c9-4818-4231-8c41-354599e2c3fd" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey585510f07", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey585510f07/9c780633e3a14dfb93a575865343fa9e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4Cvkw3LUUtnZtcpAfUj-jH-cWFsRHGp5jeWtRU6WWK9ec0Uh2hmH_fpP62L3nPmiXIBoWLFey8FUStpB4K1b9K4YQBI6YfYV9dwklF89lvVzgeR_1rcG1-fbqRhHb_oxPwFkUIDX90vtKFromodHuZc8tB59Cg_irtXBZo5NvIKdvHjttgdetuQh5JJuT0JF1ipfLzMZIpehiTgiDioUfQ0ONUSNDwfKl-rZl7GgWFMt3j_Iwc_k1Am80_m-2wWca-9Vc3oPqINAVIY6zchJbDl_DSmutfav1HjK1OeU2f1UmYEOZWPiKePMu0envh7OOvYYN3QfBOL9vga2UHzktQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey585510f07?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d5b59d0c-88d7-44a1-bc92-833f0592c8eb" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey585510f07" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey585510f07?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "644dad35-3ff1-4939-9ccb-04ddc53036be" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey585510f07", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey585510f07/9c780633e3a14dfb93a575865343fa9e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4Cvkw3LUUtnZtcpAfUj-jH-cWFsRHGp5jeWtRU6WWK9ec0Uh2hmH_fpP62L3nPmiXIBoWLFey8FUStpB4K1b9K4YQBI6YfYV9dwklF89lvVzgeR_1rcG1-fbqRhHb_oxPwFkUIDX90vtKFromodHuZc8tB59Cg_irtXBZo5NvIKdvHjttgdetuQh5JJuT0JF1ipfLzMZIpehiTgiDioUfQ0ONUSNDwfKl-rZl7GgWFMt3j_Iwc_k1Am80_m-2wWca-9Vc3oPqINAVIY6zchJbDl_DSmutfav1HjK1OeU2f1UmYEOZWPiKePMu0envh7OOvYYN3QfBOL9vga2UHzktQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey585510f07" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientAndEncryptDecrypt[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientAndEncryptDecrypt[1].json new file mode 100644 index 0000000000000..7af650e2559c8 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientAndEncryptDecrypt[1].json @@ -0,0 +1,200 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp75324e4/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "2cee1e36-ee19-40d3-b311-291dfa0818e4" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp75324e4/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fa8b30d9-3bae-4cc1-8275-506e22e5540e" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp75324e4/13817635dc194d0c98bbb5c89c5090f8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xURRgZEksX7nE1iFNruXKGTAUEIGLRQ_GXxwm-d8GHB0NeHKgyTbwrYS0KCFiSqZh7DUy9F764UBimBGUQiWChC57KBEyFU8F6ApF6KB4KIQfI6oxyxBnGOFi3itWSVPfnk4w4JZfnVgpUjVZRpd-Xaws47fP6oKtKQFeVfeqTFx5CamwDtcraq7Jz5ohiGwNuzEnDTYF6oPriAUj1YUU59GCOUOJG4yMMjyNsq8m-pEZBlrLoBfdGg7SRPn_f_QvFp-X3xnmqpY7c3k8rMz5JP8nzU3JssDA1MBNZSPrnQiA2SJtsTJBavzjXrqcD4WB8jYA4bLtD9bzrMkeAZafQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp75324e4/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f7fdf5a7-6edd-41ed-a018-dd125cbdc335" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp75324e4/13817635dc194d0c98bbb5c89c5090f8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xURRgZEksX7nE1iFNruXKGTAUEIGLRQ_GXxwm-d8GHB0NeHKgyTbwrYS0KCFiSqZh7DUy9F764UBimBGUQiWChC57KBEyFU8F6ApF6KB4KIQfI6oxyxBnGOFi3itWSVPfnk4w4JZfnVgpUjVZRpd-Xaws47fP6oKtKQFeVfeqTFx5CamwDtcraq7Jz5ohiGwNuzEnDTYF6oPriAUj1YUU59GCOUOJG4yMMjyNsq8m-pEZBlrLoBfdGg7SRPn_f_QvFp-X3xnmqpY7c3k8rMz5JP8nzU3JssDA1MBNZSPrnQiA2SJtsTJBavzjXrqcD4WB8jYA4bLtD9bzrMkeAZafQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp75324e4//decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "hYsC-AFOvYEaFoHaN0nsm9yGgl9WMKwKENqOBy4_sOZ9iUWdiPhPhZk-Q3Za8Iem6A41BNKNSpwvqcvyTkh6QlvhHMpV1x55Awsg5iOUOaQ8t02OAntFKcu4Qc2OL_1lg3AS38cWixf6TnBlVcEuBQ1cwg6za2e7ehz2OYdfAE6XDxCJV1z8duUv8Nn8OK34WLG-0oc4BE2LLZOCP-6dhDC7lZICjkE71d93fefGkDEN0xoTWx6Fk5dpBWvqrkWx54zKLKY2Qsvdd9iwWmPq59zicD3ED2-xQC3TeR-AdCl6YxmZ8dfYiUIjw5rysm2z5fk34nzRep833VpXfRcQiQ" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "132", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c75aaed9-2242-4526-bfb5-a9f285df895e" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp75324e4/13817635dc194d0c98bbb5c89c5090f8", + "value": "bXlQbGFpbnRleHQ" + } + } + ], + "Variables": { + "0": "javakeytemp75324e4" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithEmptyKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithEmptyKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithEmptyKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithNullKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithNullKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClientWithNullKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClient[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClient[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getCryptographyAsyncClient[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKeyNotFound[1].json new file mode 100644 index 0000000000000..90a2e4d5dee4a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "85019bdc-250f-4266-aba2-d4eb51a175ce" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5f7a123e-ec4e-4fbc-be99-a0505738ef58" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKey[1].json new file mode 100644 index 0000000000000..09eefb5189f4d --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getDeletedKey[1].json @@ -0,0 +1,336 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey680180e32/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:48 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "47c1233b-4bcd-4931-8c83-7fb8d93fa111" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey680180e32/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:50 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f3a5e34a-4f0e-4ab5-92a8-8a1d1a1605bd" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey680180e32/1e7ea3520e1e45a2bc24050fcf819d4e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4HAjkTCsYHcgkfdyu0ytwFAiG1nV7d2T0g8aDgxkb78NYT3Q9DCiCcEVRtl5y0vw5u6uj2Xu0INNL8lbMnk0xCT4wam4dd65g-YwZOO6PZSHYkRCpL-6BTISzMNaqCJENQrTzGK4QRPY4pCuAkv5uEJyic3gKY-212hGOPzjN5Ypy6RcmyL2bMNhpxTkopIU8n4mAK1I-g3oBqKZJStTo4ZgCMiKEwvcONfhI0zrQEWm27_n8bkE6g1pm-MaAdq9V-Tjf51dy_eXeIIYXoSH-es0w60mUCIFZeyAlzpp2wqaUV_IOy6bTIJX38oqMPXGyu4hJtJmY1JNYhzueMsI4Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270370, + "updated": 1681270370, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey680180e32?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:50 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "68e108cd-e70b-4ae0-9eb6-55d394c089b3" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey680180e32", + "deletedDate": 1681270370, + "scheduledPurgeDate": 1681875170, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey680180e32/1e7ea3520e1e45a2bc24050fcf819d4e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4HAjkTCsYHcgkfdyu0ytwFAiG1nV7d2T0g8aDgxkb78NYT3Q9DCiCcEVRtl5y0vw5u6uj2Xu0INNL8lbMnk0xCT4wam4dd65g-YwZOO6PZSHYkRCpL-6BTISzMNaqCJENQrTzGK4QRPY4pCuAkv5uEJyic3gKY-212hGOPzjN5Ypy6RcmyL2bMNhpxTkopIU8n4mAK1I-g3oBqKZJStTo4ZgCMiKEwvcONfhI0zrQEWm27_n8bkE6g1pm-MaAdq9V-Tjf51dy_eXeIIYXoSH-es0w60mUCIFZeyAlzpp2wqaUV_IOy6bTIJX38oqMPXGyu4hJtJmY1JNYhzueMsI4Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270370, + "updated": 1681270370, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey680180e32?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:51 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f7bdbd94-f8ec-4cb6-9bbb-8e2fa1a416c1" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey680180e32" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey680180e32?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:52 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6a4484d1-a633-40b1-a90a-c4a4f8e55af3" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey680180e32" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey680180e32?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:53 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "58571033-db3b-4600-bbe6-e8cf84ff794b" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey680180e32", + "deletedDate": 1681270370, + "scheduledPurgeDate": 1681875170, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey680180e32/1e7ea3520e1e45a2bc24050fcf819d4e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4HAjkTCsYHcgkfdyu0ytwFAiG1nV7d2T0g8aDgxkb78NYT3Q9DCiCcEVRtl5y0vw5u6uj2Xu0INNL8lbMnk0xCT4wam4dd65g-YwZOO6PZSHYkRCpL-6BTISzMNaqCJENQrTzGK4QRPY4pCuAkv5uEJyic3gKY-212hGOPzjN5Ypy6RcmyL2bMNhpxTkopIU8n4mAK1I-g3oBqKZJStTo4ZgCMiKEwvcONfhI0zrQEWm27_n8bkE6g1pm-MaAdq9V-Tjf51dy_eXeIIYXoSH-es0w60mUCIFZeyAlzpp2wqaUV_IOy6bTIJX38oqMPXGyu4hJtJmY1JNYhzueMsI4Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270370, + "updated": 1681270370, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey680180e32?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:32:53 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "591610ac-f6f7-449d-81de-9e91cd94497e" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey680180e32", + "deletedDate": 1681270370, + "scheduledPurgeDate": 1681875170, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey680180e32/1e7ea3520e1e45a2bc24050fcf819d4e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4HAjkTCsYHcgkfdyu0ytwFAiG1nV7d2T0g8aDgxkb78NYT3Q9DCiCcEVRtl5y0vw5u6uj2Xu0INNL8lbMnk0xCT4wam4dd65g-YwZOO6PZSHYkRCpL-6BTISzMNaqCJENQrTzGK4QRPY4pCuAkv5uEJyic3gKY-212hGOPzjN5Ypy6RcmyL2bMNhpxTkopIU8n4mAK1I-g3oBqKZJStTo4ZgCMiKEwvcONfhI0zrQEWm27_n8bkE6g1pm-MaAdq9V-Tjf51dy_eXeIIYXoSH-es0w60mUCIFZeyAlzpp2wqaUV_IOy6bTIJX38oqMPXGyu4hJtJmY1JNYhzueMsI4Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270370, + "updated": 1681270370, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey680180e32" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyNotFound[1].json new file mode 100644 index 0000000000000..f1226a51ce3ba --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e53bdae6-3b8e-4c2c-ab66-2258860096cb" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "262bfbec-9354-47e9-a4e9-b73ad6419826" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyOfNonExistentKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyOfNonExistentKey[1].json new file mode 100644 index 0000000000000..52f25d0b9f026 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyOfNonExistentKey[1].json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/nonexistentkey84165/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7ec20eb5-0fdb-4993-92fd-4cb1d8bdc370" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/nonexistentkey84165/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "307", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "da3b8c0e-cac7-475b-9f54-00575a3145ed" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) nonexistentkey84165 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": { + "0": "nonexistentkey84165" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyWithNoPolicySet[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyWithNoPolicySet[1].json new file mode 100644 index 0000000000000..8a072dcdc2db2 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeyRotationPolicyWithNoPolicySet[1].json @@ -0,0 +1,136 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey01272f4b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:40:59 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f7d96cdc-4001-43bc-9894-18b586e56594" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey01272f4b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:41:00 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "17a119ef-bcaa-47ab-846f-6e877afa4230" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey01272f4b/f97100209b26401fb00a119576f1565c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uCIoSuVm2wwcg01meoa_jOOMI5TOicTjLyyk1-KGnI_4EwXRSZEpm5i5_UbWfBkfNAQA271YBY1oQunGWi6bnXHH55wa1aU56gP1NxbA9cL-L4WiPYFCkabSQOcx2ZvU8MJoz60O6sWtHqG-MFD8RkwUm2P18nr9JMcuktiR4Qst9EcLSlpSWRL9ya8hjtx8cL_KRLjdDkjTTgneILieR9w3AB3bkBNtrUB0pbjyu9DMbqQn73XyaBUbCIgzp1ofZN2npnXUjfVrBVSjVf85_HnuWuRglYFV26AljLYCRY5JtMIP_-YtqvS3wm5xk371TSU6KZOSag2JPfYxqtaP7Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681270861, + "updated": 1681270861, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey01272f4b/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "106", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:41:00 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c4a574df-143a-45cb-b963-5d52e0600eda" + }, + "ResponseBody": { + "lifetimeActions": [ + { + "trigger": { + "timeBeforeExpiry": "P30D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": null + } + } + ], + "Variables": { + "0": "rotatekey01272f4b" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeySpecificVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeySpecificVersion[1].json new file mode 100644 index 0000000000000..55eea615fdbee --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKeySpecificVersion[1].json @@ -0,0 +1,265 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey396652a76/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b8c29ec8-9262-4da4-aa8b-ef4885fe8f9c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey396652a76/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "81f4be21-df0b-44fe-b064-129b865b0d87" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76/2cee9a6b2ed54fbfb75ac6f32184ccbb", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "2i5lQoKfjgPoMkBTUMzl4QCM9JjKCtt2BmNDjSeM7LRbRlDI4TKdUyhM2egq4CIt4fvUK3p4L_rFduy1QBn4_sf6uc67b36gtkTNoH2pWS_ojmn5scX1x0rDlVl3YqLCXUk3ruGSOC3DsVwNXkvBE0ah-FMRVHaimzsHUO4LlRbhTSNA_WDlUoS1_crl94MtXcJDP0X_RsTBNIfaUxBfO0AkbfTR-ek5k6pIHSL-3xytxcb5W9TGpBlvHLPGFc9HO-CfWakW1CV_hDmVMsN1pRT8RbkrP8xl8O598lrBT4mY0ztz2_g7Xh1sYfkLYa6C9Pt7hr4ttiQhlJhG-v9dCQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey396652a76/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ff2570c7-b354-4119-b921-dd2da5d65c03" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76/3dd6e729bbb14567ab30a0e510e9212d", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xI48Av7-j3BOu3MyowHnvc4rtvUf2-RA0_8vbsnUoPAZtiKBagtemk_AxDfQ3p2JWXQwQHGJrlQndshaU3E1I7Us-GAc6dmB8IpmnC7qNxVvPeRT45cLNdRdmaY3476NsDn8liNNO0h2nt0LfyOndop9c7Xh0k4w69EMdTSFIxAQmzEy2w5-eCUu2t76KAdmqX3MUT_VoybWnPm5tqH4Lie3noNWYKXs5nS3f02Oe9BsK1q7sDQ2Xbu-pEqk9t4Vg0t0ajD-zK_V8L1h7NetT9G4Cj3jCAiGNblwru_FR-6TM_DTnuSbGXZkrMagI7ijBLef0_GvMENgF3vAPHQWNQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey396652a76/2cee9a6b2ed54fbfb75ac6f32184ccbb?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7917f3fd-f816-4720-b6b6-64007576bcc0" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76/2cee9a6b2ed54fbfb75ac6f32184ccbb", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "2i5lQoKfjgPoMkBTUMzl4QCM9JjKCtt2BmNDjSeM7LRbRlDI4TKdUyhM2egq4CIt4fvUK3p4L_rFduy1QBn4_sf6uc67b36gtkTNoH2pWS_ojmn5scX1x0rDlVl3YqLCXUk3ruGSOC3DsVwNXkvBE0ah-FMRVHaimzsHUO4LlRbhTSNA_WDlUoS1_crl94MtXcJDP0X_RsTBNIfaUxBfO0AkbfTR-ek5k6pIHSL-3xytxcb5W9TGpBlvHLPGFc9HO-CfWakW1CV_hDmVMsN1pRT8RbkrP8xl8O598lrBT4mY0ztz2_g7Xh1sYfkLYa6C9Pt7hr4ttiQhlJhG-v9dCQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey396652a76/3dd6e729bbb14567ab30a0e510e9212d?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ef8acc6e-2741-4d38-9899-358f12c5cfe1" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76/3dd6e729bbb14567ab30a0e510e9212d", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xI48Av7-j3BOu3MyowHnvc4rtvUf2-RA0_8vbsnUoPAZtiKBagtemk_AxDfQ3p2JWXQwQHGJrlQndshaU3E1I7Us-GAc6dmB8IpmnC7qNxVvPeRT45cLNdRdmaY3476NsDn8liNNO0h2nt0LfyOndop9c7Xh0k4w69EMdTSFIxAQmzEy2w5-eCUu2t76KAdmqX3MUT_VoybWnPm5tqH4Lie3noNWYKXs5nS3f02Oe9BsK1q7sDQ2Xbu-pEqk9t4Vg0t0ajD-zK_V8L1h7NetT9G4Cj3jCAiGNblwru_FR-6TM_DTnuSbGXZkrMagI7ijBLef0_GvMENgF3vAPHQWNQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey396652a76" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKey[1].json new file mode 100644 index 0000000000000..016cab7351912 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.getKey[1].json @@ -0,0 +1,153 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey416645817/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "05534183-af64-4dc3-9f6d-4a266916d20d" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey416645817/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "39f1fa58-e2b5-4f81-8259-1c96cc39bc23" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey416645817/6d7da5e7e6e2476d9ea7bdedb9fce4bc", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0bqhnmv-HLtkFBuoS5wTDSW8xrh5LK_lqm3x8LOinZK7GGx_KLLJEYT_kBQ6NgAAZiYrbC_RbIWk0MZRUWkfB-5-z-9vD2ua8J4CXTOB3phNRu_dIHAG4P7iwB89qQbBjBdv4ILg1g3kzE7ejaogdeyOAX7Lje5H-hFOs_kP0agNIxup5OLs2AsrJAv2wi1WCEh0tgrD6jB6cKMa9cZszrqO5EwtJhl6IQcQrQGOyEVJBdnTB16QPMmrh7-024fBgSBfDkmET8NHxJu9SOONYmxlNMSN3FFRi-XmgPQS0LPAGQsFSjgRw-Gk92jVzgDiXBWxu1c2IE0zGrL6HenXvQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey416645817/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fc5b6634-f93b-4dfb-b83b-fb0a43b58fe7" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey416645817/6d7da5e7e6e2476d9ea7bdedb9fce4bc", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0bqhnmv-HLtkFBuoS5wTDSW8xrh5LK_lqm3x8LOinZK7GGx_KLLJEYT_kBQ6NgAAZiYrbC_RbIWk0MZRUWkfB-5-z-9vD2ua8J4CXTOB3phNRu_dIHAG4P7iwB89qQbBjBdv4ILg1g3kzE7ejaogdeyOAX7Lje5H-hFOs_kP0agNIxup5OLs2AsrJAv2wi1WCEh0tgrD6jB6cKMa9cZszrqO5EwtJhl6IQcQrQGOyEVJBdnTB16QPMmrh7-024fBgSBfDkmET8NHxJu9SOONYmxlNMSN3FFRi-XmgPQS0LPAGQsFSjgRw-Gk92jVzgDiXBWxu1c2IE0zGrL6HenXvQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey416645817" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listDeletedKeys[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listDeletedKeys[1].json new file mode 100644 index 0000000000000..7f5e1ce726c6e --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listDeletedKeys[1].json @@ -0,0 +1,996 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/4fa7f90520004bbe875b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d40bd3ac-b0d8-4404-a5c4-a9f6c38ab12c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/4fa7f90520004bbe875b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9c9e0887-1543-4d81-8722-04ffba7b78b6" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b/edfb45073416426298ef2e3b1df5c804", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "03_bsEFlq78Fm5kO8NCjQcHm0jqQKfUXow4momKn9G9QRfGJjrlaZUlKGdbddgn0RD7vrvRn8El3VXVuBaLZzisLH0W1XIOdSRbEB4A-SdgJ0lnCNk3CMOstQajdtH_0lepVKmMcZlHtgIwXFxmAa9-9EgVmt9VJ24D89_bVqCP6ikdgjJzR-9HIRBczSkODmQYwecIptQt2Df8C3KBSySLlQq3DuiIQ-lYR2e5UqK1D_L5UipBa0MDwguDbHO3FtKRFHP_AsR6L2Z26DDHcLQ2afrJocE4-JehRNeA6mBfXL9xzJigwc1p77scEOud4GMIwt5myEzDbz1hfRkWimQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/a874a3dd019c4f0d8fd9/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "99cb18c6-b7b5-432f-8464-826c2d830a2c" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9/5a995099d62e413092820eb54ca84079", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "n7R_DwB093OZ5zeLlrvIyBqjujATWtkET5m3bFtyf0-b-CwkdbdIxEekKwfKVOoRdpNufwWphpqjSkY37V0vufqo6OE7jg3L8PRGBsvjtzN0ZMq2371iUhgvv3yniiY7eFROKuagpIXBFm8yXTxHLsAsfu0li_fU6wVc9xuCUBczPZQlSjDg45jhlv_fg2XoFv2k7I2zTSCtFQLTJ2lbl99FMxN8SiBgzGVm-2Uy1C_TTGUJ_F_ep8yD0rxTXjbRGvCS1atfmSc4zZBiJhYOJYStdR5mwxfPxr9718c9Yz_iZo1LmBIkawNcClizEyTkhALSGG6orn8yqTfP3hgHYQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/864b42db022c44f2a33a/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6210950c-2813-4453-a165-b84da0cc22c9" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a/962d8665f37c42828f0e9996da39dbe4", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wdWcLGEhFLcMTJE_3ahdVfqqb9D3wCreGivkKPkXQt8hnNAd5ba8ov7GNkQMiCQ7VtFGKidcrjRSfeQJ51JAnvsZMU8HcInqvWQnghL4aFfpSkV_Lvu7VrDvmGBgvuenU4fo2bjkchSTnTl8yTrtWxUv1P-O0aBiWs4LWy38fyjAu6lbQVhkOWA9q45CVBiCr3bqisvIGX4BNrEzke4PYP4PD_ispjmqehxhnmlnY-zCcjwIqAtH67Vt_4BXEbx2hyL53pveuJfH8m1CkrTaF1MK8Pxtx7y7urwZqy0COQGXyNZy-S6351HtWrZ4fkAtwpxsicgp5DwtUffZ-EcyTQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/4fa7f90520004bbe875b?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:28 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "e27ec001-211f-46a0-93da-08db6c6ebe05" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/4fa7f90520004bbe875b", + "deletedDate": 1681269688, + "scheduledPurgeDate": 1681874488, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b/edfb45073416426298ef2e3b1df5c804", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "03_bsEFlq78Fm5kO8NCjQcHm0jqQKfUXow4momKn9G9QRfGJjrlaZUlKGdbddgn0RD7vrvRn8El3VXVuBaLZzisLH0W1XIOdSRbEB4A-SdgJ0lnCNk3CMOstQajdtH_0lepVKmMcZlHtgIwXFxmAa9-9EgVmt9VJ24D89_bVqCP6ikdgjJzR-9HIRBczSkODmQYwecIptQt2Df8C3KBSySLlQq3DuiIQ-lYR2e5UqK1D_L5UipBa0MDwguDbHO3FtKRFHP_AsR6L2Z26DDHcLQ2afrJocE4-JehRNeA6mBfXL9xzJigwc1p77scEOud4GMIwt5myEzDbz1hfRkWimQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/4fa7f90520004bbe875b?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:29 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "2bbe4086-ac34-44cc-ab69-3a921aacc5aa" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/4fa7f90520004bbe875b", + "deletedDate": 1681269688, + "scheduledPurgeDate": 1681874488, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b/edfb45073416426298ef2e3b1df5c804", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "03_bsEFlq78Fm5kO8NCjQcHm0jqQKfUXow4momKn9G9QRfGJjrlaZUlKGdbddgn0RD7vrvRn8El3VXVuBaLZzisLH0W1XIOdSRbEB4A-SdgJ0lnCNk3CMOstQajdtH_0lepVKmMcZlHtgIwXFxmAa9-9EgVmt9VJ24D89_bVqCP6ikdgjJzR-9HIRBczSkODmQYwecIptQt2Df8C3KBSySLlQq3DuiIQ-lYR2e5UqK1D_L5UipBa0MDwguDbHO3FtKRFHP_AsR6L2Z26DDHcLQ2afrJocE4-JehRNeA6mBfXL9xzJigwc1p77scEOud4GMIwt5myEzDbz1hfRkWimQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/a874a3dd019c4f0d8fd9?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:29 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "554e26d0-262c-4f36-9c61-f48f4f2053a0" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/a874a3dd019c4f0d8fd9", + "deletedDate": 1681269689, + "scheduledPurgeDate": 1681874489, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9/5a995099d62e413092820eb54ca84079", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "n7R_DwB093OZ5zeLlrvIyBqjujATWtkET5m3bFtyf0-b-CwkdbdIxEekKwfKVOoRdpNufwWphpqjSkY37V0vufqo6OE7jg3L8PRGBsvjtzN0ZMq2371iUhgvv3yniiY7eFROKuagpIXBFm8yXTxHLsAsfu0li_fU6wVc9xuCUBczPZQlSjDg45jhlv_fg2XoFv2k7I2zTSCtFQLTJ2lbl99FMxN8SiBgzGVm-2Uy1C_TTGUJ_F_ep8yD0rxTXjbRGvCS1atfmSc4zZBiJhYOJYStdR5mwxfPxr9718c9Yz_iZo1LmBIkawNcClizEyTkhALSGG6orn8yqTfP3hgHYQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/a874a3dd019c4f0d8fd9?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:30 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a533de9a-2881-4bad-93fd-4692fc7e7539" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/a874a3dd019c4f0d8fd9", + "deletedDate": 1681269689, + "scheduledPurgeDate": 1681874489, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9/5a995099d62e413092820eb54ca84079", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "n7R_DwB093OZ5zeLlrvIyBqjujATWtkET5m3bFtyf0-b-CwkdbdIxEekKwfKVOoRdpNufwWphpqjSkY37V0vufqo6OE7jg3L8PRGBsvjtzN0ZMq2371iUhgvv3yniiY7eFROKuagpIXBFm8yXTxHLsAsfu0li_fU6wVc9xuCUBczPZQlSjDg45jhlv_fg2XoFv2k7I2zTSCtFQLTJ2lbl99FMxN8SiBgzGVm-2Uy1C_TTGUJ_F_ep8yD0rxTXjbRGvCS1atfmSc4zZBiJhYOJYStdR5mwxfPxr9718c9Yz_iZo1LmBIkawNcClizEyTkhALSGG6orn8yqTfP3hgHYQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/864b42db022c44f2a33a?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:30 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6b3f29c7-0cb7-4787-99b0-6edc7ac82271" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/864b42db022c44f2a33a", + "deletedDate": 1681269691, + "scheduledPurgeDate": 1681874491, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a/962d8665f37c42828f0e9996da39dbe4", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wdWcLGEhFLcMTJE_3ahdVfqqb9D3wCreGivkKPkXQt8hnNAd5ba8ov7GNkQMiCQ7VtFGKidcrjRSfeQJ51JAnvsZMU8HcInqvWQnghL4aFfpSkV_Lvu7VrDvmGBgvuenU4fo2bjkchSTnTl8yTrtWxUv1P-O0aBiWs4LWy38fyjAu6lbQVhkOWA9q45CVBiCr3bqisvIGX4BNrEzke4PYP4PD_ispjmqehxhnmlnY-zCcjwIqAtH67Vt_4BXEbx2hyL53pveuJfH8m1CkrTaF1MK8Pxtx7y7urwZqy0COQGXyNZy-S6351HtWrZ4fkAtwpxsicgp5DwtUffZ-EcyTQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/864b42db022c44f2a33a?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:31 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3446b653-946e-4101-b18c-337f7d2d7613" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/864b42db022c44f2a33a", + "deletedDate": 1681269691, + "scheduledPurgeDate": 1681874491, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a/962d8665f37c42828f0e9996da39dbe4", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wdWcLGEhFLcMTJE_3ahdVfqqb9D3wCreGivkKPkXQt8hnNAd5ba8ov7GNkQMiCQ7VtFGKidcrjRSfeQJ51JAnvsZMU8HcInqvWQnghL4aFfpSkV_Lvu7VrDvmGBgvuenU4fo2bjkchSTnTl8yTrtWxUv1P-O0aBiWs4LWy38fyjAu6lbQVhkOWA9q45CVBiCr3bqisvIGX4BNrEzke4PYP4PD_ispjmqehxhnmlnY-zCcjwIqAtH67Vt_4BXEbx2hyL53pveuJfH8m1CkrTaF1MK8Pxtx7y7urwZqy0COQGXyNZy-S6351HtWrZ4fkAtwpxsicgp5DwtUffZ-EcyTQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "2748", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "378dc0e5-bf2a-4cff-84ab-46e11fbde9db" + }, + "ResponseBody": { + "value": [ + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/1fc4269c1a3f44f3843a", + "deletedDate": 1681269681, + "scheduledPurgeDate": 1681874481, + "kid": "https://azkvrecordtests.vault.azure.net/keys/1fc4269c1a3f44f3843a", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/2800fa5c9aeb482586f5", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "kid": "https://azkvrecordtests.vault.azure.net/keys/2800fa5c9aeb482586f5", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/4fa7f90520004bbe875b", + "deletedDate": 1681269688, + "scheduledPurgeDate": 1681874488, + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/864b42db022c44f2a33a", + "deletedDate": 1681269691, + "scheduledPurgeDate": 1681874491, + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/a874a3dd019c4f0d8fd9", + "deletedDate": 1681269689, + "scheduledPurgeDate": 1681874489, + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/f25cb70c8f614398a35f", + "deletedDate": 1681269680, + "scheduledPurgeDate": 1681874480, + "kid": "https://azkvrecordtests.vault.azure.net/keys/f25cb70c8f614398a35f", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVTFJV3RsZVM5S1FWWkJTMFZaVkVWTlVESTRPVGMwTlRBdk5qZ3pPVUpDUkRZNVFqTTFORGc0UlVFNVFqazVNVVJDUkVNeU5UYzVNamdoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVTFJV3RsZVM5S1FWWkJTMFZaVkVWTlVESTRPVGMwTlRBdk5qZ3pPVUpDUkRZNVFqTTFORGc0UlVFNVFqazVNVVJDUkVNeU5UYzVNamdoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f145ccf1-a6bb-412d-9de2-f65128993a3c" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "28afaa4c-ad7d-470c-b466-bbebf4d4df3b" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVTMFZaTVRVNU1EUTFRalk1THpWQ05qRXpOVFZDUXpaQ1FqUkNNVE01TkVJd05EUXlNRVF4UVVReVJFSkRJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVTMFZaTVRVNU1EUTFRalk1THpWQ05qRXpOVFZDUXpaQ1FqUkNNVE01TkVJd05EUXlNRVF4UVVReVJFSkRJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b0db0c2e-fa47-48c6-83bc-ba7e3383b5a9" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREEzTkRjeU1FUkVORVUxSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREEzTkRjeU1FUkVORVUxSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "dcd2e3a4-83f6-430b-b0b1-6acf1d6b94ac" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVRMFZTVkRVeU9UUXdRMEZFTHpBMU16SkRRMEV4TWtaRFFUUkdORU5DTURNelF6Z3hSVVpHT0RnM09FWXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVRMFZTVkRVeU9UUXdRMEZFTHpBMU16SkRRMEV4TWtaRFFUUkdORU5DTURNelF6Z3hSVVpHT0RnM09FWXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f03a0ff7-5bdc-4c8f-a030-da3c26789cf8" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt4TlRreE1FVkJSVEF6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt4TlRreE1FVkJSVEF6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "137548ae-9544-4c4d-995c-09e4a5cb108d" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVTMFZaTXprMk5qVXlRVGMyTHpKRFJVVTVRVFpDTWtWRU5UUkdRa1pDTnpWQlF6WkdNekl4T0RSRFEwSkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVTMFZaTXprMk5qVXlRVGMyTHpKRFJVVTVRVFpDTWtWRU5UUkdRa1pDTnpWQlF6WkdNekl4T0RSRFEwSkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1869", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "be9a6845-207d-4cbb-aba9-32f1ecc47beb" + }, + "ResponseBody": { + "value": [ + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey5338851c6", + "deletedDate": 1681269708, + "scheduledPurgeDate": 1681874508, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey5338851c6", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269708, + "updated": 1681269708, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey585510f07", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey585510f07", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey665999479", + "deletedDate": 1681269678, + "scheduledPurgeDate": 1681874478, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey665999479", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey675388088", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXdGxlUzlVUlZOVVRFbFRWRU5GVWxSV1JWSlRTVTlPT0RrNE5EQWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXdGxlUzlVUlZOVVRFbFRWRU5GVWxSV1JWSlRTVTlPT0RrNE5EQWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "bf9799c9-f371-448d-b227-a98bfb61748f" + }, + "ResponseBody": { + "value": [], + "nextLink": null + } + } + ], + "Variables": { + "0": "a874a3dd019c4f0d8fd9", + "1": "864b42db022c44f2a33a", + "2": "4fa7f90520004bbe875b" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeyVersions[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeyVersions[1].json new file mode 100644 index 0000000000000..79e31a429be16 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeyVersions[1].json @@ -0,0 +1,358 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "0b1c6c0c-09ad-4e51-82b0-62d1cb09372e" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797280000 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c9ef4c1b-8bf1-4b67-8203-8f55b54f758c" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/67b944c400994ff8b2516fcefbead19a", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "3s9jNc6-QLz1Bxz91YHPQR4TFjx52oLSmjnowCZNhNTgcBwz01sFE1RdybbJBTGc1j4JDtaGJl8tXC_ezISQWj0Iyv1pphkVSb_0c6XL4XSQxJt1QzHu4AjX3fGMn2V6cORJuft_yyFibtOFaj7Cwk9WXF9gDhfLy3NJNrZgiNuP1TvszxSUESkgHHCXIIZL2JUz53yKjcKrdqZI_K3Jvat93j8EuE-ssKFFfiv6dJMm2UAMnzQzCdXhNl4A65M3AKD-8Ebl-VwJQd9UKP-1hFlR-DQbmP_a-yOe0MrFkpJE4xhTCvjGlhxy5OttAFxXjVWs2jVpYLg03Vu-kreacQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797280000, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797366400 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ddb6709b-6f33-41e7-8548-4b8dab995669" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/0212b463f91e49369d1cd301344e9d09", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "trvg1m8ijR_xypfpSqE_1pflGS-1zuAhpWDR-F20qDq3tAeWZiZW6-It3v-fNnZ3c5ProkXCfCA4cJV8VpKRtH7MIdUXGYgDXEw_j3Za-w6JIztqKPi_gw6ek8hiwl0vCf5Gz0rquCI5HnqH9zHI568g_Vxs0aXS372d5ZalLJIpNUDL7KDN0vHsBBcbc1VEnzVFVW5A7PfTid3ArsIwysu6oSHFNR9ZWI0osk4TkJv1pYfdwnxwUi7mgv4O6C-QhHpuuBZdJIbRWyITc74hWukJDeXhaeEH68v6NV7Nj6b950JRqohTOFBcAsVeX2IVXqLjx-_r7TiAo7adcrX6bQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797366400, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797452800 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a081513a-2385-476d-ae2f-5fc1bb19c896" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/0f0ef4c99e074f16b539b3e8c60ec6a2", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "yUu9BlFTRmTJIHV0gNBKLn3i6ky77f26ChQrjSRvUVcYMdUUvxkA0rvx-sOiiONjWeSyJ2BYT9QCwJCp0BX90xS0lRi5eDTA-hhpxR-SwOH5qBJqBlZsOGyrxDk96SBY3ErYELeb6JUfi-DgD7sFNHQJJNqnSmOjIHH79tOS8GhEG3ig-yRbDj4kr43_zwDmBvZR0e9ymHO9nKkK8ow3eBLUFv7pd_ZKdU0EQNCpwRhAdIPfFhl3q82BUX229pgOO62pUc5SeLIr5aAChjtg9J_NWBERzJTxSM9iru5N7Nr16c1WV8aYiObDHHYHgaKQycdmvky-SknwRd4rYY0TJQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797452800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797539200 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "dce7ae91-fc67-44dc-9ebe-d2c840eb3179" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/fbb04c853f6e4770bfafed548a08f7da", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "3i78FlPzqyp8WrL_gwnj8hm56lnFNlHb3fKsvLrwmj9KyWC2K8FkLVJ3lyjop5uuTQNSNhKl4PSCh9H147ZKSGLszGAUxRtVp6SqSCRU_1Gy6yCWhIKSzZai4fdYlJGV5lqAP5qWhSFVwmytWjNQNTSmzcv89KCbCHUXTvLO6DSnxFFxRURiQD_6ota_rP_Kvq7V2YqdkKUOrbUr7LtsO45t_4vTLbNSSaboi47yK_2jxQFg_tGrFsHiluaXA1TXaGDtFkLM7mjyNCUB45ymyzlQN-UlliNn48cyanIrRH6sW0yUBFOQqbcClDl7glwpZfjntM6w3IZq0rJS-Z89FQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion34156/versions?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1171", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:47 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a2d78ebc-a75e-402e-af20-4f2915ae63de" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/0212b463f91e49369d1cd301344e9d09", + "attributes": { + "enabled": true, + "exp": 3797366400, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/0f0ef4c99e074f16b539b3e8c60ec6a2", + "attributes": { + "enabled": true, + "exp": 3797452800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/67b944c400994ff8b2516fcefbead19a", + "attributes": { + "enabled": true, + "exp": 3797280000, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156/fbb04c853f6e4770bfafed548a08f7da", + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "0": "listkeyversion34156" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeys[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeys[1].json new file mode 100644 index 0000000000000..dbf091c26ec56 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.listKeys[1].json @@ -0,0 +1,1368 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/listkey159045b69/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ab3b34dc-949d-489a-a1df-73030872b89d" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey159045b69/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ccd6bc86-2552-4de8-8bbc-5a148d0a47a7" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey159045b69/5b61355bc6bb4b1394b04420d1ad2dbc", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0OsHO9bXf5ViE-fLN8aH71CV1xOdcW9nv1np8hj0tGYo4LAMrDM5a_5UOnvta6nLFbhIOFp6e0yCZbvJG-wpb8V9P4TGVU9tPLsRHj6hU-6daPiANpb_0qOHUOa2rybLcqMVCFPoLVzhi9LArgGTkaDLRXZf0dgajNV_irTYxzdEXEAMZZ5Yn5SMInXFMz5LaApmRASy8Xp6uKEeaB187nTm4kwcE2ZySRiJjZP9S44fFF9Y4MMQa2ZnOKUbIYG51GoxU0_wvBWDwdn16k1e5CMH0ze7cpZOd0wjOSY6eM9UOV39LqWBUxrZs3tzcBP5x7-aHlsUiA072b8xH8smaQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey08514245e/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "093793c3-434b-4641-add3-98116aa22bf5" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey08514245e/4664282d6b324daeba55c3162ef71311", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "37Qu_qshS-dbBMTsgVRoGuXJlz_0t5pOZ_PYgXWGhObnH8A6NR5JZZ1ByFcso1tXXj58fqY0GUUrsniK1E5YJlnhOP0C38xefIxGR8wdW_DxQA8al98E-4Q4oNAPyyhaROOJSTM5QXQG--SrCLtEMfqoLRahElD9USrSz1K0LjbaiZflb88tFq8oVa61RaM7wtM6mFbD5V5xh9eram7oAVsGFc6Gsz-6bW5qA6m8wCgIgUYsaM7Zd-SorFGrcBWgZgJoki5h-h7Uz5deXDk4pfFACiphAhtxhPa85Fv3CN2Dz6OisONEFquLVYIZDMOm5EsWFnXRp3lzDjIAiFGR7Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "6438", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:28 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "804fdb7b-4f79-4358-8504-4e6b87d741d8" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpem36190600", + "attributes": { + "enabled": true, + "nbf": 1581722236, + "exp": 1739402236, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpem88272c66", + "attributes": { + "enabled": true, + "nbf": 1581722236, + "exp": 1739402236, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpkcs0802660b", + "attributes": { + "enabled": true, + "nbf": 1677892443, + "exp": 1709428443, + "created": 1681267922, + "updated": 1681267922, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpkcs72765dc3", + "attributes": { + "enabled": true, + "nbf": 1677892443, + "exp": 1709428443, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp10580ed", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp19980ab", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp2897450", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp46933d1", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp48817f8", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp55637e7", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp657262d", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp75324e4", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8730681", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8919662", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey019934147", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1712890317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey14364bdb0", + "attributes": { + "enabled": true, + "nbf": 1681267351, + "exp": 1712890351, + "created": 1681267952, + "updated": 1681267952, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey1765847e0", + "attributes": { + "enabled": true, + "nbf": 1681267331, + "exp": 1712890331, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey28482fa02", + "attributes": { + "enabled": true, + "nbf": 1681267320, + "exp": 1712890320, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey35523cfe7", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "5086", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:28 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "699b9729-0bb1-4971-a3fa-7db78b4ae086" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey371743fe3", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey53952219e", + "attributes": { + "enabled": true, + "nbf": 1681267375, + "exp": 1712890375, + "created": 1681267975, + "updated": 1681267975, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey73640952b", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1712890317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey032723001", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey08514245e", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey159045b69", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156", + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/myalias", + "attributes": { + "enabled": true, + "nbf": 1681262971, + "exp": 1712885971, + "created": 1681263571, + "updated": 1681263571, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey111498f7", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey27056f79", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey66098157", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey7308409f", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey8567757a", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey97102ac5", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert01202f7c384", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert04277a19e08", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert05792b1d900", + "attributes": { + "enabled": false, + "nbf": 1681267338, + "exp": 1712890338, + "created": 1681267939, + "updated": 1681267939, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert074720dd4e5", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert12248a9fc67", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREV6TXpVMU56UTJNRVpESVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREV6TXpVMU56UTJNRVpESVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "6142", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:29 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9c732278-e148-4a6e-849e-bcf4ee0cb554" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert133557460fc", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1744426317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert15970ce7b3a", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1712890318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert2087690df30", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert231873819ea", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert24189bd8691", + "attributes": { + "enabled": true, + "nbf": 1681267326, + "exp": 1744426326, + "created": 1681267926, + "updated": 1681267926, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert27446e8292d", + "attributes": { + "enabled": true, + "nbf": 1681267332, + "exp": 1744426332, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert344656cae8e", + "attributes": { + "enabled": true, + "nbf": 1681267778, + "exp": 1712890778, + "created": 1681268379, + "updated": 1681268379, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert424544e9d25", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert4513181b", + "attributes": { + "enabled": true, + "nbf": 1681267357, + "exp": 1712890357, + "created": 1681267958, + "updated": 1681267958, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert52940cad", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert62768ede0a9", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1744426318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert69778c99", + "attributes": { + "enabled": true, + "nbf": 1681267341, + "exp": 1712890341, + "created": 1681267941, + "updated": 1681267941, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert72950e838eb", + "attributes": { + "enabled": true, + "nbf": 1681267327, + "exp": 1712890327, + "created": 1681267927, + "updated": 1681267927, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert809045b9", + "attributes": { + "enabled": true, + "nbf": 1681267362, + "exp": 1712890362, + "created": 1681267962, + "updated": 1681267962, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert81371983686", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1744426318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert825805c9c5b", + "attributes": { + "enabled": true, + "nbf": 1681267327, + "exp": 1744426327, + "created": 1681267927, + "updated": 1681267927, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert838769e3829", + "attributes": { + "enabled": true, + "nbf": 1681267333, + "exp": 1744426333, + "created": 1681267933, + "updated": 1681267933, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert8525661cae9", + "attributes": { + "enabled": true, + "nbf": 1681267326, + "exp": 1744426326, + "created": 1681267926, + "updated": 1681267926, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert85780271", + "attributes": { + "enabled": false, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267922, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert879738c7", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert915910eae03", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert92278d8e116", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlVUlZOVVEwVlNWRGt5TlRjelJqQkdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlVUlZOVVEwVlNWRGt5TlRjelJqQkdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "4776", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:29 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d376c265-c265-49ab-a4e5-909a5bd613cf" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert92573f0f", + "attributes": { + "enabled": false, + "nbf": 1681267332, + "exp": 1712890332, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert930083972c7", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1712890318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert992700fd", + "attributes": { + "enabled": true, + "nbf": 1681267332, + "exp": 1712890332, + "created": 1681267932, + "updated": 1681267933, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert99539ad0580", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey100076e94", + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey107013837", + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey2793803e0", + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey284288686", + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey416645817", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey437892a1f", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey829743998", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey8688021a6", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testlistcertversion89840", + "attributes": { + "enabled": true, + "nbf": 1681267366, + "exp": 1712890366, + "created": 1681267966, + "updated": 1681267966, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testlistcertversion90972", + "attributes": { + "enabled": true, + "nbf": 1681267380, + "exp": 1712890380, + "created": 1681267980, + "updated": 1681267980, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": null + } + } + ], + "Variables": { + "0": "listkey08514245e", + "1": "listkey159045b69" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKeyNotFound[1].json new file mode 100644 index 0000000000000..88bedfb308b29 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fcee7c3e-eb5a-400b-8995-b25d064e32a5" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "96482edd-f67d-4e9a-abad-375609168466" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKey[1].json new file mode 100644 index 0000000000000..997babcf53068 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.recoverDeletedKey[1].json @@ -0,0 +1,386 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey746197675/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d03cb283-66ac-49ab-a040-d03653218adc" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey746197675/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c9a50044-1da6-42ed-89b5-6caa87aa8182" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675/35185bd034ea4a9ea4b06c9ced701520", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "mp5GOL0ytu9xvsaxD2-zxTvNbnPF4ZmlbuqZ7GCzwqHOuaAD4IcSMepax5l38ugNJKoHEx8JtwJEtus7eZr-d-lWtLgqhI05BrsjRUit0wiZwDMqbJxZfFNsgGFaCWxr7_gydAfDF5dCXkisx5v4WGxRC3cT-O_17Pfyiv3EVODNk6o4MQyoCcF1-HT_f26C3Omjl6R_uP32lKODqaE7OEGWuWccUlIvgYeYARWoiDU54KiBZIVsAI07B8TbfDA5-6ffvoyy9CkkuzryywiTF4901rBpZdMpc7FkFaMXk7exN024_H9t8frWA5beHgs0c3gObdtLHs1rAqFIA-kNrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey746197675?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b62c6bb7-5498-4a3d-8914-6b4a1d228dc6" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey746197675", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675/35185bd034ea4a9ea4b06c9ced701520", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "mp5GOL0ytu9xvsaxD2-zxTvNbnPF4ZmlbuqZ7GCzwqHOuaAD4IcSMepax5l38ugNJKoHEx8JtwJEtus7eZr-d-lWtLgqhI05BrsjRUit0wiZwDMqbJxZfFNsgGFaCWxr7_gydAfDF5dCXkisx5v4WGxRC3cT-O_17Pfyiv3EVODNk6o4MQyoCcF1-HT_f26C3Omjl6R_uP32lKODqaE7OEGWuWccUlIvgYeYARWoiDU54KiBZIVsAI07B8TbfDA5-6ffvoyy9CkkuzryywiTF4901rBpZdMpc7FkFaMXk7exN024_H9t8frWA5beHgs0c3gObdtLHs1rAqFIA-kNrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey746197675?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5990ca50-6bba-41c1-97d5-b6ac255d7058" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey746197675" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey746197675?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d7f92b25-7d72-4d92-a15b-ae11ca8afd14" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey746197675", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675/35185bd034ea4a9ea4b06c9ced701520", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "mp5GOL0ytu9xvsaxD2-zxTvNbnPF4ZmlbuqZ7GCzwqHOuaAD4IcSMepax5l38ugNJKoHEx8JtwJEtus7eZr-d-lWtLgqhI05BrsjRUit0wiZwDMqbJxZfFNsgGFaCWxr7_gydAfDF5dCXkisx5v4WGxRC3cT-O_17Pfyiv3EVODNk6o4MQyoCcF1-HT_f26C3Omjl6R_uP32lKODqaE7OEGWuWccUlIvgYeYARWoiDU54KiBZIVsAI07B8TbfDA5-6ffvoyy9CkkuzryywiTF4901rBpZdMpc7FkFaMXk7exN024_H9t8frWA5beHgs0c3gObdtLHs1rAqFIA-kNrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey746197675/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4d741d3f-fd52-405a-a74b-36061b6c02df" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675/35185bd034ea4a9ea4b06c9ced701520", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "mp5GOL0ytu9xvsaxD2-zxTvNbnPF4ZmlbuqZ7GCzwqHOuaAD4IcSMepax5l38ugNJKoHEx8JtwJEtus7eZr-d-lWtLgqhI05BrsjRUit0wiZwDMqbJxZfFNsgGFaCWxr7_gydAfDF5dCXkisx5v4WGxRC3cT-O_17Pfyiv3EVODNk6o4MQyoCcF1-HT_f26C3Omjl6R_uP32lKODqaE7OEGWuWccUlIvgYeYARWoiDU54KiBZIVsAI07B8TbfDA5-6ffvoyy9CkkuzryywiTF4901rBpZdMpc7FkFaMXk7exN024_H9t8frWA5beHgs0c3gObdtLHs1rAqFIA-kNrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey746197675/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "304", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a5e51f7f-0d67-4f44-b954-2dad053d42d4" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) testkey746197675 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey746197675/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7d95854f-8c10-441f-8a16-4ad3deaedbf6" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675/35185bd034ea4a9ea4b06c9ced701520", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "mp5GOL0ytu9xvsaxD2-zxTvNbnPF4ZmlbuqZ7GCzwqHOuaAD4IcSMepax5l38ugNJKoHEx8JtwJEtus7eZr-d-lWtLgqhI05BrsjRUit0wiZwDMqbJxZfFNsgGFaCWxr7_gydAfDF5dCXkisx5v4WGxRC3cT-O_17Pfyiv3EVODNk6o4MQyoCcF1-HT_f26C3Omjl6R_uP32lKODqaE7OEGWuWccUlIvgYeYARWoiDU54KiBZIVsAI07B8TbfDA5-6ffvoyy9CkkuzryywiTF4901rBpZdMpc7FkFaMXk7exN024_H9t8frWA5beHgs0c3gObdtLHs1rAqFIA-kNrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey746197675" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.releaseKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.releaseKey[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.releaseKey[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKeyFromMalformedBackup[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKeyFromMalformedBackup[1].json new file mode 100644 index 0000000000000..0dc4480d73027 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKeyFromMalformedBackup[1].json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a8e4a120-1def-4237-8687-d53481b129aa" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "28", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "value": "bm9uLWV4aXN0aW5n" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "78", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "2f889471-0ec1-461c-95e6-0181e49f4ede" + }, + "ResponseBody": { + "error": { + "code": "Malformed backup blob", + "message": "Backup blob is corrupt." + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKey[1].json new file mode 100644 index 0000000000000..98af4f052b042 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.restoreKey[1].json @@ -0,0 +1,393 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey9694688f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "536aad87-7ca3-4117-86ba-c911ac1bdbf6" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9694688f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6d9396d2-5d95-4046-b577-8e31b8ff3468" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9694688f7/0ce498a0641645aba44873f3315717c1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xJ6QECx4qJx96JxidFcB_fxB7tmWl0a_8dmbJA-wATjZ_pd1fi9BGSYZBJHRohsIHBDLLNJW8eqrZT9WNtdGH7fezmTJssbulYUh1r7Q-c-2kp4xxbgQrRTFE6oTa2ETijyMkdeh11fpV3EDw-jn39u1D_v_HjJmKiOOpTC0jM9I0mx1T9Mm4LuYSzdrVrj0VGAKkk6AVlnjHcaWs9PCQRmT9DDfUWs7P1fFhR8MNsVvakCwiMQalrnOzyt7EojO0id5v78VaX0bXsPtZazl6U-sCVoJNpIa4nbFNFDodz_c8wBgqPjSkJxC2NEEqNmyNHexX0yfGpA_DRTTBAHMWQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9694688f7/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "12519", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "250168b3-f70c-4120-809e-f45f3a00023e" + }, + "ResponseBody": { + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAubnB2UnFQQlJYS2lEbk9fc2IxZXNIV1JhOVVKVG9ZdnpzYjV3SmhxT3JqTFhrMnBzd0tUekhlUEt1YzlsbVdPdXUxaUJYUU42ZnJDckppeHdtM0lSZWNaUENCREF1dHcxSmdKWVNrX2VuMGZIUVdQNGEtNjNjaVBFUVBGYzdsLXpGeDNueFNYOHBFOHJDdlZqM3Y2bnM5d2NuUVpKQW83aXI5OUl5WUFBb3lOekNFZXhKb3paWk5SdktXWklkVFVJTFhIWm5EM3oyMnRmUlhDZ3dzQnVLc3VxVVpLb2Fqa0VsWFZxTW1TSkFHTkdSblo0Qng5VTZ1dXBVSV9SM2VyUVBXbllaMktiN19iMlpSRUpKS20xNVNqM0NUNkU3ay1ZeFk0X2dndXpNMmk0cllaWk81V0VQb3lxdTNYQ3BMUnp5aWhTdWZORXowQ3N1aWpjMDdURWZBLm5RbGxEaU5jZnpDc3pYdjRwcWctaWcuM3Q5Skg5MUdZTWctdEdMb2RHQTNNeVZ6a0YzcWZRQTZnazhCR3l6bjduNVNPUUt2cjQxSGtGWUxyako2YXBXLS1mWWx3OUdBakozem1YMVloaEpydkJ1OVBKY1FQbTl4RHBGM0toYXJBMDktMkd6OExNcU1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HpCRlg0MmdOaUJlZGRNczVxbFJ6cFkzS0JoTEJuRmc" + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9694688f7?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d0ccac3e-6aae-4c07-b315-e82978dead1a" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey9694688f7", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9694688f7/0ce498a0641645aba44873f3315717c1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xJ6QECx4qJx96JxidFcB_fxB7tmWl0a_8dmbJA-wATjZ_pd1fi9BGSYZBJHRohsIHBDLLNJW8eqrZT9WNtdGH7fezmTJssbulYUh1r7Q-c-2kp4xxbgQrRTFE6oTa2ETijyMkdeh11fpV3EDw-jn39u1D_v_HjJmKiOOpTC0jM9I0mx1T9Mm4LuYSzdrVrj0VGAKkk6AVlnjHcaWs9PCQRmT9DDfUWs7P1fFhR8MNsVvakCwiMQalrnOzyt7EojO0id5v78VaX0bXsPtZazl6U-sCVoJNpIa4nbFNFDodz_c8wBgqPjSkJxC2NEEqNmyNHexX0yfGpA_DRTTBAHMWQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9694688f7?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "1ff8b7fa-3162-4e27-9d8a-31092d928860" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey9694688f7" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9694688f7?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "73084684-55ed-484d-9b28-860706441608" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey9694688f7", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9694688f7/0ce498a0641645aba44873f3315717c1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xJ6QECx4qJx96JxidFcB_fxB7tmWl0a_8dmbJA-wATjZ_pd1fi9BGSYZBJHRohsIHBDLLNJW8eqrZT9WNtdGH7fezmTJssbulYUh1r7Q-c-2kp4xxbgQrRTFE6oTa2ETijyMkdeh11fpV3EDw-jn39u1D_v_HjJmKiOOpTC0jM9I0mx1T9Mm4LuYSzdrVrj0VGAKkk6AVlnjHcaWs9PCQRmT9DDfUWs7P1fFhR8MNsVvakCwiMQalrnOzyt7EojO0id5v78VaX0bXsPtZazl6U-sCVoJNpIa4nbFNFDodz_c8wBgqPjSkJxC2NEEqNmyNHexX0yfGpA_DRTTBAHMWQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9694688f7?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "bc373a04-c38f-49ef-928c-8ce188a640db" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9694688f7?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "675fde03-9834-4af3-9b3d-1d1c8be34924" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey9694688f7" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "12519", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6;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q3hpZDh5QkxlTUxpOTRXRS0wYjZKSG1pdTBxNUhsNUlITTB5Y3o0LXJ0Ym1ZNjc4ZTA2dndhN0tTenUxMEdUendIVHNqUDYxRFhPZGFtSGY2V2Y2Q0RjbVhDWGwyUUYyV2hVT2tjS1hNRmdORDU5VzQ0QTdYMmVBaEJrVmgyUXVxd3F3cUZGMlN1OVhMbXZyT0RIU0NOSGY4N2VRc2NmWEZKeWEtX2lxYWZWYVhOWlRIUkNTVXNPUlpPYzRKZ2h6d0ZIcV8xWDJ1VEZpUkpnYl8tOHE5NDBPNzlKMnR4YndWVlQ3UFI5X196anVIV004ZEo2QWpLUy1UbU1QcUxQbnZZQkVEM1JialhCWGVQcVBzXy10ejFEa21acVhFa1VSSGRRZkZvOWhVYk5lM2NvVGJzZi1pSVhseDZWVHZod2gyRWhQN2dvYlVXSmV2MjdVOGJGYlFRSGw4ZGZHalhZc3JPSllBQnMwV0hVcEdOMmM4eXZPVUdFUnF0MFZLM3p1bHctU1NnQzFxWThPdi1TbWNmMlIyREVWdjQ5SEJJSUlDWGlMRjVOekUweWhvMXRlT1djeXVSSFJ3R3hGbkRpU1p2Z3dMaTEzUVdNdFlxZFJBRWFMdzRPb0VaeUpPZW92RlFvS19RdjhYdzdYZllLNWFGRFZGZF9jajJCVUtPY1A0anpEN2tTaGprRHc3cVJBVUM3Y0RyU0lqWUs1bE8yQTdJbTJmQXNGdWNUTXpReVJnUEc3OXJYblZySF9pUEpKdktvd3liWlFvNEU5dXZlUmpfVWxPX0dKN28yR0p6SlE1bWRlR05QN0k0cGU5WjRiUXJJYXNJVk5WN1NseXlPc0FBLnQxZm90aUxYQ3hOaHpCRlg0MmdOaUJlZGRNczVxbFJ6cFkzS0JoTEJuRmc" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "af76f779-6a01-4c73-b4c0-62685bb963fe" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9694688f7/0ce498a0641645aba44873f3315717c1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xJ6QECx4qJx96JxidFcB_fxB7tmWl0a_8dmbJA-wATjZ_pd1fi9BGSYZBJHRohsIHBDLLNJW8eqrZT9WNtdGH7fezmTJssbulYUh1r7Q-c-2kp4xxbgQrRTFE6oTa2ETijyMkdeh11fpV3EDw-jn39u1D_v_HjJmKiOOpTC0jM9I0mx1T9Mm4LuYSzdrVrj0VGAKkk6AVlnjHcaWs9PCQRmT9DDfUWs7P1fFhR8MNsVvakCwiMQalrnOzyt7EojO0id5v78VaX0bXsPtZazl6U-sCVoJNpIa4nbFNFDodz_c8wBgqPjSkJxC2NEEqNmyNHexX0yfGpA_DRTTBAHMWQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey9694688f7" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.rotateKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.rotateKey[1].json new file mode 100644 index 0000000000000..84a6e5155a3f5 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.rotateKey[1].json @@ -0,0 +1,147 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey111498f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "77cac39e-10ad-4fdb-90c6-b6c941117698" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey111498f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3523fffb-8e80-4618-b923-a6852742dc6e" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey111498f7/4c0ccac784e04a34882ccd2f36d061f7", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "p52AFDk7xytEkTdz5tvO2tMrryfCaft5n356PXCHI5BZxvQAiWTWWmgSAOZTxzE3_GJLE84gyXphpMKBTUO8CreK8zsN7h29SjJvJnyj-zd-HmYoe-hBeXpkBSFPpZO5QiVAsZI7Jc9IQeVLbHuvBUQxRDSbj-wUoBz24d2Iz8Fk0lm8WlUGex5K5XrshoaEm-vkbncUALsZm-bMTwwQZiPN0hAT6NCLkwGs-qVG77Le8HtwSsx-j3wXoP861CAABXDvx7FWWWKj76Cru-5aGP_QQ_yZ6YzSOWOVvApXcfEmoduX3gVzymqsVGCxOFvvhHFZVFQxRfca2HNwnav5QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey111498f7/rotate?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "aee7ed50-1103-4545-b3b3-8c9e8fe6f847" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey111498f7/2e18521f16d548adb1a027765c1f2680", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "5HMKwU4Iu5E4LDSPs6NNtDgsnOtisXqvlDKrkHwa7OP2-ySLX9MItV24mFLjJnuFZVONpcnrSJrGppZpAYIh1EWNzA23na5UkLZ2buwgLHOcpn5r9ErdkmyqtLl9JMUmxAD97VWV9xxZ8e8Y2v_0sAA6gxLqGx6L2qzK7SS91NjdZCsUq7TDbj9KtS93gVz1M8cSTwGfl1e6zisCk3LBlbx-PViMMvEOVVn6Fe6DKpxh3OTDETwDrwOeNFwAdCGKKPniG7t1wuXmaHBm2ZcYarRE763AVAljIZekofPJdvEBFZy6NjvejnCoRGwgcXEd4U1AYiVKcdN1n2Awb8aeOQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "rotatekey111498f7" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateDisabledKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateDisabledKey[1].json new file mode 100644 index 0000000000000..4fd9bffa4cce5 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateDisabledKey[1].json @@ -0,0 +1,155 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey284288686/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "bf4019ed-a416-4541-b8f7-25c13b14493f" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey284288686/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "EC", + "attributes": { + "enabled": false, + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "444", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6931d6bf-3075-4c1e-b412-998830aca367" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey284288686/ac6916c7a4744fe7adfbda76f1455387", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "oPZgMTyGXb1cSvR4n2nTmNBRfd_gVFwtgJJSE95JqeU", + "y": "yxmVpUYn--PIWrOV0YQTswYH3koko7Kpz2hSkS7XoRM" + }, + "attributes": { + "enabled": false, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey284288686/ac6916c7a4744fe7adfbda76f1455387?api-version=7.4", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "88", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": { + "enabled": false, + "exp": 2852668800, + "exportable": false + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "444", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a8fa91a0-a6d6-48cb-b005-9c3a95c32993" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey284288686/ac6916c7a4744fe7adfbda76f1455387", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "oPZgMTyGXb1cSvR4n2nTmNBRfd_gVFwtgJJSE95JqeU", + "y": "yxmVpUYn--PIWrOV0YQTswYH3koko7Kpz2hSkS7XoRM" + }, + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey284288686" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json new file mode 100644 index 0000000000000..e7417caa84180 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json @@ -0,0 +1,224 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey8567757a/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "efb012ba-c72e-43d4-9af4-83148a1c18aa" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey8567757a/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4e9b7e27-73b2-4d4d-b5ec-399af387c84c" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey8567757a/1767743d857a43ab9ba6c5ca88476c3e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "qhk-sWGWT8-U9vnuLfJXZQDigkOfkkqmLRsGwJyV9kE6pT2RjqmT3GAvAoPyN3tZhEm0skI083hsz2qasOZiWgyENfGF3GQMDR6uRtpkIGDl8KzkYGmU4VdhdfIBXhl4kja1_A7qSpernJNJwppLLLkIT2_4MX4r63QLljwa-Wnfw9VvxzFI_yYQWR6wmdfiMGeU3P9k6DM53l3PIlYcupkDKdYJsTq8P-1wEdJfjqH4W_7gIDvtBUry2qqPpOyh94OZuMSA1UVgNIvO_5d1qwCWaZ_PypdtH-bwOJN6OspvzBOg4ta_slncm479Vxxy7WI6db4MvPDj-2ihVSDL5Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey8567757a/rotationpolicy?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "186", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "notify" + } + } + ], + "attributes": { + "expiryTime": "P6M" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "313", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3f254aba-37d2-430b-80b4-992fd4fb12a4" + }, + "ResponseBody": { + "id": "https://azkvrecordtests.vault.azure.net/keys/rotatekey8567757a/rotationpolicy", + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "Rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": { + "expiryTime": "P6M", + "created": 1681269677, + "updated": 1681269677 + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey8567757a/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "313", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c1aa98f9-d34d-4a2e-ac03-cacb6e4f65ef" + }, + "ResponseBody": { + "id": "https://azkvrecordtests.vault.azure.net/keys/rotatekey8567757a/rotationpolicy", + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "Rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": { + "expiryTime": "P6M", + "created": 1681269677, + "updated": 1681269677 + } + } + } + ], + "Variables": { + "0": "rotatekey8567757a" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateKey[1].json new file mode 100644 index 0000000000000..6f9e1eadf7bfa --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyAsyncClientTest.updateKey[1].json @@ -0,0 +1,176 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey100076e94/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "10651c7c-c2be-4b17-9037-097955d62b3c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey100076e94/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "128", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "795", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c79c7e1d-f11a-4122-81ae-97d5f53c1665" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey100076e94/ca420b8318cc4cf4a512b5145246e2ad", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "8aNEB8U81mzy0EByOimEhjiSxKjc0Q_Sdd38hYO-t1rKUXTvtE01SJfMFKGMnJESR6X-tjnm9MJaVtboKrlsQvC_6XZ-FQbI6lJi01bWtni-LRxk9skIuiPt6xCfWRNYpaAabav6zAibaDm0mdo5F1CDkJQbgjr1w_g2svQrDxOTRl-SJlxIcMsee7jmu22PpuYBXg28b2-JtIPuMZOGXW4cyI_Qe7jsSwwIK9e7sRy3rtruJLoRqjOMZsDcOg6kQtmcIBlgBpg8A5TyQuoLb7Au7sZ_MqRatKj-pbNB_ME4a2_v6cAfM1MxAKmr4da51vmu1lTsqJY73f8Pr9vlBQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey100076e94/ca420b8318cc4cf4a512b5145246e2ad?api-version=7.4", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "150", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": { + "enabled": true, + "exp": 2852668800, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "795", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4162f123-02be-41e6-bf70-9e5f14c2a62a" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey100076e94/ca420b8318cc4cf4a512b5145246e2ad", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "8aNEB8U81mzy0EByOimEhjiSxKjc0Q_Sdd38hYO-t1rKUXTvtE01SJfMFKGMnJESR6X-tjnm9MJaVtboKrlsQvC_6XZ-FQbI6lJi01bWtni-LRxk9skIuiPt6xCfWRNYpaAabav6zAibaDm0mdo5F1CDkJQbgjr1w_g2svQrDxOTRl-SJlxIcMsee7jmu22PpuYBXg28b2-JtIPuMZOGXW4cyI_Qe7jsSwwIK9e7sRy3rtruJLoRqjOMZsDcOg6kQtmcIBlgBpg8A5TyQuoLb7Au7sZ_MqRatKj-pbNB_ME4a2_v6cAfM1MxAKmr4da51vmu1lTsqJY73f8Pr9vlBQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + } + } + ], + "Variables": { + "0": "testkey100076e94" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithDefaultSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithDefaultSize[1].json new file mode 100644 index 0000000000000..77b59237780d6 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithDefaultSize[1].json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey575002b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc805722-d8e0-11ed-a717-0022488d0014", + "x-ms-server-latency": "0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey575002b/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "106", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "434", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bcaba878-d8e0-11ed-a717-0022488d0014", + "x-ms-server-latency": "167" + }, + "ResponseBody": { + "attributes": { + "created": 1681269526, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269526 + }, + "key": { + "key_ops": [ + "deriveKey", + "wrapKey", + "verify", + "sign", + "unwrapKey", + "encrypt", + "decrypt" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testoctkey575002b/87093488ea9b080d338ec0f6a29e8092", + "kty": "oct-HSM" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testoctkey575002b" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithInvalidSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithInvalidSize[1].json new file mode 100644 index 0000000000000..eb92efb73df6b --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithInvalidSize[1].json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey99092f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc6d7b5c-d8e0-11ed-a30d-000d3a612dea", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey99092f7/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "120", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "key_size": 64, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "120", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc9628c2-d8e0-11ed-a717-0022488d0014", + "x-ms-server-latency": "15" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key size: \u002764\u0027 (Activity ID: bc9628c2-d8e0-11ed-a717-0022488d0014)" + } + } + } + ], + "Variables": { + "0": "testoctkey99092f7" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithValidSize[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithValidSize[1].json new file mode 100644 index 0000000000000..b0273ba8b71cb --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createOctKeyWithValidSize[1].json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testoctkey19160b5/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc01873a-d8e0-11ed-812a-0022488d0014", + "x-ms-server-latency": "0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testoctkey19160b5/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "121", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "oct-HSM", + "key_size": 256, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "434", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bc30cb8a-d8e0-11ed-9768-000d3a612dea", + "x-ms-server-latency": "133" + }, + "ResponseBody": { + "attributes": { + "created": 1681269526, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269526 + }, + "key": { + "key_ops": [ + "deriveKey", + "wrapKey", + "verify", + "sign", + "unwrapKey", + "encrypt", + "decrypt" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testoctkey19160b5/cc80410776f309b59d5ad89b760f3f09", + "kty": "oct-HSM" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testoctkey19160b5" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json new file mode 100644 index 0000000000000..3139d0a42049c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKeyWithPublicExponent[1].json @@ -0,0 +1,100 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testrsakey1860684/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "bc5be248-d8e0-11ed-b9d0-0022488d0014", + "x-ms-server-latency": "0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/testrsakey1860684/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "122", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA-HSM", + "key_size": 2048, + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 3 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "780", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bc74ad1e-d8e0-11ed-b9d0-0022488d0014", + "x-ms-server-latency": "2029" + }, + "ResponseBody": { + "attributes": { + "created": 1681269526, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269526 + }, + "key": { + "e": "Aw", + "key_ops": [ + "wrapKey", + "decrypt", + "encrypt", + "unwrapKey", + "sign", + "verify" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/testrsakey1860684/a707c7695b444277916f509a9ffa806f", + "kty": "RSA-HSM", + "n": "tNmP-_5iaLKo5Au2zlpZxDSNDQkng6PV4ywivh3Za2uiIQzzUROvO7pzj9myRtnkcxYqo7wqufapCo8peiTOk7vFUNGEWt5JPVg5-wCY3UWVeUvbYxHNd8MjXeiUl9T-TxIa3ujFzhOlOFH7MKaxgk6V-Y5KEC01J7b8QLkJiLFjL0yBuaA3FxL0xkK8S26etKo1GullNdNkgm2uFKqsKPwJjpvKNLiTSzNMI1m4I74a_LEww1EUXx4msXlnKfpxvu7MabZ019sIr74kQUFaV8YCTJhUh2OdZogCHu6p3GB3JvrpIfUQAsuzw85F_KZKmqkKbeT8e4e65yBcuc01IQ" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "testrsakey1860684" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKey[1].json new file mode 100644 index 0000000000000..e0f4e61b53319 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.createRsaKey[1].json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp566000f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "ba84dd30-d8e0-11ed-bcea-0022488d0014", + "x-ms-server-latency": "26" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp566000f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "106", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA-HSM", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "783", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "bb6ee308-d8e0-11ed-812a-0022488d0014", + "x-ms-server-latency": "810" + }, + "ResponseBody": { + "attributes": { + "created": 1681269524, + "enabled": true, + "exp": 2527113600, + "exportable": false, + "nbf": 949237199, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269524 + }, + "key": { + "e": "AQAB", + "key_ops": [ + "wrapKey", + "decrypt", + "encrypt", + "unwrapKey", + "sign", + "verify" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/javakeytemp566000f/9ed230a1d9e743d5012f0074295eb2d9", + "kty": "RSA-HSM", + "n": "-DGqTq-tXknTqXEyMqysDkG2sFSqnhWqVyi4ZxzltBPkk6Vm5wH__3G-yAVrNx0_GR8ojZYbypz5zTyozyam9XIs6LFbX1uBmwT4x3JKPA12bbEDRQblJcGb3a7KOFVNa-orXhbQmRyo6rWyNGpliG71gijY60_1SZcwcQX0PP4pc43dhoxFRK759MWZmQ08W4WjROOoYTpjFjGpZcO_BBuqhc2DpPfLtTLCZqdWsLaqeApLj0g7fgdQ4LfRJQ30tG1ZI7xXmVCtoH3Fq_iFmcH7f-y_AQcCRXbgWlaCjIG_75oPpCKpuLGCGYXP8PRaHRcnZGYGINeQ9GgCRhbKdw" + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp566000f" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.getRandomBytes[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.getRandomBytes[1].json new file mode 100644 index 0000000000000..85064c0b849e5 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.getRandomBytes[1].json @@ -0,0 +1,61 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/rng?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "b0fb6e52-d8e3-11ed-a717-0022488d0014", + "x-ms-server-latency": "2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/rng?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "12", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "count": 12 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "b1b3f562-d8e3-11ed-a717-0022488d0014", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "value": "qmKqXe0oMmZk7jR_" + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.releaseKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.releaseKey[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientManagedHsmTest.releaseKey[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKeyNotFound[1].json new file mode 100644 index 0000000000000..995c528d254ac --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "18f79a52-abd8-4532-abb4-41587a57d673" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "142ef0b4-61a6-4fa2-9da9-f4b1c0bc08f0" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKey[1].json new file mode 100644 index 0000000000000..e79b608817b86 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.backupKey[1].json @@ -0,0 +1,131 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey8688021a6/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ac1cad43-3333-457d-aa3a-12123734762c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey8688021a6/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6a971d6e-34c3-415f-8d20-be2789b9918f" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey8688021a6/ec55c4ec1acc456293ae4bd1f8f38f4c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "4Df8_hOeYwvQHUWBcRxWvvGibPKBisH4wUPQ4nG4vavU8Swajp8Llv__jGlzfvY1EjEi2DO8tpVaaRlEPja7V6VeIffrlllYB0F7W5dObRCh4Y5ygWgHATlZX0hV71TcdjUN8uip66HamW4MS1N9e147eYPvive23FccHK7og9FeibPhVbsuYXg3ReMPhfJeYqRmZrfh157kXY80DbtjO-uN8-KhnCngS88ucXzcB3uj2eRHhhy5QdH7yMd0ugD_MOcgmvpZQSZ2dysOgGeT8wp3TLUzmOHepGSrNXdOgHuAoZjhxBHFI8YZCOqeYKL_EtFXBqlVxapp51Ve1iU6GQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey8688021a6/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "12519", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6ba8a7d3-6f1a-413b-bc7d-77958c1d9759" + }, + "ResponseBody": { + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAuWi1VSnBKcF9rQkw0Q1JOSDVpVWpycWRtRmxwR0Fmcl8zd1JXQzRvUjg2dy1GazRaQjJvTW16cTh4ZHRRTlVOM203c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VNjencyekx5ZVo1bjZmNVVXdHV2M2dKV0Rxci03YzVsejlON2QxMGJra0VDS1VydmxnTHI4eGhiT0w4Y1RldHVqNElEOVg4ZEpNTGJuQ0cwQURyNFlFeUdfTU54T3hRME1ySTdvazVxRU91QjdUaHJnYU94STNkVmZNWXhkTXlNRXNOcFRFNWUwRm5NRkZlXzBMVU5iQ1R2ZG05U3Y2dW9kZ1NGTndxWmhkYzExUi1hZWF6OFFpblFxTG1sSkVHb2FjTWRJT2Z6bXVLR2FVSlljMy01bmNnZ3czelAzM2NiWS1OdWwtRkdRMTFTOGtJam9fQ3lZZzZodXBqWVNZWERZRXZCS0pXSFhxZW5mRW92WWhqSXNzRXdaRDVBYnlrVElkNV84U2NCc29ka1VaWXJaMWx6czQ4WHdVVTUyMFJCd0FESXNzdExRTFVJRVdkUklBLUtyY3JpVDBGdFlYdmYybEVBNzVwS2ZHeXlMTTZkRG13NWhjc19sM1YxVi1tRzlmcTZMZ2drQUVQeHQ5UWJidF92dzBCTDRobDF6ZTVET05aTlNpMkxkb0s4cEdLeUp2a3NpbEVsM01jLnd5QnFiQUhXbml6US1tRzZINUhielBib3NVaE1laVgwVjNra0VCdHptN28" + } + } + ], + "Variables": { + "0": "testkey8688021a6" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyEmptyName[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyEmptyName[1].json new file mode 100644 index 0000000000000..82359a931c57b --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyEmptyName[1].json @@ -0,0 +1,77 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys//create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "940471f6-fdfa-422d-af84-8aad8f65c00c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys//create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "69", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ef467556-85bf-47bb-a370-fc666fe8349b" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Operation not specified" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNullType[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNullType[1].json new file mode 100644 index 0000000000000..463cc7aac9783 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNullType[1].json @@ -0,0 +1,76 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javaKeyTemp/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f7eedacb-f0b5-42c3-bc65-164e42ae3b17" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javaKeyTemp/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "37", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "108", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "703421a1-bb79-4c43-9c35-786fd270e00e" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Property has invalid value\r\nProperty has invalid value\r\n" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNull[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNull[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyNull[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyWithMultipleTenants[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyWithMultipleTenants[1].json new file mode 100644 index 0000000000000..d7191755bbf05 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKeyWithMultipleTenants[1].json @@ -0,0 +1,177 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp657262d/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "320d55dd-88f3-4e9f-88ca-ff650383a08d" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp657262d/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "cc704e9e-f9ad-437f-aefc-f13f9967ca96" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp657262d/d6e06708a27940418ed1aa8f6aea719c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xkgj76G2LvihYimv68e_b6jx0VLYrVZ70AiLj3R90FuIUvK655awRZYGpAAj7wmRMI7q1MyuXvoYSkf5CgyADqG5Dzzg40oMTslLrGX1vijOfNoZ0Y9r8ihNUMoDFnrN-RUYtHBnROScClcfUeF_aZcmNkx-jeP0zMUAmfDOlJ_WFWturNZBGjiNr94S5Acziz7OJJtvVT3z_Co4wcc1ojYeWBt8YnxeR0cwclZVlSfUPuuBxMCn0BQQaSgZZJrsRmHCM9qmnOiNvXTcWVyGWr5_Lg9ZYgIvlBxTMX4UuEs6m_PhvObkI5tZ-WOJovWR00tm97_9Id03kowwcj8ZwQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp19980ab/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "17636a6a-3cbc-4a93-b33e-367eb09dcd2c" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp19980ab/735f33fe6918486fa788936cc427720e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xo61fs69b5F-LLxVt7oGmqzpPPoK9U42_uAeg8cmUG1juJHDLuql8wo3KMqNZIm_YzA2hYSCrkQ8ppak9DYJPTHUDEZisCFCHzS3egeSV-bnZuMlY0Uxregazz8SrCjLrBrdvSTPX-wXCCQdWmumExE3H6_Y_lEz8Vrlk0yU9WjKDlYD0kaHmVWxN_gvv9hlO0zmKoacM0f9aiV11ZbqLTUVVRLZlNgV5jjweNIHvfZhcLP_cR36Tq-MjSYjKefG4w7bM8dPHhUhsR2xFDSjwze1diywVUNaEBmeXWgOb9UwVaFJ-BgP3HDh25XI4zCVHnUwvCBi23d8uy8wU7VttQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "bf530acb-3a13-4c8d-b830-866e49d46908", + "1": "javakeytemp657262d", + "2": "javakeytemp19980ab" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKey[1].json new file mode 100644 index 0000000000000..523c8cc9a3b75 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createKey[1].json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp46933d1/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "768dd169-16e4-4066-904f-880e054b0809" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp46933d1/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3865bff8-2e11-4660-b29a-2bfba100ee7d" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp46933d1/ee6b034c8c874215a50f8f7d07423221", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "yR4TWsXYz-GQvR4bJPyd4Xsydj6Hs1Eug-dWdIZ7ZMGF543riTOIgjkhoRAI02ArLG34pdjRcm6p906n8AcLWLp-D98Mcy0wsJQ2yKsgDHIA4WGg8sQTsRvQXpMdVJ2GWNWc0_S3EiBkoExM0GWhgfRiMfXGu8M-o048HN1vrzA4dSziHuK75tB_LjImSSZcogXw5Kc_zjtEivl3LrUeNqaf7iRRnlUQb7FeesKS9lSUfQwKfX7j-vGwKE9TYHqo_q1XHvpBd-BVBQqyqov30iVP-ulcUsDeqPw2zox4TmzSnhqJ21hmAFxJH5g2Wwqv6eWfeBgHJGaYjcnIl_2myQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp46933d1" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createRsaKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createRsaKey[1].json new file mode 100644 index 0000000000000..d497ac0592742 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.createRsaKey[1].json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp2897450/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c0e9ae02-ec2c-4f94-883e-4f916a8356d8" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp2897450/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9ed449ec-cfed-4250-b788-12f286614ec7" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp2897450/6839bbd69b35488ea9b991dbdc257928", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uhyxjyib-xmr22PJDo5PuE1aJvV-fVBlCQx9wsTvFXCedPRBcnip_3Vg05eWVHTQoB6Yb_IVTunPeXpbn9xu8xlMUQ6D1Hcet4336H0yfP29lsjVHw5n74Rw_uJAFXqFZsumlqwPixkRNelGgkLi-ffn1Pfh4Gh6fWQ8RU2FKPahKCRaInYUKO-1ezIOqrmUG2Mn3s9jnRWRMTBJiO49XoJQTRRe2u5OCfZit_aVnuv0S4zZDw5zeYZAtSCBCV-lFbcreVLyi8Ta5U0jPyQOi1x1O-xmjaAjFI8RVwIMROXjk01SjZxc7HRzeHcBAPTRfkNktc0ddUF4_B8QZveNMQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + } + ], + "Variables": { + "0": "javakeytemp2897450" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKeyNotFound[1].json new file mode 100644 index 0000000000000..681e7793bd02a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fed74a88-0e68-442d-9443-506b212913c9" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f9dfb46f-1bf0-4578-9430-7d045c79f348" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKey[1].json new file mode 100644 index 0000000000000..ac139e3cf9f9c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.deleteKey[1].json @@ -0,0 +1,246 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey518769b82/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:42:13 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "37c6cf60-488d-4662-a325-853c7b337e47" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey518769b82/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:42:14 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4d77b95e-3641-42f9-ad02-3edb0c7c1f4a" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey518769b82/b0b6ee2495304a43bf11b34a6ec82150", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uRu03RzMRjSzaqB56xJxW3qUk1GYUDWh_iUEbZDox7BMEBtVH3t6sCq3YciaNSJDNzi5dQFXZtnYg9O_i0tK_5oQlQRv0z-kz-yO9Ln_-1Q7kowHHF7I6mdoOomvF5CooyyHaacdifAdfUHwvMHgwz62fBT2CTJ7WKgjBqk8Ox-DbUsKiizGoRJKWj7EnhzCteW440Z8E_b48Q3Huo_KjtGWhBQMukAYxNp-4b5Mkl9VD_uZ4M9rlQ54-qfaCUXlibdPbczVDMVFed2HAisGl0b22kTq_YjB3Ey2Bum3-rKplDMBScHo0wBPfLfK4Y7lxjJ5PS-rzslqpFDGzc7oyQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270935, + "updated": 1681270935, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey518769b82?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:42:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b4a7439b-cd3b-4f42-9ae3-a44f20107eb1" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey518769b82", + "deletedDate": 1681270935, + "scheduledPurgeDate": 1681875735, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey518769b82/b0b6ee2495304a43bf11b34a6ec82150", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uRu03RzMRjSzaqB56xJxW3qUk1GYUDWh_iUEbZDox7BMEBtVH3t6sCq3YciaNSJDNzi5dQFXZtnYg9O_i0tK_5oQlQRv0z-kz-yO9Ln_-1Q7kowHHF7I6mdoOomvF5CooyyHaacdifAdfUHwvMHgwz62fBT2CTJ7WKgjBqk8Ox-DbUsKiizGoRJKWj7EnhzCteW440Z8E_b48Q3Huo_KjtGWhBQMukAYxNp-4b5Mkl9VD_uZ4M9rlQ54-qfaCUXlibdPbczVDMVFed2HAisGl0b22kTq_YjB3Ey2Bum3-rKplDMBScHo0wBPfLfK4Y7lxjJ5PS-rzslqpFDGzc7oyQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270935, + "updated": 1681270935, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey518769b82?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:42:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8eec8f2f-e323-4bce-a71f-82b237a7bef9" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey518769b82" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey518769b82?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:42:25 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5935f6ad-8448-4a37-852a-42a3138d245d" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey518769b82", + "deletedDate": 1681270935, + "scheduledPurgeDate": 1681875735, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey518769b82/b0b6ee2495304a43bf11b34a6ec82150", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uRu03RzMRjSzaqB56xJxW3qUk1GYUDWh_iUEbZDox7BMEBtVH3t6sCq3YciaNSJDNzi5dQFXZtnYg9O_i0tK_5oQlQRv0z-kz-yO9Ln_-1Q7kowHHF7I6mdoOomvF5CooyyHaacdifAdfUHwvMHgwz62fBT2CTJ7WKgjBqk8Ox-DbUsKiizGoRJKWj7EnhzCteW440Z8E_b48Q3Huo_KjtGWhBQMukAYxNp-4b5Mkl9VD_uZ4M9rlQ54-qfaCUXlibdPbczVDMVFed2HAisGl0b22kTq_YjB3Ey2Bum3-rKplDMBScHo0wBPfLfK4Y7lxjJ5PS-rzslqpFDGzc7oyQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681270935, + "updated": 1681270935, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey518769b82" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientAndEncryptDecrypt[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientAndEncryptDecrypt[1].json new file mode 100644 index 0000000000000..1b09794d7d9d3 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientAndEncryptDecrypt[1].json @@ -0,0 +1,200 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/javakeytemp8919662/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a445618f-5819-42db-9d65-fae744eccb44" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp8919662/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "102", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "nbf": 949237199, + "exp": 2527113600 + }, + "tags": { + "foo": "baz" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6cb29a47-0a0a-44f8-881f-64c16575b2f8" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8919662/372bba7106d34ff1a765de0f98424678", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "u6DZNYbkoV_dxAyeW633RPlaLvierqz5BhuD0e9U0q5maFqZ04r9tfLLPwxr9my_FNvHVNtQirJFkd3X2bw3Y_-8Y_UErKFUb1P3Hrv8qctrzD87c-A7Z3sRhVfNh25FpuELe7mZKD7uX6SxSQjq9bBdSVdA3Yhl-HgOU5jvJACWWbCE5hlobOVruOW0YhEa2-hoIi-8Gp_0S38lt5N9Y7cRsACtlSeKpVxu8UJi5AsJOe9o5XH161fMxtHXIE2mmiEO4CGlAKq1D0x3jxFEYLhMBZ7qRKNDbfGkVPvcVJ6eI9QnoQzImqPToW2mUTj4K4Ivf3nOTtED_0OZ0Ig6pQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp8919662/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "771", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "cf2cb048-9003-40bf-98dc-89b7927e7ea1" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8919662/372bba7106d34ff1a765de0f98424678", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "u6DZNYbkoV_dxAyeW633RPlaLvierqz5BhuD0e9U0q5maFqZ04r9tfLLPwxr9my_FNvHVNtQirJFkd3X2bw3Y_-8Y_UErKFUb1P3Hrv8qctrzD87c-A7Z3sRhVfNh25FpuELe7mZKD7uX6SxSQjq9bBdSVdA3Yhl-HgOU5jvJACWWbCE5hlobOVruOW0YhEa2-hoIi-8Gp_0S38lt5N9Y7cRsACtlSeKpVxu8UJi5AsJOe9o5XH161fMxtHXIE2mmiEO4CGlAKq1D0x3jxFEYLhMBZ7qRKNDbfGkVPvcVJ6eI9QnoQzImqPToW2mUTj4K4Ivf3nOTtED_0OZ0Ig6pQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/javakeytemp8919662//decrypt?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "371", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "RSA-OAEP", + "value": "QA3m1tvnZNKYcjxNN_UmkjWXiFlBN2LZfjd4FbEoDEzy4dZiqaO7C5mb5N2ELiWRfe7wN4f_4N1alVTZ5BBx00O_gRpbylk-iDQKqM3d7gVEojAAANIKLs8TBhY3NHgU-HxJFFMBQlZddYcOe6tfiT9FCBtW9AxpRs17TGxwpaHWN9arlpB3P7ms6-v0gm0YR9z8Ue2PhCQ8_JzSifxSC1IHY02guDfSmtsqWlFeoNQMXkD9ap_eKmlNYKjJGGzxaytpFTw2JbSYa9TASVttanSIIsGK-aaYYRy8rAvG3vbagAZo5Ad_ygq9motiPAB7KTMAvVGAc6yynhkPXMLW5A" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "132", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "027d0f0e-e6b3-41cc-9940-9a01fa1d4006" + }, + "ResponseBody": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8919662/372bba7106d34ff1a765de0f98424678", + "value": "bXlQbGFpbnRleHQ" + } + } + ], + "Variables": { + "0": "javakeytemp8919662" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithEmptyKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithEmptyKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithEmptyKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithNullKeyVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithNullKeyVersion[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClientWithNullKeyVersion[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClient[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClient[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getCryptographyClient[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKeyNotFound[1].json new file mode 100644 index 0000000000000..31a0eaa0d0779 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "62de3d2b-94bc-4e78-bed6-c541f35ed654" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "32e50223-055f-48a2-96cf-e98c0c181d6d" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKey[1].json new file mode 100644 index 0000000000000..b272b7b886a1c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getDeletedKey[1].json @@ -0,0 +1,302 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey675388088/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b61168df-0d49-4274-a14d-5f32b926c1f5" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey675388088/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "16f5cf75-9528-42cf-a3de-f20587add3f1" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088/36efcacfab1c475297d245b8375595ae", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0X7-UdZDv6kptRQfSTrYI1m-Hbz2Jy3uh9oGevy0gW99kDZcWsS0qhJeG6gFEuwkrci-C0gyvLyIDJXRrMqIehNE2FVWo7ShP-ldwcVSPeui_1VoS3lkR54IwlWmyGrgja4DchNmjVZ691BffcJULYlvJiCsOiFwly4YhsuJHl20R3BeEhnmuXYWUtfzhjOIhVvlzhLNXKp7hkTt2uGShLEnrzDtdR7fexpeJyJTWbX0cBKH_MigZW-ennrnVQjZln8nAaJKaSz1Hd2T2m-2CMMPCnjIdVY9w6kV1UrOITCsQqXV8_xL6MLvL0IASrKNNY75v1OIzTBG4hohFpPfJQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey675388088?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "96f50010-af74-42b3-aa01-e2a69306266c" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey675388088", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088/36efcacfab1c475297d245b8375595ae", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0X7-UdZDv6kptRQfSTrYI1m-Hbz2Jy3uh9oGevy0gW99kDZcWsS0qhJeG6gFEuwkrci-C0gyvLyIDJXRrMqIehNE2FVWo7ShP-ldwcVSPeui_1VoS3lkR54IwlWmyGrgja4DchNmjVZ691BffcJULYlvJiCsOiFwly4YhsuJHl20R3BeEhnmuXYWUtfzhjOIhVvlzhLNXKp7hkTt2uGShLEnrzDtdR7fexpeJyJTWbX0cBKH_MigZW-ennrnVQjZln8nAaJKaSz1Hd2T2m-2CMMPCnjIdVY9w6kV1UrOITCsQqXV8_xL6MLvL0IASrKNNY75v1OIzTBG4hohFpPfJQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey675388088?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "704484e3-94bd-4cf5-8f59-e7295be1a2cf" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey675388088" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey675388088?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8a91efec-5044-4f5f-b286-9c4dffcf04d0" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey675388088", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088/36efcacfab1c475297d245b8375595ae", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0X7-UdZDv6kptRQfSTrYI1m-Hbz2Jy3uh9oGevy0gW99kDZcWsS0qhJeG6gFEuwkrci-C0gyvLyIDJXRrMqIehNE2FVWo7ShP-ldwcVSPeui_1VoS3lkR54IwlWmyGrgja4DchNmjVZ691BffcJULYlvJiCsOiFwly4YhsuJHl20R3BeEhnmuXYWUtfzhjOIhVvlzhLNXKp7hkTt2uGShLEnrzDtdR7fexpeJyJTWbX0cBKH_MigZW-ennrnVQjZln8nAaJKaSz1Hd2T2m-2CMMPCnjIdVY9w6kV1UrOITCsQqXV8_xL6MLvL0IASrKNNY75v1OIzTBG4hohFpPfJQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey675388088?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:50 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "be221046-cc0c-404b-a701-66a45fde9365" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey675388088", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088/36efcacfab1c475297d245b8375595ae", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "0X7-UdZDv6kptRQfSTrYI1m-Hbz2Jy3uh9oGevy0gW99kDZcWsS0qhJeG6gFEuwkrci-C0gyvLyIDJXRrMqIehNE2FVWo7ShP-ldwcVSPeui_1VoS3lkR54IwlWmyGrgja4DchNmjVZ691BffcJULYlvJiCsOiFwly4YhsuJHl20R3BeEhnmuXYWUtfzhjOIhVvlzhLNXKp7hkTt2uGShLEnrzDtdR7fexpeJyJTWbX0cBKH_MigZW-ennrnVQjZln8nAaJKaSz1Hd2T2m-2CMMPCnjIdVY9w6kV1UrOITCsQqXV8_xL6MLvL0IASrKNNY75v1OIzTBG4hohFpPfJQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey675388088" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyNotFound[1].json new file mode 100644 index 0000000000000..e41b5642b6fd0 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/non-existing/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6d28139d-96fa-4259-8633-e8e4523fd0dc" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/non-existing/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b28d6911-ad72-485b-8e56-d50fb526930a" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyOfNonExistentKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyOfNonExistentKey[1].json new file mode 100644 index 0000000000000..fa12f94191bb4 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyOfNonExistentKey[1].json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/nonexistentkey15690/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9969f18f-7a7d-457c-9e5b-b614a070a946" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/nonexistentkey15690/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "307", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5dfb2654-9ce0-482e-8f30-30c65e0c8800" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) nonexistentkey15690 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": { + "0": "nonexistentkey15690" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyWithNoPolicySet[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyWithNoPolicySet[1].json new file mode 100644 index 0000000000000..6250595685a0c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeyRotationPolicyWithNoPolicySet[1].json @@ -0,0 +1,136 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey7308409f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "bcff51b5-3e1d-4356-bd78-274c9df46f0b" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey7308409f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "564e6664-5bd4-4d46-a745-365a6601d617" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey7308409f/eac8b298af41468583c906f48ab489c5", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xebDlncUID3iTTXoEiNMZFhTgxZepTke8vdcG1RKnn7k2BuUi7dutK9D-eNZpqqmVFHy4NpkOzcPVav7o90nW04Wcb9HlRxZlAf2wB8ae8hu-PSDGzNRK2JPlcR2f524vdbdvcSRS1BiImN0ChUDdLASgEPQmbSjEbeB_VuVRj4NVC4Jl_jFpG8An3x5cn0hMdAJdd8avlJrUdteUrBLnMRtNV-sZASX2Vrx6bA6Uf6mWpxKpTBlI4Uo3mm2Ua5iRLp4wdAhiiIKVZdD4pLSDrqwtqpinzOF14zPfGoD_VOTmqLkBISm7rmgoCezDUzvWkxHkcexXKk_njYuYn_QAQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey7308409f/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "106", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4d62cb53-f2d9-4c2b-a81f-05e9e8cdff58" + }, + "ResponseBody": { + "lifetimeActions": [ + { + "trigger": { + "timeBeforeExpiry": "P30D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": null + } + } + ], + "Variables": { + "0": "rotatekey7308409f" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeySpecificVersion[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeySpecificVersion[1].json new file mode 100644 index 0000000000000..5316851a95690 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKeySpecificVersion[1].json @@ -0,0 +1,265 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey386340660/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8d987995-87b4-451c-90e1-599925339f2d" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey386340660/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8b97d816-1e6b-4b13-b2b8-6a7faff2faca" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660/2aa893a6b0024f93888a3e1725b8662e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "3SGzvLritghrjSKEvooCRUpM_y5FbdlJr2M8RU70Rc-o3F5gyuse6YMybL0VufghQCrhXEWsocAtTHVpblpmaPFwStT-IMjFSpWGTyuKqYk0ZZtJSS6BqJ8mB7kEs5yl60iUz-E9wgF6UUk1Z_ix42J47ri7a4F_0P7_xUbDCEsf1K_d3cX-Kzf2FHGawg5QpIF-lR4rYWf7Z1PE94EOqnqI-vr-89TYmSO93ajYKOz-EOZtfZ6uJ9Jv_Kg_FpnNeIdS8aREYh87j4Z7Jl7C-HLxf4uf2P4gJgfSvWbSX_gVCFGHSosdgaPWr_dVThX7ateNYSFb850XPUelPtl95Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey386340660/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "01431ebf-564b-43c2-adf4-1ab8fc88ab35" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660/da536c0229504716870c57ccbb655bb8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "6A3f7psgtX_RsbDKoE6VqAW7EMBbAO2qJMK_dexuqzDbq1kOI2yLgmTmUy7-SKjuO06HEf_YFJWL2rVsfl0cBkSsjibJiPsg9a40BrSx-8jqg0fwZF_eHQ6u5tgRVtBmdNrcNyJTiCTudYeXbOcSIxFcN5LysZBPKdOy5Wx-xzaMNhA947ZTEU7LB2I0Fs9AxopXAz7a87xvYebzmD1xpNWxod3OeRekvxR-xoGyO0acdXM8n1tKAeftcV1WrBtw3A10-4WCAIOBlxh1MDKdDnRjMfU43CvvacoRfr5Ec9FJci63PWiDrRcNwxgz0S4UOyDrltkQKB57ejESkjr_8Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey386340660/2aa893a6b0024f93888a3e1725b8662e?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3c76fd31-449a-4ee4-8f1b-968952d0dd65" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660/2aa893a6b0024f93888a3e1725b8662e", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "3SGzvLritghrjSKEvooCRUpM_y5FbdlJr2M8RU70Rc-o3F5gyuse6YMybL0VufghQCrhXEWsocAtTHVpblpmaPFwStT-IMjFSpWGTyuKqYk0ZZtJSS6BqJ8mB7kEs5yl60iUz-E9wgF6UUk1Z_ix42J47ri7a4F_0P7_xUbDCEsf1K_d3cX-Kzf2FHGawg5QpIF-lR4rYWf7Z1PE94EOqnqI-vr-89TYmSO93ajYKOz-EOZtfZ6uJ9Jv_Kg_FpnNeIdS8aREYh87j4Z7Jl7C-HLxf4uf2P4gJgfSvWbSX_gVCFGHSosdgaPWr_dVThX7ateNYSFb850XPUelPtl95Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey386340660/da536c0229504716870c57ccbb655bb8?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6f2dd7eb-db38-4b20-bb3f-25aa09ec938d" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660/da536c0229504716870c57ccbb655bb8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "6A3f7psgtX_RsbDKoE6VqAW7EMBbAO2qJMK_dexuqzDbq1kOI2yLgmTmUy7-SKjuO06HEf_YFJWL2rVsfl0cBkSsjibJiPsg9a40BrSx-8jqg0fwZF_eHQ6u5tgRVtBmdNrcNyJTiCTudYeXbOcSIxFcN5LysZBPKdOy5Wx-xzaMNhA947ZTEU7LB2I0Fs9AxopXAz7a87xvYebzmD1xpNWxod3OeRekvxR-xoGyO0acdXM8n1tKAeftcV1WrBtw3A10-4WCAIOBlxh1MDKdDnRjMfU43CvvacoRfr5Ec9FJci63PWiDrRcNwxgz0S4UOyDrltkQKB57ejESkjr_8Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey386340660" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKey[1].json new file mode 100644 index 0000000000000..d1000e28aaf0f --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.getKey[1].json @@ -0,0 +1,153 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey437892a1f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ca3fd4aa-f0a8-49ff-8c7d-54bf13bf83f6" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey437892a1f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c0f5eb8d-770b-4546-be1e-cf3b3dcd2aaa" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey437892a1f/56566ae4ad97459b903efc7d92bdf2aa", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "7Ss51_OKrQH3AjVEhqrU8oRPnB7ZbjXz9V1HokmDMCSynz_oPkQ0NrY2Bqkr_Hvbs8tRRWDIqhftkfeGkga8Yi8uF_NgsKCDLj-ZIp0NfjHfKV5DoJCxiVreKbdbrSeCQADgf6acvT6j2ushxcj0d65u_OE9VtBChAKH2rAEzQ_6fDW85hpc1GN8dHBI_X78sJkSehmm3x5ZXE46OEMt9pLjS8TB5T8lMl_lI_kqsZr0TOr2_Zz_ShPmhHjBcAenYJZCdgYl2gd60MuqqFnZNe6YLTCZLt3F60zDDZH6IxWz1ON_6qfZ-5xQZeta7wP8rObsR6LFwL5yzLO0vvGVFQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey437892a1f/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8bff8082-3ecc-473d-af00-fa91c7deb0fc" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey437892a1f/56566ae4ad97459b903efc7d92bdf2aa", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "7Ss51_OKrQH3AjVEhqrU8oRPnB7ZbjXz9V1HokmDMCSynz_oPkQ0NrY2Bqkr_Hvbs8tRRWDIqhftkfeGkga8Yi8uF_NgsKCDLj-ZIp0NfjHfKV5DoJCxiVreKbdbrSeCQADgf6acvT6j2ushxcj0d65u_OE9VtBChAKH2rAEzQ_6fDW85hpc1GN8dHBI_X78sJkSehmm3x5ZXE46OEMt9pLjS8TB5T8lMl_lI_kqsZr0TOr2_Zz_ShPmhHjBcAenYJZCdgYl2gd60MuqqFnZNe6YLTCZLt3F60zDDZH6IxWz1ON_6qfZ-5xQZeta7wP8rObsR6LFwL5yzLO0vvGVFQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey437892a1f" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listDeletedKeys[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listDeletedKeys[1].json new file mode 100644 index 0000000000000..9f33aceaa6169 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listDeletedKeys[1].json @@ -0,0 +1,1132 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/2800fa5c9aeb482586f5/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ed6aed7c-a21c-4aa3-90c6-9dc243fd0882" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/2800fa5c9aeb482586f5/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8d645f3f-ae81-4725-af18-ce86a11811b7" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/2800fa5c9aeb482586f5/4edf819c15b9449ba46892a340d84c55", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wZnhLNhjPWhTsovOAjID_z1R5EPWTZFEF1Q16Jn_W72mQxeBa13iK9f9erWR6hggKb7HPmnCMFJsikIP-TF9HMyPzJB4Tlyz7kr9nSqciO9a8vRDWIldMMKFroZHVkJr4l0A3pdsOr_b6yEK_N7kLuC4NNdfgIbWQ-QRbJoBjgtW8nax-BNNAEDh9riw1Nw1JZ_no5HzNZcPZ9F1iBZrc1rXCv5rquGT-w9n_YkFvzrGg77whAi9_2DkzIEcDOZomDqAKQJgeY-atOIMf7ldOjyn2TUrfGquFdBUxG2sgct2XnqPHMRnNJ8_YSBwSv1SfnB4nE8fQmTwyILXuOZtUQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/f25cb70c8f614398a35f/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ef569c02-7780-4a6a-ae5e-5ca915555c53" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/f25cb70c8f614398a35f/591239e8ae5a4b5684ecf11def9ede0a", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "zvtovjgd0qf-wWW2Hat-kouxD8Tx-1IZBM8ogqqn9ytr7GUc0RstV3pLYMATFiP5iiqi-FV3CPVK17S77CW9gDOQIyVCLkvZ8oAQjOSMsUSkPPoYZmrdq6NinpvDYUrJT7T5MbW3XfYGacsiLKv4pVQPtn-bFz5LJk6lnd1MhS96edAhQZ5x48u8DJIsomxpcf7xugR681oZobHmT60dQWwudD3McXIUjWgKZNFXIoo3z3xGwITs3PpLdMbG2vwwyJ6txklfPf0Bv5op1RHq3TxP4-WUY94sFFeJ5fc7crG_qkukveuEqWs10VFXddfDimKfmIi7iVby1pJw96EX_Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/1fc4269c1a3f44f3843a/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3799353600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "736", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f68d5679-8b1e-4398-95a2-11ec7fb45981" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/1fc4269c1a3f44f3843a/47e3fbd8864f424bae4c62ddb847674c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uYFXVifL0AyNW7FyKoSBTkWEc-jtWYvrnPBzySlP5RuNZ-ELJaI-fHTv707-TvlK273dGxZrxMUoyd5-86Fut8pZ6uAeCfiIFkhD1p7ispRJRlLHlzB2ct7hooqj715cFppmZ6aWHthBklSpIJ1yxfXBEID-gdsU-iWrti3zMDjZllU7lBwQq5p1uUn2FiUtESL3D_etkhfPnCCMv9ZUmL3yA-2ZpdDgGzpItkpAPj8XsqyS3dGYiX3NI2OJgF0sw6_9BIQXUTTHehZiVd_LPusRXSb91g9Km7W49CnQKdzvQaQSUbvgnFWY7ACD_1TVfxvskXO-YuJl96LM93IYoQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/2800fa5c9aeb482586f5?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "505eb531-1e54-4532-9e9e-e61e97d6270a" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/2800fa5c9aeb482586f5", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/2800fa5c9aeb482586f5/4edf819c15b9449ba46892a340d84c55", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wZnhLNhjPWhTsovOAjID_z1R5EPWTZFEF1Q16Jn_W72mQxeBa13iK9f9erWR6hggKb7HPmnCMFJsikIP-TF9HMyPzJB4Tlyz7kr9nSqciO9a8vRDWIldMMKFroZHVkJr4l0A3pdsOr_b6yEK_N7kLuC4NNdfgIbWQ-QRbJoBjgtW8nax-BNNAEDh9riw1Nw1JZ_no5HzNZcPZ9F1iBZrc1rXCv5rquGT-w9n_YkFvzrGg77whAi9_2DkzIEcDOZomDqAKQJgeY-atOIMf7ldOjyn2TUrfGquFdBUxG2sgct2XnqPHMRnNJ8_YSBwSv1SfnB4nE8fQmTwyILXuOZtUQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/2800fa5c9aeb482586f5?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "27289ad0-5805-41ed-aa6c-3224a66d7a60" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: 2800fa5c9aeb482586f5" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/2800fa5c9aeb482586f5?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "41d410ac-08d1-4d6d-af4a-f7d4a972c884" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/2800fa5c9aeb482586f5", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/2800fa5c9aeb482586f5/4edf819c15b9449ba46892a340d84c55", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wZnhLNhjPWhTsovOAjID_z1R5EPWTZFEF1Q16Jn_W72mQxeBa13iK9f9erWR6hggKb7HPmnCMFJsikIP-TF9HMyPzJB4Tlyz7kr9nSqciO9a8vRDWIldMMKFroZHVkJr4l0A3pdsOr_b6yEK_N7kLuC4NNdfgIbWQ-QRbJoBjgtW8nax-BNNAEDh9riw1Nw1JZ_no5HzNZcPZ9F1iBZrc1rXCv5rquGT-w9n_YkFvzrGg77whAi9_2DkzIEcDOZomDqAKQJgeY-atOIMf7ldOjyn2TUrfGquFdBUxG2sgct2XnqPHMRnNJ8_YSBwSv1SfnB4nE8fQmTwyILXuOZtUQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/f25cb70c8f614398a35f?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c01bdbcb-e965-475c-89b8-0770412be50a" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/f25cb70c8f614398a35f", + "deletedDate": 1681269680, + "scheduledPurgeDate": 1681874480, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/f25cb70c8f614398a35f/591239e8ae5a4b5684ecf11def9ede0a", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "zvtovjgd0qf-wWW2Hat-kouxD8Tx-1IZBM8ogqqn9ytr7GUc0RstV3pLYMATFiP5iiqi-FV3CPVK17S77CW9gDOQIyVCLkvZ8oAQjOSMsUSkPPoYZmrdq6NinpvDYUrJT7T5MbW3XfYGacsiLKv4pVQPtn-bFz5LJk6lnd1MhS96edAhQZ5x48u8DJIsomxpcf7xugR681oZobHmT60dQWwudD3McXIUjWgKZNFXIoo3z3xGwITs3PpLdMbG2vwwyJ6txklfPf0Bv5op1RHq3TxP4-WUY94sFFeJ5fc7crG_qkukveuEqWs10VFXddfDimKfmIi7iVby1pJw96EX_Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/f25cb70c8f614398a35f?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ace6b37a-36b0-4baf-b548-396fd26f9f82" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: f25cb70c8f614398a35f" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/f25cb70c8f614398a35f?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9b7b4b0c-e322-4786-be8b-6e60f43d1969" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/f25cb70c8f614398a35f", + "deletedDate": 1681269680, + "scheduledPurgeDate": 1681874480, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/f25cb70c8f614398a35f/591239e8ae5a4b5684ecf11def9ede0a", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "zvtovjgd0qf-wWW2Hat-kouxD8Tx-1IZBM8ogqqn9ytr7GUc0RstV3pLYMATFiP5iiqi-FV3CPVK17S77CW9gDOQIyVCLkvZ8oAQjOSMsUSkPPoYZmrdq6NinpvDYUrJT7T5MbW3XfYGacsiLKv4pVQPtn-bFz5LJk6lnd1MhS96edAhQZ5x48u8DJIsomxpcf7xugR681oZobHmT60dQWwudD3McXIUjWgKZNFXIoo3z3xGwITs3PpLdMbG2vwwyJ6txklfPf0Bv5op1RHq3TxP4-WUY94sFFeJ5fc7crG_qkukveuEqWs10VFXddfDimKfmIi7iVby1pJw96EX_Q", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/1fc4269c1a3f44f3843a?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "5e3cbe01-505d-4bdd-a989-7a069bd89239" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/1fc4269c1a3f44f3843a", + "deletedDate": 1681269681, + "scheduledPurgeDate": 1681874481, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/1fc4269c1a3f44f3843a/47e3fbd8864f424bae4c62ddb847674c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uYFXVifL0AyNW7FyKoSBTkWEc-jtWYvrnPBzySlP5RuNZ-ELJaI-fHTv707-TvlK273dGxZrxMUoyd5-86Fut8pZ6uAeCfiIFkhD1p7ispRJRlLHlzB2ct7hooqj715cFppmZ6aWHthBklSpIJ1yxfXBEID-gdsU-iWrti3zMDjZllU7lBwQq5p1uUn2FiUtESL3D_etkhfPnCCMv9ZUmL3yA-2ZpdDgGzpItkpAPj8XsqyS3dGYiX3NI2OJgF0sw6_9BIQXUTTHehZiVd_LPusRXSb91g9Km7W49CnQKdzvQaQSUbvgnFWY7ACD_1TVfxvskXO-YuJl96LM93IYoQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/1fc4269c1a3f44f3843a?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "2c3c7a46-cefd-4135-9e2d-80777c8f6bb8" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: 1fc4269c1a3f44f3843a" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/1fc4269c1a3f44f3843a?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d0bc0e21-4264-4679-9639-1972743210e8" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: 1fc4269c1a3f44f3843a" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/1fc4269c1a3f44f3843a?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "881", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:23 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "130037c4-f3a6-4f66-a8b3-955d4e3a30f6" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/1fc4269c1a3f44f3843a", + "deletedDate": 1681269681, + "scheduledPurgeDate": 1681874481, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/1fc4269c1a3f44f3843a/47e3fbd8864f424bae4c62ddb847674c", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "uYFXVifL0AyNW7FyKoSBTkWEc-jtWYvrnPBzySlP5RuNZ-ELJaI-fHTv707-TvlK273dGxZrxMUoyd5-86Fut8pZ6uAeCfiIFkhD1p7ispRJRlLHlzB2ct7hooqj715cFppmZ6aWHthBklSpIJ1yxfXBEID-gdsU-iWrti3zMDjZllU7lBwQq5p1uUn2FiUtESL3D_etkhfPnCCMv9ZUmL3yA-2ZpdDgGzpItkpAPj8XsqyS3dGYiX3NI2OJgF0sw6_9BIQXUTTHehZiVd_LPusRXSb91g9Km7W49CnQKdzvQaQSUbvgnFWY7ACD_1TVfxvskXO-YuJl96LM93IYoQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "2748", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d4e52c9d-8ebd-45d4-8b7f-a22f67afb4da" + }, + "ResponseBody": { + "value": [ + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/1fc4269c1a3f44f3843a", + "deletedDate": 1681269681, + "scheduledPurgeDate": 1681874481, + "kid": "https://azkvrecordtests.vault.azure.net/keys/1fc4269c1a3f44f3843a", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/2800fa5c9aeb482586f5", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "kid": "https://azkvrecordtests.vault.azure.net/keys/2800fa5c9aeb482586f5", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/4fa7f90520004bbe875b", + "deletedDate": 1681269688, + "scheduledPurgeDate": 1681874488, + "kid": "https://azkvrecordtests.vault.azure.net/keys/4fa7f90520004bbe875b", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/864b42db022c44f2a33a", + "deletedDate": 1681269691, + "scheduledPurgeDate": 1681874491, + "kid": "https://azkvrecordtests.vault.azure.net/keys/864b42db022c44f2a33a", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/a874a3dd019c4f0d8fd9", + "deletedDate": 1681269689, + "scheduledPurgeDate": 1681874489, + "kid": "https://azkvrecordtests.vault.azure.net/keys/a874a3dd019c4f0d8fd9", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/f25cb70c8f614398a35f", + "deletedDate": 1681269680, + "scheduledPurgeDate": 1681874480, + "kid": "https://azkvrecordtests.vault.azure.net/keys/f25cb70c8f614398a35f", + "attributes": { + "enabled": true, + "exp": 3799353600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVTFJV3RsZVM5S1FWWkJTMFZaVkVWTlVESTRPVGMwTlRBdk5qZ3pPVUpDUkRZNVFqTTFORGc0UlVFNVFqazVNVVJDUkVNeU5UYzVNamdoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVTFJV3RsZVM5S1FWWkJTMFZaVkVWTlVESTRPVGMwTlRBdk5qZ3pPVUpDUkRZNVFqTTFORGc0UlVFNVFqazVNVVJDUkVNeU5UYzVNamdoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "1cd90342-3c9c-422c-901d-ac2cf57353d6" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "28330d0e-ca5a-4e43-805d-0e89e33aea92" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVTMFZaTVRVNU1EUTFRalk1THpWQ05qRXpOVFZDUXpaQ1FqUkNNVE01TkVJd05EUXlNRVF4UVVReVJFSkRJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5TVNWTlVTMFZaTVRVNU1EUTFRalk1THpWQ05qRXpOVFZDUXpaQ1FqUkNNVE01TkVJd05EUXlNRVF4UVVReVJFSkRJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4a4c5547-5578-49fa-9b59-25a38da8cf6c" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREEzTkRjeU1FUkVORVUxSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREEzTkRjeU1FUkVORVUxSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b6d0e5d5-cc26-4787-accc-00ddc35b722e" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVRMFZTVkRVeU9UUXdRMEZFTHpBMU16SkRRMEV4TWtaRFFUUkdORU5DTURNelF6Z3hSVVpHT0RnM09FWXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVRMFZTVkRVeU9UUXdRMEZFTHpBMU16SkRRMEV4TWtaRFFUUkdORU5DTURNelF6Z3hSVVpHT0RnM09FWXpJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "301", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "07a93b06-8651-43c0-911e-036bc88152f6" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt4TlRreE1FVkJSVEF6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt4TlRreE1FVkJSVEF6SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "355", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9d8d01b7-a4a2-4cd9-82d4-9fa963a68dcd" + }, + "ResponseBody": { + "value": [], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVTMFZaTXprMk5qVXlRVGMyTHpKRFJVVTVRVFpDTWtWRU5UUkdRa1pDTnpWQlF6WkdNekl4T0RSRFEwSkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzIhTURBd01EVXpJV3RsZVM5VVJWTlVTMFZaTXprMk5qVXlRVGMyTHpKRFJVVTVRVFpDTWtWRU5UUkdRa1pDTnpWQlF6WkdNekl4T0RSRFEwSkNJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1869", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "804f22e4-e061-46d4-8073-8b4401e13fbb" + }, + "ResponseBody": { + "value": [ + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey5338851c6", + "deletedDate": 1681269708, + "scheduledPurgeDate": 1681874508, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey5338851c6", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269708, + "updated": 1681269708, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey585510f07", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey585510f07", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey665999479", + "deletedDate": 1681269678, + "scheduledPurgeDate": 1681874478, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey665999479", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey675388088", + "deletedDate": 1681269679, + "scheduledPurgeDate": 1681874479, + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey675388088", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269679, + "updated": 1681269679, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXdGxlUzlVUlZOVVRFbFRWRU5GVWxSV1JWSlRTVTlPT0RrNE5EQWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXdGxlUzlVUlZOVVRFbFRWRU5GVWxSV1JWSlRTVTlPT0RrNE5EQWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "3eeb0d8e-e9fb-40d6-bbd8-258966cb9a07" + }, + "ResponseBody": { + "value": [], + "nextLink": null + } + } + ], + "Variables": { + "0": "2800fa5c9aeb482586f5", + "1": "f25cb70c8f614398a35f", + "2": "1fc4269c1a3f44f3843a" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeyVersions[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeyVersions[1].json new file mode 100644 index 0000000000000..c4172933cf939 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeyVersions[1].json @@ -0,0 +1,358 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fba320f8-c191-4511-a7e2-eb1321e4272b" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797280000 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:25 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "cc513e19-f446-477f-ab09-47183dbab1d6" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/e57bef0a99ef4b3bbaf28271c35f9f65", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "051HS3OEkgl7iPl7K_2oqJcGS8iN6Ad90SBGItlgrPpgFbSwvFaJ-SAvIT8HdWU93Tf4Aq64XEj55kXRfQ-dymK1OKc2KpYFYAocszQ2BxrMevMcCybqASTd_Gzuy7rsvtkd1GVyvnE6512SMwsy8VcdIALpSdKm1s3B12QmyX_DsreJvsaJYfWvCbFOa9nbvZVTo33cPSjB2zuKlD79IRimW_Ynadb7mA8EkvYHeuPjT7VRZa30ExRQ1RGkZAVsICQ5OtiBtq-bjJkWZqhELnf-eHm7chpyVqFfkoAicamwkl6-koIdYzHaGtZ2fo1bNrKENtAbTPK_dXkaJgYEzQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797280000, + "created": 1681271005, + "updated": 1681271005, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797366400 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:29 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "1f10fc29-a85b-46fc-8923-a97eddec36ca" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/a27e40fea0664eb8a50bb876e4eeeb8a", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "zyG1kSvdmEmw-wJdKr15fzyHFT91JzhlwDb533V9EoVcRd4R4WWhoqiSs5_r7WD4CuCfdUMratf-EdpAAsRRIAhzjUOQUkGqT8CsXQABGSjAa4kyYqJY8JphL-NVlq_GPaa6ndbOWitViRy07UXCXHhSg2zHq4RIjdTc_O74c3jEtnW1HIAYx4Pa-m8xMyH6n547ExKrL95VYCXuxxaxyqRJE7BpTMt-MukdB5pMCdPXzzHvQcbG93_-Ab0WOjWc55Z9BdX7YEcE2RulxesKKfGuDgCm-3Q9xEZjD5-1NQy6-1QyUOQqrrflxGRgXFW4TpUlu2gOQTbMckxY0X2rMQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797366400, + "created": 1681271009, + "updated": 1681271009, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797452800 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:33 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7f0db623-4226-47fd-9841-79b8edc3f971" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/92114311a9594ae683cecd9f33ce5c73", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oT-9Fvn-vM6bup6Q1ejTF1rFabgQTcsZSEx4XbeAtg8jKbV9M1xUbWptvfyAJxe7_-Pr31jNBQyPYGmnyOaBcOdVb7uoXF2TJpNWeyUfOu0fKLTffsxQHpdvGJnXWDs0m1N3SqVlJdzPxf2uyeJHS1UI7SRAkPlHp1CHub8Rkhc-JjXF4ZZ8Lj0qiih6VDsmrwUmQakQkLl5gqKNR-06SVuZ0DnUb-Me1ZE_N5HeHLCA0fmd5Q_wr75B7jF888l6SAsRleP_nT89M8kXjCQdmRCfBgx7Jp5dHYDQilxa5LD3ItBJtAVBStRuzn3p8v3rZcVGbg4vtwSQH02RWfjcfQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797452800, + "created": 1681271013, + "updated": 1681271013, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 3797539200 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "735", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a9c2da4b-8be1-4d22-8ced-86d11e26c44e" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/a27a50935af9424badb61617ab9119ba", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "wEs7ixp96PsYaydFyYKZbPFkv5YhmJcTb2vGWAcKabfiuReniDYsqhOIiIbyMeaUA2e0RfKpr-8OD2fHA_0jX3y7K3R5W8m6Rfufgw58sifMZ9ghVDvRlP89rpgGkoOr1C-dS2reh21YJKKlFJ-CEIXRklEtm3ORxRDvL3Vc8uFF4239AzAResanVjUcyu6HpHtimK_1dOfuBKAGbm-zVXbUIt7oevAsymGavzo1bfTeII0YW_2Opp3ixqiI6xFbYi8vqWmmesd3ScEIn_FHNgypQihrgwtIBZ1KpCOrcOSQhzA9CLvuNWEcDucbKpn91Nc_Orc02FcRrJuvtD4NlQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681271017, + "updated": 1681271017, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkeyversion13418/versions?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1171", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:43:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "6e61cf8f-e467-404f-a87b-197b2822ff88" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/92114311a9594ae683cecd9f33ce5c73", + "attributes": { + "enabled": true, + "exp": 3797452800, + "created": 1681271013, + "updated": 1681271013, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/a27a50935af9424badb61617ab9119ba", + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681271017, + "updated": 1681271017, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/a27e40fea0664eb8a50bb876e4eeeb8a", + "attributes": { + "enabled": true, + "exp": 3797366400, + "created": 1681271009, + "updated": 1681271009, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion13418/e57bef0a99ef4b3bbaf28271c35f9f65", + "attributes": { + "enabled": true, + "exp": 3797280000, + "created": 1681271005, + "updated": 1681271005, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "0": "listkeyversion13418" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeys[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeys[1].json new file mode 100644 index 0000000000000..6d1379a26c2ae --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.listKeys[1].json @@ -0,0 +1,1424 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/listkey032723001/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a833f8fe-8070-4dca-9b61-1909b480bf0c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey032723001/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "49c7541a-a3e5-4df2-bdd4-5aee10987fd3" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey032723001/b51f207c98e24726bec61d641d118542", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "nxMJUtzB7Ya7dJo1XflDI4GcsYMwHFWbKvJ8SHm5JJYLnbrsoK8OW8sLlAWlR3Uwyuggl5AGG4aWc1U-30zQ1QQtVFWTB-9PGTjupw66SwYsd0vATyJdp7bWp93CLbEJm-07ZUi3j-WNDgfy1ML5YEuJ7Linl7Pg1nRwEz3LDYS_H62m0m9puFaDWCWpKk8Xj_n6g2ywC7G4CAo15rEzOQJnBSu9CqkWLv0WQZNg6fcSh1FChIrCOJ1npV-T3OKrySBfic-sBI6JWSCMpIFq5rmTKUXU-TSEIIYsQAhnjaRkbR7QRui0ClUy80q4Y5aaaZGnPwAsEmmWfot9L9tmrQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey127903b45/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 429, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "146", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c9d8701f-b1df-4159-a305-c319ea251aec" + }, + "ResponseBody": { + "error": { + "code": "Throttled", + "message": "Request was not processed because too many requests were received. Reason: VaultRequestTypeLimitReached" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey127903b45/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 429, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "146", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:27 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "31fd7e40-f93c-4882-8943-f1bb037ceeba" + }, + "ResponseBody": { + "error": { + "code": "Throttled", + "message": "Request was not processed because too many requests were received. Reason: VaultRequestTypeLimitReached" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/listkey127903b45/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:31 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d1342b2b-9b6f-478f-ad2a-1371a267356a" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey127903b45/bb5a4d68b17c449fbded02f19cef7cc5", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "u8m5SFfjofCn6Z0BW5SRnRGAT8j4mS0wc3EpCfCC4o4NYhmdMU3o_rs69cMOtgw28N6REkeMP-x4hkMLdxfQ4-8owvoA6JPWWq8NdNp-bmlWfp-I8Rbw4Xu9Z_kBnwv_Xt-EuE_J7Zf9c8jLMV4OG0OyhKNVI7yMqdTqUMDHlLSgCzIM3DhOpdYAgsngtXLwfL9-9jzCj1LuFM_7T5Gd9HN9KweeK6JvflqGpkVXIvFkJoPuH4Y04_XfbsS1eZ552HrpAbgSStFHAK9LFkZGUO5ApNa5YskRQwW0uFCsnQXVWJ4mAQRZqF74AX2PVAcsF1MUHGGk39fkBfG43ASsaQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269692, + "updated": 1681269692, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys?maxresults=25\u0026api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "5676", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "beaa1f72-692b-42d6-b368-2619e1f80131" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpem36190600", + "attributes": { + "enabled": true, + "nbf": 1581722236, + "exp": 1739402236, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpem88272c66", + "attributes": { + "enabled": true, + "nbf": 1581722236, + "exp": 1739402236, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpkcs0802660b", + "attributes": { + "enabled": true, + "nbf": 1677892443, + "exp": 1709428443, + "created": 1681267922, + "updated": 1681267922, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/importcertpkcs72765dc3", + "attributes": { + "enabled": true, + "nbf": 1677892443, + "exp": 1709428443, + "created": 1681267917, + "updated": 1681267917, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": { + "key": "val" + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp10580ed", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp19980ab", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp2897450", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp46933d1", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp48817f8", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp55637e7", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp657262d", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp75324e4", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8730681", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/javakeytemp8919662", + "attributes": { + "enabled": true, + "nbf": 949237199, + "exp": 2527113600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "foo": "baz" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey019934147", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1712890317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey14364bdb0", + "attributes": { + "enabled": true, + "nbf": 1681267351, + "exp": 1712890351, + "created": 1681267952, + "updated": 1681267952, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey1765847e0", + "attributes": { + "enabled": true, + "nbf": 1681267331, + "exp": 1712890331, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey28482fa02", + "attributes": { + "enabled": true, + "nbf": 1681267320, + "exp": 1712890320, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey35523cfe7", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJMElXdGxlUzlNU1ZOVVEwVlNWRXRGV1RNM01UYzBNMFpGTXlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "5070", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "91ce7de7-4b49-44cd-9f33-ced843552131" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey371743fe3", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey53952219e", + "attributes": { + "enabled": true, + "nbf": 1681267375, + "exp": 1712890375, + "created": 1681267975, + "updated": 1681267975, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listcertkey73640952b", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1712890317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey032723001", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey08514245e", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey127903b45", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269692, + "updated": 1681269692, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkey159045b69", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/listkeyversion34156", + "attributes": { + "enabled": true, + "exp": 3797539200, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/myalias", + "attributes": { + "enabled": true, + "nbf": 1681262971, + "exp": 1712885971, + "created": 1681263571, + "updated": 1681263571, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey111498f7", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey27056f79", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey66098157", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey7308409f", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey8567757a", + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey97102ac5", + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert01202f7c384", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert04277a19e08", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert05792b1d900", + "attributes": { + "enabled": false, + "nbf": 1681267338, + "exp": 1712890338, + "created": 1681267939, + "updated": 1681267939, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert074720dd4e5", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREV5TWpRNFFUbEdRelkzSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWREV5TWpRNFFUbEdRelkzSVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "6148", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "86dc18ca-46b2-4a6e-b1c5-e89b11eeb977" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert12248a9fc67", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert133557460fc", + "attributes": { + "enabled": true, + "nbf": 1681267317, + "exp": 1744426317, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert15970ce7b3a", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1712890318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert2087690df30", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert231873819ea", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert24189bd8691", + "attributes": { + "enabled": true, + "nbf": 1681267326, + "exp": 1744426326, + "created": 1681267926, + "updated": 1681267926, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert27446e8292d", + "attributes": { + "enabled": true, + "nbf": 1681267332, + "exp": 1744426332, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert344656cae8e", + "attributes": { + "enabled": true, + "nbf": 1681267778, + "exp": 1712890778, + "created": 1681268379, + "updated": 1681268379, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert424544e9d25", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert4513181b", + "attributes": { + "enabled": true, + "nbf": 1681267357, + "exp": 1712890357, + "created": 1681267958, + "updated": 1681267958, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert52940cad", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert62768ede0a9", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1744426318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert69778c99", + "attributes": { + "enabled": true, + "nbf": 1681267341, + "exp": 1712890341, + "created": 1681267941, + "updated": 1681267941, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert72950e838eb", + "attributes": { + "enabled": true, + "nbf": 1681267327, + "exp": 1712890327, + "created": 1681267927, + "updated": 1681267927, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert809045b9", + "attributes": { + "enabled": true, + "nbf": 1681267362, + "exp": 1712890362, + "created": 1681267962, + "updated": 1681267962, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert81371983686", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1744426318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert825805c9c5b", + "attributes": { + "enabled": true, + "nbf": 1681267327, + "exp": 1744426327, + "created": 1681267927, + "updated": 1681267927, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert838769e3829", + "attributes": { + "enabled": true, + "nbf": 1681267333, + "exp": 1744426333, + "created": 1681267933, + "updated": 1681267933, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert8525661cae9", + "attributes": { + "enabled": true, + "nbf": 1681267326, + "exp": 1744426326, + "created": 1681267926, + "updated": 1681267926, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert85780271", + "attributes": { + "enabled": false, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267922, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert879738c7", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1712890321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert915910eae03", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": "https://azkvrecordtests.vault.azure.net:443/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt5TWpjNFJEaEZNVEUySVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25" + } + }, + { + "RequestUri": "https://REDACTED/keys?api-version=7.4\u0026$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklXdGxlUzlVUlZOVVEwVlNWRGt5TWpjNFJEaEZNVEUySVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ\u0026maxresults=25", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "5042", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "58ce0e46-a241-4d40-9341-bfe21921c2a1" + }, + "ResponseBody": { + "value": [ + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert92278d8e116", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert92573f0f", + "attributes": { + "enabled": false, + "nbf": 1681267332, + "exp": 1712890332, + "created": 1681267932, + "updated": 1681267932, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert930083972c7", + "attributes": { + "enabled": true, + "nbf": 1681267318, + "exp": 1712890318, + "created": 1681267918, + "updated": 1681267918, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert992700fd", + "attributes": { + "enabled": true, + "nbf": 1681267332, + "exp": 1712890332, + "created": 1681267932, + "updated": 1681267933, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "tags": {}, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testcert99539ad0580", + "attributes": { + "enabled": true, + "nbf": 1681267321, + "exp": 1744426321, + "created": 1681267921, + "updated": 1681267921, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey100076e94", + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey107013837", + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey2793803e0", + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey284288686", + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey386340660", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey396652a76", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey416645817", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey437892a1f", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey746197675", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey829743998", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey8688021a6", + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testlistcertversion89840", + "attributes": { + "enabled": true, + "nbf": 1681267366, + "exp": 1712890366, + "created": 1681267966, + "updated": 1681267966, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + }, + { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testlistcertversion90972", + "attributes": { + "enabled": true, + "nbf": 1681267380, + "exp": 1712890380, + "created": 1681267980, + "updated": 1681267980, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + }, + "managed": true + } + ], + "nextLink": null + } + } + ], + "Variables": { + "0": "listkey032723001", + "1": "listkey127903b45" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKeyNotFound[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKeyNotFound[1].json new file mode 100644 index 0000000000000..98c9355487281 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKeyNotFound[1].json @@ -0,0 +1,73 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7ba21c40-4f37-4d98-abe1-18cd63288855" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/non-existing/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "300", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "481505d7-bad0-498e-a659-b2fc65e5b21c" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) non-existing was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKey[1].json new file mode 100644 index 0000000000000..5bb71750d0470 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.recoverDeletedKey[1].json @@ -0,0 +1,454 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey795798c96/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7c93c5f6-4f15-42d6-8b84-3c8f17c02c41" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey795798c96/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d879ceb0-65d5-403b-80cd-5098d7c20bb3" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96/f10173f9474a4b40895894c5a37a7ad0", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oJb2bqyXD4UYmXSdA0MfPkCUaCRk7mx7ppfDXhITjsJrATHB9OEqThMlZq9NDhLskTq9ilxKKHADNefAQxtRc5QAQWmOQ-oVcMnUIR9oqQevsuwqj23_CwxuzAbjmDGf0w42BgZlrzwklS-CvOVpidjwry7dv5zWoJRElBVYTEpDbvrKwhycHXP0rzyfagFeTU-vHdU0j-8QjhnOV_4xGkemDNosU6Urez7e2zEFZWBBuQC3qnl9-2S4s8TPBh8lZ9pGebQZPQmMHYyW90h5ciJIsG_kRbZD0UBVueh93HSfw21hXhYhKEbHWGH8onxAc4dSF-SGTNgQGYAyanI4QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey795798c96?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7b4f7db6-8513-4732-8f2e-10be8849a612" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey795798c96", + "deletedDate": 1681269678, + "scheduledPurgeDate": 1681874478, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96/f10173f9474a4b40895894c5a37a7ad0", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oJb2bqyXD4UYmXSdA0MfPkCUaCRk7mx7ppfDXhITjsJrATHB9OEqThMlZq9NDhLskTq9ilxKKHADNefAQxtRc5QAQWmOQ-oVcMnUIR9oqQevsuwqj23_CwxuzAbjmDGf0w42BgZlrzwklS-CvOVpidjwry7dv5zWoJRElBVYTEpDbvrKwhycHXP0rzyfagFeTU-vHdU0j-8QjhnOV_4xGkemDNosU6Urez7e2zEFZWBBuQC3qnl9-2S4s8TPBh8lZ9pGebQZPQmMHYyW90h5ciJIsG_kRbZD0UBVueh93HSfw21hXhYhKEbHWGH8onxAc4dSF-SGTNgQGYAyanI4QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey795798c96?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a8bf8365-aab9-4917-bbdd-c3168a0ff774" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey795798c96" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey795798c96?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "c0e84e37-58e4-4fdd-a0f3-f9cf0f5c8550" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey795798c96" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey795798c96?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a8e486a7-89bf-4ead-bece-9d9c83fcb2ac" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey795798c96", + "deletedDate": 1681269678, + "scheduledPurgeDate": 1681874478, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96/f10173f9474a4b40895894c5a37a7ad0", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oJb2bqyXD4UYmXSdA0MfPkCUaCRk7mx7ppfDXhITjsJrATHB9OEqThMlZq9NDhLskTq9ilxKKHADNefAQxtRc5QAQWmOQ-oVcMnUIR9oqQevsuwqj23_CwxuzAbjmDGf0w42BgZlrzwklS-CvOVpidjwry7dv5zWoJRElBVYTEpDbvrKwhycHXP0rzyfagFeTU-vHdU0j-8QjhnOV_4xGkemDNosU6Urez7e2zEFZWBBuQC3qnl9-2S4s8TPBh8lZ9pGebQZPQmMHYyW90h5ciJIsG_kRbZD0UBVueh93HSfw21hXhYhKEbHWGH8onxAc4dSF-SGTNgQGYAyanI4QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey795798c96/recover?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "ea9f4d82-88ff-4e28-8cb5-5c6e1ad5f5f5" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96/f10173f9474a4b40895894c5a37a7ad0", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oJb2bqyXD4UYmXSdA0MfPkCUaCRk7mx7ppfDXhITjsJrATHB9OEqThMlZq9NDhLskTq9ilxKKHADNefAQxtRc5QAQWmOQ-oVcMnUIR9oqQevsuwqj23_CwxuzAbjmDGf0w42BgZlrzwklS-CvOVpidjwry7dv5zWoJRElBVYTEpDbvrKwhycHXP0rzyfagFeTU-vHdU0j-8QjhnOV_4xGkemDNosU6Urez7e2zEFZWBBuQC3qnl9-2S4s8TPBh8lZ9pGebQZPQmMHYyW90h5ciJIsG_kRbZD0UBVueh93HSfw21hXhYhKEbHWGH8onxAc4dSF-SGTNgQGYAyanI4QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey795798c96/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "304", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4da9009e-5fd1-4787-a603-0bcf3d3daa24" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) testkey795798c96 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey795798c96/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "304", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "1a20e1d8-f272-43ae-b2c6-41d55ed33573" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "A key with (name/id) testkey795798c96 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey795798c96/?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "0b43381d-b6ce-493e-a984-ec42b38275df" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey795798c96/f10173f9474a4b40895894c5a37a7ad0", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "oJb2bqyXD4UYmXSdA0MfPkCUaCRk7mx7ppfDXhITjsJrATHB9OEqThMlZq9NDhLskTq9ilxKKHADNefAQxtRc5QAQWmOQ-oVcMnUIR9oqQevsuwqj23_CwxuzAbjmDGf0w42BgZlrzwklS-CvOVpidjwry7dv5zWoJRElBVYTEpDbvrKwhycHXP0rzyfagFeTU-vHdU0j-8QjhnOV_4xGkemDNosU6Urez7e2zEFZWBBuQC3qnl9-2S4s8TPBh8lZ9pGebQZPQmMHYyW90h5ciJIsG_kRbZD0UBVueh93HSfw21hXhYhKEbHWGH8onxAc4dSF-SGTNgQGYAyanI4QQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey795798c96" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.releaseKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.releaseKey[1].json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.releaseKey[1].json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKeyFromMalformedBackup[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKeyFromMalformedBackup[1].json new file mode 100644 index 0000000000000..4dc40731cc7cc --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKeyFromMalformedBackup[1].json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "50708df0-80e0-4b49-93c0-e17ec415d851" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "28", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "value": "bm9uLWV4aXN0aW5n" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "78", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "580130ff-fd33-444c-882f-58053df59cd7" + }, + "ResponseBody": { + "error": { + "code": "Malformed backup blob", + "message": "Backup blob is corrupt." + } + } + } + ], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKey[1].json new file mode 100644 index 0000000000000..f98101291baa7 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.restoreKey[1].json @@ -0,0 +1,427 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey9919737c3/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f995ad84-8a28-4f22-a9d9-cbe32247b3d6" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9919737c3/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "65", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "dfd29464-2998-47d3-9333-8b58427b8cd9" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9919737c3/5212a407cb9045bb8f4c65f8a1698ef1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "w3hq9ZPo917cgmAeEseWVVuBNotoRKS3VU3SuIdJ8C43JNFBZFsd8Pi0agIRm7NiLrXLui3BcZx1IGddl_DulWJCFu7l5SxP6CByMMA19LLjuj5ekU2hNn2vv6Wgy2PAaUcdCcdLgfV7k6cwlRGI32cW8k9Lfl7QBzTtE9tqbtFBUC57rn_7p_EfParJz6BeVmHQy1tr7abwDW3hkubk3RQvIT2TbB-GBjovZNc60UN_85XPfugPNK3RpimS6VeKCz49HqbHCLYFI2X32Rp1FGmH2WpxUZrsd3FcA_jyoNkR2c8ah32VulEKfGY6DIay1RYXafarNts3hcnWgeWLtQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9919737c3/backup?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "12519", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fdcedc23-aeeb-48ab-a521-2921c6aaeb8c" + }, + "ResponseBody": { + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAuYUFBYTFtZ25TcjloSXZkZ0lwWFFpSD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tVXNqNXpNd3hfaWhQZTA5T2daRUVxTTZLNmdJXzV3amtxV3R3eDRxenlWY1c3eEg1RXBsd2J2dmVGTUp0dFlSd2dlQjdWWVJpbU5PdnBIVDF0UzZtR0ppRGV5SnR1Tl9QcG5sSE42UUotSDJPaUpDaURaZENTWldvNUl6SmNhUUt5alAySUtENnhMX0VsRzNYNmZqNzljc0dQZVlHZGR6MHpxY1NJZmZFMGl6Vy1NM25qWjhyWVBzMkZLLTBpdVozbTA5Mkt5cGI5eGxtMEFrUEZTdDNOeFNVX2xwZWI3Rk5qVWQyLXJDVDBxN3o5ei1WbXVIOENlRm5MZE5tc1kwU0JhTVJlNVpwbmtqbmFpRXM4dldBOW5xMllWWXdMLTRzMzNEZVpnZktVQWlUNzNRR3pmd0lucWczNUVFNXJzRFRDdGt0VXdGQllGc0FfVUZxY0gtTS1KTG5mb1A3ZkFla0FjeDctQkNXTWRYelhSd1VBaEpEMU5faHJxRHlHZS1vWWVDbWRkU01pOEctYmQ0bTh2ZXJLbmJneHJmZ3BnZU1WbzRPdS1BYWo1SnJmaS1lRG5FU2ZLZ1Ricnc0LnBORzRrQzJBbXN3SmszVThXNzNVSjREUzcxMm9Ea00tTTczcU5sd0wwSEk" + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey9919737c3?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "24d6bb39-4c7b-4f76-8d8a-b645e03078d2" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey9919737c3", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9919737c3/5212a407cb9045bb8f4c65f8a1698ef1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "w3hq9ZPo917cgmAeEseWVVuBNotoRKS3VU3SuIdJ8C43JNFBZFsd8Pi0agIRm7NiLrXLui3BcZx1IGddl_DulWJCFu7l5SxP6CByMMA19LLjuj5ekU2hNn2vv6Wgy2PAaUcdCcdLgfV7k6cwlRGI32cW8k9Lfl7QBzTtE9tqbtFBUC57rn_7p_EfParJz6BeVmHQy1tr7abwDW3hkubk3RQvIT2TbB-GBjovZNc60UN_85XPfugPNK3RpimS6VeKCz49HqbHCLYFI2X32Rp1FGmH2WpxUZrsd3FcA_jyoNkR2c8ah32VulEKfGY6DIay1RYXafarNts3hcnWgeWLtQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9919737c3?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "473562a6-2264-4dcf-88dc-73a5ffd42aa3" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey9919737c3" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9919737c3?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fbd9b97d-7bb5-48e7-b57d-1ab104003e3b" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey9919737c3" + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9919737c3?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "873", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "b4991084-86bd-4f11-9026-7389c1eaccd9" + }, + "ResponseBody": { + "recoveryId": "https://azkvrecordtests.vault.azure.net/deletedkeys/testkey9919737c3", + "deletedDate": 1681269677, + "scheduledPurgeDate": 1681874477, + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9919737c3/5212a407cb9045bb8f4c65f8a1698ef1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "w3hq9ZPo917cgmAeEseWVVuBNotoRKS3VU3SuIdJ8C43JNFBZFsd8Pi0agIRm7NiLrXLui3BcZx1IGddl_DulWJCFu7l5SxP6CByMMA19LLjuj5ekU2hNn2vv6Wgy2PAaUcdCcdLgfV7k6cwlRGI32cW8k9Lfl7QBzTtE9tqbtFBUC57rn_7p_EfParJz6BeVmHQy1tr7abwDW3hkubk3RQvIT2TbB-GBjovZNc60UN_85XPfugPNK3RpimS6VeKCz49HqbHCLYFI2X32Rp1FGmH2WpxUZrsd3FcA_jyoNkR2c8ah32VulEKfGY6DIay1RYXafarNts3hcnWgeWLtQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9919737c3?api-version=7.4", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "4cf0ba27-56c8-46f3-9b70-a8d528f7ed62" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/deletedkeys/testkey9919737c3?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "84", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f6b0ef26-2a0e-4e20-8b75-45131f4cac6b" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: testkey9919737c3" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/restore?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "12519", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAuYUFBYTFtZ25TcjloSXZkZ0lwWFFpSDB6R0dubDI5ZFpzczhlZV9XaEZyTnFnaXY3OXlOMFhnY2lseDRtRThwb3hhdGQ0M1hlQ0FvTlNLYjBtQ0FReXBwQW01VnJGczF4dFpTa0lXR3Q3djhmUm4wdkxfZlJLbmR6UFVmRC1mUlBtRnBZUk12R2VoWDZQdm54cHNBVXdkMENJcTd6cXZhdEYxNU9JREZSaUJzbjl0SFRkbk4yQkIwYU1POVhxeTA1QVd3bmN2eGdJR0lWUkh5UXVpUzBIckNieWtINTUxa0RRdWxNVk5BeWpTMVdobjV1dmpmZDhPaktsTXllT0YtSlBMRC1UalFGUXZqM1FuZ3NpQXpDYlA1eVY1ZXhWdXRKSjBabDVhdzV3SHhGVHFKamlITXFlZDdWaFZNMVpVYTA5am9JUkR0dTlQT1JtTjJSN0JKXzJnLm5oLWNBX2hwaWw0cDg0UkwwY2tVS3cuc2FyR3pZaWFBcWc4OWZLd3JNTFpTZlVvekV4SFRWTVFLc1lpeldmVHNJZzh1eTFBMFRkMzRoSmN0a0NKeS1yeGVyS2I1dF91d1Azek1mcURWVUlpYkJoSlBwa0JERGotR29JaFkxQnBBQ3pYMUc5MHJXU2VGOHpvdTc0MDFDVGwyRkpiMExnTzVhRWxNelVCWmxGakJ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+ }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "732", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:22:19 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f82a106c-7cac-4830-aff6-d93dc34bbe70" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey9919737c3/5212a407cb9045bb8f4c65f8a1698ef1", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "w3hq9ZPo917cgmAeEseWVVuBNotoRKS3VU3SuIdJ8C43JNFBZFsd8Pi0agIRm7NiLrXLui3BcZx1IGddl_DulWJCFu7l5SxP6CByMMA19LLjuj5ekU2hNn2vv6Wgy2PAaUcdCcdLgfV7k6cwlRGI32cW8k9Lfl7QBzTtE9tqbtFBUC57rn_7p_EfParJz6BeVmHQy1tr7abwDW3hkubk3RQvIT2TbB-GBjovZNc60UN_85XPfugPNK3RpimS6VeKCz49HqbHCLYFI2X32Rp1FGmH2WpxUZrsd3FcA_jyoNkR2c8ah32VulEKfGY6DIay1RYXafarNts3hcnWgeWLtQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey9919737c3" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.rotateKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.rotateKey[1].json new file mode 100644 index 0000000000000..9e88817f95288 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.rotateKey[1].json @@ -0,0 +1,147 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey27056f79/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "458665c5-9eb3-4fc0-89d4-48c82062d92c" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey27056f79/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f8b02e2e-82a1-4386-b805-35a4bb483383" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey27056f79/6cc2e01e127546d6909944a47e14d30b", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "pxWS0bwVta8HhD6NkP8AtbLIwcjr4Xnplf6GiH-QdxFSAeFVL8vlP28U7s78OfW6BlukxDMFO8IFo1xk9Q_CKL2oMMyPuuUPLSDOZRuQ3ijlEz0HPEkW5dK_c7s-UlkQFUzJzgk6Znd4d6C5sUbGt8Zj8lo_qpTdkGSdEpjvjzbQxVNDPR854oYV-8ozEuNfyRUy68X2hfA_ZT5CU4AS0V1RxkjJ8sMfBFuY40M0_MSSh0cQzQTAZCgVI6SXqIED56sJA8w7oB6zJtgQeGSnXTXCIu4MRDXjnhgnfrbnLRxVJGs_b1z8FUdR-t7LjkOmAu0yNpYrSDtv4T9mD_UYBQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey27056f79/rotate?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "54ea2dba-2d5d-4e70-81e7-e76695cd01d3" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey27056f79/eb7cf363fb654cfbb04a95c0c5846a55", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "xDbatqCew8eCpgDl2DkrhrFMnZkUCLc_v7CF1obCtsOMWzfy41QNfgOnRX70HBu2ud1Fqis4wxBVBKe4f44yJSQ32ttWie9OqAz7xsffDupTxgxN6E_l4rAIe6vGrIGcJNfYP39vjJMtSjnMTrKvxAmw6-XL_AaXb_Gd602DKHdV_voN1tPQy5w3Bl7BVbW-wHgzj6bkG57DWuom1tZHJBuKSVVk3xJt47GPAgf7GS4ie_gzXL0lAx_ShmHnIbwy-GL4v0k_zDkbSbieZyYX_aXQ5qLLYCFPVdZW0OvgaLfLhRe2reb1Zkw2Wj3OJABvClccPdlKLghP6UEVX4KHNQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "rotatekey27056f79" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateDisabledKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateDisabledKey[1].json new file mode 100644 index 0000000000000..452140654b830 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateDisabledKey[1].json @@ -0,0 +1,155 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey2793803e0/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "13238d01-95d7-4f10-8607-4d48b2b04119" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey2793803e0/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "EC", + "attributes": { + "enabled": false, + "exp": 2537049600 + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "444", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "fa461d81-6955-4245-90b4-5768ca1ae5dd" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey2793803e0/f05a3d0787bd4580853e2dabf85261a2", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "nda3KTloyXw_dCPbV6ZcQYz4d6tu8v1iBjvW7fG7yzU", + "y": "4x7_Q4xkI1xbfAIq5_HSUHuCejEliFbniMtQOcojWU8" + }, + "attributes": { + "enabled": false, + "exp": 2537049600, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey2793803e0/f05a3d0787bd4580853e2dabf85261a2?api-version=7.4", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "88", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": { + "enabled": false, + "exp": 2852668800, + "exportable": false + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "444", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "51e455c8-e550-4fa5-b47c-925b0208869c" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey2793803e0/f05a3d0787bd4580853e2dabf85261a2", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "nda3KTloyXw_dCPbV6ZcQYz4d6tu8v1iBjvW7fG7yzU", + "y": "4x7_Q4xkI1xbfAIq5_HSUHuCejEliFbniMtQOcojWU8" + }, + "attributes": { + "enabled": false, + "exp": 2852668800, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + } + ], + "Variables": { + "0": "testkey2793803e0" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json new file mode 100644 index 0000000000000..2e57f6635cc98 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateGetKeyRotationPolicyWithAllProperties[1].json @@ -0,0 +1,224 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/rotatekey66098157/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "044dcd6b-fbef-4c88-b7e0-f1468f866ccf" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey66098157/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": {}, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "716", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d8a938cd-b851-4e16-896c-b0d29c770d17" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/rotatekey66098157/346031c1f09d47fdbd14558329214ad4", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "yDPXrq6DMNMbC0hOtn4AJgcZpQ17NL2h6xF_d-E19FFxsYuEmontHXwDTX0oYB_vsN5nW7wBMvHOY1cTygnTKhQnY7lvgGtJFCHtpHyHQJtfVkElcUm273OMWbaWAC0VuGkBCoVcNms9I7WKVgUvGIM3kN5zTTNegQRRn74mx3mzwZV5diqzdbcj6bMRTED8ccQLDISQWcF6tFpN3XdwQlnqR9zRT9bulP6Gez0fjx99VIApyqJe3cpasK8iOh_lVjBfqYYPgVgmJxdElUdaU2CRliWXPY-QwZEwqyXR1j_1vcUNicoY9f3zgIjnl4OexajDl5SCR0uOlyab7WmQKQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1681269678, + "updated": 1681269678, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey66098157/rotationpolicy?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "186", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "notify" + } + } + ], + "attributes": { + "expiryTime": "P6M" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "313", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "a0ab4ed9-ddc5-43af-9998-c90211034818" + }, + "ResponseBody": { + "id": "https://azkvrecordtests.vault.azure.net/keys/rotatekey66098157/rotationpolicy", + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "Rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": { + "expiryTime": "P6M", + "created": 1681269678, + "updated": 1681269678 + } + } + }, + { + "RequestUri": "https://REDACTED/keys/rotatekey66098157/rotationpolicy?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "313", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "0487ce0b-ed68-4122-8fc4-16e4e2bb723f" + }, + "ResponseBody": { + "id": "https://azkvrecordtests.vault.azure.net/keys/rotatekey66098157/rotationpolicy", + "lifetimeActions": [ + { + "trigger": { + "timeAfterCreate": "P7D" + }, + "action": { + "type": "Rotate" + } + }, + { + "trigger": { + "timeBeforeExpiry": "P7D" + }, + "action": { + "type": "Notify" + } + } + ], + "attributes": { + "expiryTime": "P6M", + "created": 1681269678, + "updated": 1681269678 + } + } + } + ], + "Variables": { + "0": "rotatekey66098157" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateKey[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateKey[1].json new file mode 100644 index 0000000000000..cd17497d24a33 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyClientTest.updateKey[1].json @@ -0,0 +1,176 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/testkey107013837/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "9774ee05-e734-4300-8719-6b951305bf3b" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey107013837/create?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "128", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "kty": "RSA", + "attributes": { + "exp": 2537049600 + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "795", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "d2fae2a5-8112-43b2-be3d-9e7d1c3cae8b" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey107013837/3bc535513fbb40f8a692f8d25493a05f", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "7hMHoe8kC38V2oDny34EbvZPQ8JqLw1ixH6ddXDMV0KbNG4TbgUz1GpTqNtzUcb0Ni9uKrQv4OgUOVBJGlCoZs-e-PaGuJAZHcwn0yPTiNZtUJorTpTxQljF9Z0t0motyjT_bQ8-xNBZwCUUq3FCmuVKdyqvmelILt9AcnLpER6oXZ1JutXAw9UmOwHYXt25oHVRghGr4zrU9Nprer4L75zNG44OiL0SzGpc_e8s2VaX4jd8y2JM8MqiszoiOd3VHF7D5bzfR1dN_9mGTjVSs0KyyW8gSGEFP75-L1gGTa85LD0DJgD_xJMVVVf65paoKOhdKUnxUM6nDF8gqpOuxQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2537049600, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/testkey107013837/3bc535513fbb40f8a692f8d25493a05f?api-version=7.4", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "150", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "attributes": { + "enabled": true, + "exp": 2852668800, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + }, + "public_exponent": 0 + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "795", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:21:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "35a3192d-371d-40f9-8992-c390a0a70e3d" + }, + "ResponseBody": { + "key": { + "kid": "https://azkvrecordtests.vault.azure.net/keys/testkey107013837/3bc535513fbb40f8a692f8d25493a05f", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "7hMHoe8kC38V2oDny34EbvZPQ8JqLw1ixH6ddXDMV0KbNG4TbgUz1GpTqNtzUcb0Ni9uKrQv4OgUOVBJGlCoZs-e-PaGuJAZHcwn0yPTiNZtUJorTpTxQljF9Z0t0motyjT_bQ8-xNBZwCUUq3FCmuVKdyqvmelILt9AcnLpER6oXZ1JutXAw9UmOwHYXt25oHVRghGr4zrU9Nprer4L75zNG44OiL0SzGpc_e8s2VaX4jd8y2JM8MqiszoiOd3VHF7D5bzfR1dN_9mGTjVSs0KyyW8gSGEFP75-L1gGTa85LD0DJgD_xJMVVVf65paoKOhdKUnxUM6nDF8gqpOuxQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "exp": 2852668800, + "created": 1681269677, + "updated": 1681269677, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7, + "exportable": false + }, + "tags": { + "second tag": "second value", + "first tag": "first value" + } + } + } + ], + "Variables": { + "0": "testkey107013837" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK128[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK128[1].json new file mode 100644 index 0000000000000..7d63cc218b96c --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK128[1].json @@ -0,0 +1,250 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "747286e8-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "350", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "key": { + "kty": "oct", + "key_ops": [ + "wrapKey", + "unwrapKey" + ], + "k": "AAECAwQFBgcICQoLDA0ODw" + }, + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "750b2196-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "279" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "wrapKey", + "unwrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-build-version": "1.0.20230403-1-1802edf4-develop", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "7543cf82-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "31" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "unwrapKey", + "wrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "A128KW", + "value": "ABEiM0RVZneImaq7zN3u_w" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "172", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "75568690-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "alg": "A128KW", + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961", + "value": "H6aLCoEStEeu80vY-1p7gp0-hiNx0s_l" + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-build-version": "1.0.20230403-1-1802edf4-develop", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "7564a5b8-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "unwrapKey", + "wrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "A128KW", + "value": "H6aLCoEStEeu80vY-1p7gp0-hiNx0s_l" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "162", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "7572a046-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "alg": "A128KW", + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey074615/69b208781f260b8db9ebb414fa7be961", + "value": "ABEiM0RVZneImaq7zN3u_w" + } + } + ], + "Variables": { + "0": "symmetrickey074615" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK192[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK192[1].json new file mode 100644 index 0000000000000..ddb39aff43e21 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientManagedHsmTest.wrapUnwrapSymmetricAK192[1].json @@ -0,0 +1,250 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://managedhsm.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "747a7b0a-d8e1-11ed-9268-000d3a602e9a", + "x-ms-server-latency": "1" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "360", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "key": { + "kty": "oct", + "key_ops": [ + "wrapKey", + "unwrapKey" + ], + "k": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYX" + }, + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "750adcf4-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "254" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "wrapKey", + "unwrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-build-version": "1.0.20230403-1-1802edf4-develop", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "753dddca-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "29" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "unwrapKey", + "wrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5/wrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "49", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "A192KW", + "value": "ABEiM0RVZneImaq7zN3u_w" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "172", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "754d6d9e-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "alg": "A192KW", + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5", + "value": "lneLJa5spDX5K1uXwFCu0kaKuKF62E5d" + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "333", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-build-version": "1.0.20230403-1-1802edf4-develop", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "7557d8ec-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "attributes": { + "created": 1681269836, + "enabled": true, + "exportable": false, + "recoverableDays": 7, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "updated": 1681269836 + }, + "key": { + "key_ops": [ + "unwrapKey", + "wrapKey" + ], + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5", + "kty": "oct-HSM" + } + } + }, + { + "RequestUri": "https://REDACTED/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5/unwrapkey?api-version=7.4", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "alg": "A192KW", + "value": "lneLJa5spDX5K1uXwFCu0kaKuKF62E5d" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "162", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=Ipv4;", + "x-ms-keyvault-region": "northcentralus", + "x-ms-request-id": "75624f66-d8e1-11ed-bf5c-000d3a612dea", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "alg": "A192KW", + "kid": "https://azkvrecordtestshsm.managedhsm.azure.net/keys/symmetrickey234660/27454b8863820a901b634d4a69b231e5", + "value": "ABEiM0RVZneImaq7zN3u_w" + } + } + ], + "Variables": { + "0": "symmetrickey234660" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128Local.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128Local.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128Local.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128[1].json new file mode 100644 index 0000000000000..061ec8e791333 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK128[1].json @@ -0,0 +1,122 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/secrets/secretkey51503dad?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "79f01f3c-3ec0-4e93-84aa-3fa8fc9eea2b" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/secrets/secretkey51503dad?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "52", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "value": "AAECAwQFBgcICQoLDA0ODw==", + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "284", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:55 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "8ea2e86a-1579-437c-95bb-67c7517ccdc5" + }, + "ResponseBody": { + "value": "AAECAwQFBgcICQoLDA0ODw==", + "id": "https://azkvrecordtests.vault.azure.net/secrets/secretkey51503dad/0ae953d33e8041a4994aef2b09c2f217", + "attributes": { + "enabled": true, + "created": 1681269836, + "updated": 1681269836, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + }, + { + "RequestUri": "https://REDACTED/secrets/secretkey51503dad/0ae953d33e8041a4994aef2b09c2f217?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "284", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:56 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "0df2f8b1-86bd-47b8-b593-e38b6b4fb0f6" + }, + "ResponseBody": { + "value": "AAECAwQFBgcICQoLDA0ODw==", + "id": "https://azkvrecordtests.vault.azure.net/secrets/secretkey51503dad/0ae953d33e8041a4994aef2b09c2f217", + "attributes": { + "enabled": true, + "created": 1681269836, + "updated": 1681269836, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + } + ], + "Variables": { + "0": "secretkey51503dad" + } +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192Local.json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192Local.json new file mode 100644 index 0000000000000..f721723386d8a --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192Local.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192[1].json b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192[1].json new file mode 100644 index 0000000000000..46347a51d2c3f --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/resources/session-records/KeyEncryptionKeyClientTest.wrapUnwrapSymmetricAK192[1].json @@ -0,0 +1,122 @@ +{ + "Entries": [ + { + "RequestUri": "https://REDACTED/secrets/secretkey455740a4?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "97", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47\u0022, resource=\u0022https://vault.azure.net\u0022", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "7a3692f7-f26c-4282-9fba-378c1306ed1e" + }, + "ResponseBody": { + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." + } + } + }, + { + "RequestUri": "https://REDACTED/secrets/secretkey455740a4?api-version=7.4", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "60", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": { + "value": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYX", + "attributes": {} + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "292", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:56 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "93e8fcc5-f56c-422d-8562-26ee2fcb0763" + }, + "ResponseBody": { + "value": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYX", + "id": "https://azkvrecordtests.vault.azure.net/secrets/secretkey455740a4/2e81ef646b4e4f8fae8aba0460c1d2a4", + "attributes": { + "enabled": true, + "created": 1681269836, + "updated": 1681269836, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + }, + { + "RequestUri": "https://REDACTED/secrets/secretkey455740a4/2e81ef646b4e4f8fae8aba0460c1d2a4?api-version=7.4", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json", + "User-Agent": "azsdk-java-client_name/client_version (11.0.6; Windows 10; 10.0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "292", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 12 Apr 2023 03:23:55 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=172.92.148.195;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus", + "x-ms-keyvault-service-version": "1.9.749.1", + "x-ms-request-id": "f2a12742-d0c6-4339-8e8d-ea6235ccb0b9" + }, + "ResponseBody": { + "value": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYX", + "id": "https://azkvrecordtests.vault.azure.net/secrets/secretkey455740a4/2e81ef646b4e4f8fae8aba0460c1d2a4", + "attributes": { + "enabled": true, + "created": 1681269836, + "updated": 1681269836, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + } + ], + "Variables": { + "0": "secretkey455740a4" + } +}