diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/KeyVaultOperationsTest.cs b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/KeyVaultOperationsTest.cs index b3af905782d2..57e907e7aa84 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/KeyVaultOperationsTest.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/KeyVaultOperationsTest.cs @@ -112,6 +112,17 @@ public void KeyVaultEncryptDecryptRsa15Test() } } + [Fact] + public void KeyVaultEncryptDecryptRsaOaep256Test( ) + { + using ( MockContext context = MockContext.Start( this.GetType( ).FullName ) ) + { + var client = GetKeyVaultClient(); + + EncryptDecrypt( client, _keyIdentifier, JsonWebKeyEncryptionAlgorithm.RSAOAEP256 ); + } + } + [Fact] public void KeyVaultEncryptDecryptWithOlderKeyVersion() { @@ -192,6 +203,45 @@ public void KeyVaultSignVerifyRS512Test() } } + [Fact] + public void KeyVaultSignVerifyPS256Test( ) + { + using ( MockContext context = MockContext.Start( this.GetType( ).FullName ) ) + { + var client = GetKeyVaultClient(); + + var digest = RandomHash(SHA256.Create(), 32); + + SignVerify( client, _keyIdentifier, JsonWebKeySignatureAlgorithm.PS256, digest ); + } + } + + [Fact] + public void KeyVaultSignVerifyPS384Test( ) + { + using ( MockContext context = MockContext.Start( this.GetType( ).FullName ) ) + { + var client = GetKeyVaultClient(); + + var digest = RandomHash(SHA384.Create(), 64); + + SignVerify( client, _keyIdentifier, JsonWebKeySignatureAlgorithm.PS384, digest ); + } + } + + [Fact] + public void KeyVaultSignVerifyPS512Test( ) + { + using ( MockContext context = MockContext.Start( this.GetType( ).FullName ) ) + { + var client = GetKeyVaultClient(); + + var digest = RandomHash(SHA512.Create(), 64); + + SignVerify( client, _keyIdentifier, JsonWebKeySignatureAlgorithm.PS512, digest ); + } + } + [Fact] public void KeyVaultWrapUnwrapRsaOaepTest() { @@ -218,6 +268,19 @@ public void KeyVaultWrapUnwrapRsa15Test() } } + [Fact] + public void KeyVaultWrapUnwrapRsaOaep256Test( ) + { + using ( MockContext context = MockContext.Start( this.GetType( ).FullName ) ) + { + + var client = GetKeyVaultClient(); + + var symmetricKeyBytes = GetSymmetricKeyBytes(); + WrapAndUnwrap( client, _keyIdentifier, JsonWebKeyEncryptionAlgorithm.RSAOAEP256, symmetricKeyBytes ); + } + } + [Fact] public void KeyVaultCreateGetDeleteKeyTest() { diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultEncryptDecryptRsaOaep256Test.json b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultEncryptDecryptRsaOaep256Test.json new file mode 100644 index 000000000000..4df9e0bdd390 --- /dev/null +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultEncryptDecryptRsaOaep256Test.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "/keys/sdktestkey//encrypt?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8vZW5jcnlwdD9hcGktdmVyc2lvbj0yMDE2LTEwLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"RSA-OAEP-256\",\r\n \"value\": \"2Ht8TBsMWK1uFw\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "59" + ], + "x-ms-client-request-id": [ + "6ad15aa2-5a2d-422b-ae6a-1a9b05a613ad" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/0b12b5e5fb8241a39baad0ea60450b82\",\r\n \"value\": \"RLm5dIhcbeVei8BgMHiVe7n_FwFFLZ0kdYyxuFHnTBdbD80TsrpWBdSug3Ynye5b2oVx8Zp-mmVYCh9X4p84ECrRkwCVak110h1QqJlt6IjmUbgBkng9UyoVRc8Zdh-ZHDkEZT47ccCeSrbXmGzTGPHt9l3u5s3vSK_h1JMdTy7LZ9_Z3JX85w_qXOEIsxJUwdQqJj0pB4awxAwKa6a_uZHC56q3Td10LsGXEvBdDlPydc8YZf66LlYm7DWU3DITIjAZ5aOTyQ1qItPxzwFysECDVRLjnMucP4Jzy0oDcAQaagHO4BJzjCLBBxHN-u8t7vtV1FOOuvQDLaHoo0Kcpg\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "455" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:16:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "d10d83b9-b464-421e-b9da-ab74c8e62eda" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/keys/sdktestkey/0b12b5e5fb8241a39baad0ea60450b82/decrypt?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8wYjEyYjVlNWZiODI0MWEzOWJhYWQwZWE2MDQ1MGI4Mi9kZWNyeXB0P2FwaS12ZXJzaW9uPTIwMTYtMTAtMDE=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"RSA-OAEP-256\",\r\n \"value\": \"RLm5dIhcbeVei8BgMHiVe7n_FwFFLZ0kdYyxuFHnTBdbD80TsrpWBdSug3Ynye5b2oVx8Zp-mmVYCh9X4p84ECrRkwCVak110h1QqJlt6IjmUbgBkng9UyoVRc8Zdh-ZHDkEZT47ccCeSrbXmGzTGPHt9l3u5s3vSK_h1JMdTy7LZ9_Z3JX85w_qXOEIsxJUwdQqJj0pB4awxAwKa6a_uZHC56q3Td10LsGXEvBdDlPydc8YZf66LlYm7DWU3DITIjAZ5aOTyQ1qItPxzwFysECDVRLjnMucP4Jzy0oDcAQaagHO4BJzjCLBBxHN-u8t7vtV1FOOuvQDLaHoo0Kcpg\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "387" + ], + "x-ms-client-request-id": [ + "6a05d3b7-72de-4f38-bc32-3c1e0124e1e3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/0b12b5e5fb8241a39baad0ea60450b82\",\r\n \"value\": \"2Ht8TBsMWK1uFw\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "127" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:16:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "74100356-e4c1-49be-a226-258b19a17876" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "VaultAddress": "https://kv-sdk-test.vault-int.azure-int.net/", + "KeyName": "sdktestkey", + "KeyVersion": "0b12b5e5fb8241a39baad0ea60450b82", + "SoftDeleteEnabled": "True", + "RandomBytes": "2Ht8TBsMWK1uFw==" + } +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS256Test.json b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS256Test.json new file mode 100644 index 000000000000..9c8923e72a18 --- /dev/null +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS256Test.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "/keys/sdktestkey//sign?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8vc2lnbj9hcGktdmVyc2lvbj0yMDE2LTEwLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS256\",\r\n \"value\": \"PuFZmx4hbmrEJAQr9NHVwGLSgigztg3Zdca6uplmUc0\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "81" + ], + "x-ms-client-request-id": [ + "744e35ba-a678-46c9-aec0-e6466bcd4f32" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/dc3985ff8b604442ba3597bfb2d1312a\",\r\n \"value\": \"GSD8pAA7Dd9fdC4-FYw_5CVfN9cMc32cpVSbIdH1OsMw1ZCqy5vPIU2qCUTbE_Ipo-6yDVRvMb3246C7vu6RSUTnrG9qTbV64NH4RviYAT_hPyIiwg2Gcx29WRLH-6MT6i-h564QwqVvk5KyWXeOOaGi8e9eTxaHZi_ZIpr06l3SSsYJT-AqL-d1FBgH5BoMTtosLALUgmS_QTXDKZvDqusCjuOAZjmWN8D02QlBT1RST-34B42KPuHUnsSFoixLaL_02f01QdKxPDKyKmAyMv-O5GjWWV9DlL76Z3bPu-VNDeEqN_-Fy6aoDPu_ws6B2uw4S09SFZyByJ6pl_zVvA\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "455" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "16e60192-b5a1-4889-874f-3400f21d8012" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/keys/sdktestkey/dc3985ff8b604442ba3597bfb2d1312a/verify?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS9kYzM5ODVmZjhiNjA0NDQyYmEzNTk3YmZiMmQxMzEyYS92ZXJpZnk/YXBpLXZlcnNpb249MjAxNi0xMC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS256\",\r\n \"digest\": \"PuFZmx4hbmrEJAQr9NHVwGLSgigztg3Zdca6uplmUc0\",\r\n \"value\": \"GSD8pAA7Dd9fdC4-FYw_5CVfN9cMc32cpVSbIdH1OsMw1ZCqy5vPIU2qCUTbE_Ipo-6yDVRvMb3246C7vu6RSUTnrG9qTbV64NH4RviYAT_hPyIiwg2Gcx29WRLH-6MT6i-h564QwqVvk5KyWXeOOaGi8e9eTxaHZi_ZIpr06l3SSsYJT-AqL-d1FBgH5BoMTtosLALUgmS_QTXDKZvDqusCjuOAZjmWN8D02QlBT1RST-34B42KPuHUnsSFoixLaL_02f01QdKxPDKyKmAyMv-O5GjWWV9DlL76Z3bPu-VNDeEqN_-Fy6aoDPu_ws6B2uw4S09SFZyByJ6pl_zVvA\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "440" + ], + "x-ms-client-request-id": [ + "e94b742a-13ee-482b-9bf3-e07019ca0759" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": true\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "14" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "d0891bfa-c785-4b4a-aadb-f3847f6af1c3" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "VaultAddress": "https://kv-sdk-test.vault-int.azure-int.net/", + "KeyName": "sdktestkey", + "KeyVersion": "dc3985ff8b604442ba3597bfb2d1312a", + "SoftDeleteEnabled": "True", + "RandomBytes": "os05VZvwVe+zSG0iPpF1Ks/26I/nCJYu0h7RCrhq7TM=" + } +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS384Test.json b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS384Test.json new file mode 100644 index 000000000000..13da17e23938 --- /dev/null +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS384Test.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "/keys/sdktestkey//sign?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8vc2lnbj9hcGktdmVyc2lvbj0yMDE2LTEwLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS384\",\r\n \"value\": \"KslKmzSowLqCJ0_ohRv0tcDa45QbDHEgNJ4GFvp24geIBu85haD5b3C-2us8ONzI\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "102" + ], + "x-ms-client-request-id": [ + "b4f3acdc-e44b-4186-b701-d790a239b7bc" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/7353bf89eedf4da18a8c7f4d0a108dfd\",\r\n \"value\": \"MGyFDEXVQ3d2khuOMIcZCutGG8pcYes4M1ZfNXkg1OoAYuLkpq6DtijUL0nsV4bE-aRR1kBCXt-4nxyphbEv6CBW6Ip7obvFw_zedPloZALoPUMSMy4a8YLXfCZWKxpaPFEro3Fz4faszR4dlm7Vg73kHhAoo0nz-2NEHs5dgbBX4SwrUK2GlJfxU0MX_yQbpffSslUO4jCCU1BL4SLyZmybIr3OkFGhhIdgAw6TXrA38f2abN1Cp2VFEu2jMQ9oQqaq4VPbH3KuaZUdGXmEnm9RX9YGggTQTOtjq6a3p6vsBv5sAs7_TGlryQQOlhchqfiUE87nDJdWXd6LmEdShA\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "455" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:41 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "5dae721c-a4a9-4c1f-9817-767aab771da6" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/keys/sdktestkey/7353bf89eedf4da18a8c7f4d0a108dfd/verify?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS83MzUzYmY4OWVlZGY0ZGExOGE4YzdmNGQwYTEwOGRmZC92ZXJpZnk/YXBpLXZlcnNpb249MjAxNi0xMC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS384\",\r\n \"digest\": \"KslKmzSowLqCJ0_ohRv0tcDa45QbDHEgNJ4GFvp24geIBu85haD5b3C-2us8ONzI\",\r\n \"value\": \"MGyFDEXVQ3d2khuOMIcZCutGG8pcYes4M1ZfNXkg1OoAYuLkpq6DtijUL0nsV4bE-aRR1kBCXt-4nxyphbEv6CBW6Ip7obvFw_zedPloZALoPUMSMy4a8YLXfCZWKxpaPFEro3Fz4faszR4dlm7Vg73kHhAoo0nz-2NEHs5dgbBX4SwrUK2GlJfxU0MX_yQbpffSslUO4jCCU1BL4SLyZmybIr3OkFGhhIdgAw6TXrA38f2abN1Cp2VFEu2jMQ9oQqaq4VPbH3KuaZUdGXmEnm9RX9YGggTQTOtjq6a3p6vsBv5sAs7_TGlryQQOlhchqfiUE87nDJdWXd6LmEdShA\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "461" + ], + "x-ms-client-request-id": [ + "d5bd45a9-dce5-43f2-a107-3420e0e80cdd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": true\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "14" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:41 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "80663465-f2f4-4bc4-91e8-5c2c1f85bd69" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "VaultAddress": "https://kv-sdk-test.vault-int.azure-int.net/", + "KeyName": "sdktestkey", + "KeyVersion": "7353bf89eedf4da18a8c7f4d0a108dfd", + "SoftDeleteEnabled": "True", + "RandomBytes": "QJ3WTsFlqRiXV7ofNur31sp6bBXqCKXGPFy68d22xUTcqssRoNysdmA+OlkCrHJb/PS3XVNZGjf3EBFlq7c74Q==" + } +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS512Test.json b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS512Test.json new file mode 100644 index 000000000000..cedd3c33a49e --- /dev/null +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultSignVerifyPS512Test.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "/keys/sdktestkey//sign?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8vc2lnbj9hcGktdmVyc2lvbj0yMDE2LTEwLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS512\",\r\n \"value\": \"4wt-h1SnktyWQjR_fl9dMP9T_M7bOCh-YcXfB0FSlUZcN2Dvb63ZIXoh0ogad3nkMjSMVhrk85-CDEo7lFDm-Q\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "124" + ], + "x-ms-client-request-id": [ + "13ebf1c6-5d0f-4812-8b07-022061147cf0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/76c1a0157d6749be942408a8ba77b6e0\",\r\n \"value\": \"K93Em7Op15cBUUYXWNZotYkXPuUm71oum_74B-HE_WwdhvtJ3ThVD78jdheunIzJiQWRCa_J8p-WxzqaFEp7IqdoDFPOgPwJG4fW9ZdPlzEtse-CrssrcgLQPq9c9vkvThI2mDzMYoE7bG3t6FZksO8BZJFDx08r0jnk4a5RAOz6D1UWzKT5DBhQFZcmASrRYwMuhAjZ3tEpIJZ_XCx6Mna9wyhxPnzEdQyRtSd6Gly6DWhYmYiSNaQbFi0qg0Cr74TwKpHfw7HPurg1J5hp3yBz-Egr7Q1P0k-XcXAmAflhw-_vrGDBjgj_74A0uPKEQWFkCRHevqfT0XQX3BCa1w\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "455" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "8923e4bd-c201-49aa-ac70-7eb049b3a5b3" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/keys/sdktestkey/76c1a0157d6749be942408a8ba77b6e0/verify?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS83NmMxYTAxNTdkNjc0OWJlOTQyNDA4YThiYTc3YjZlMC92ZXJpZnk/YXBpLXZlcnNpb249MjAxNi0xMC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"PS512\",\r\n \"digest\": \"4wt-h1SnktyWQjR_fl9dMP9T_M7bOCh-YcXfB0FSlUZcN2Dvb63ZIXoh0ogad3nkMjSMVhrk85-CDEo7lFDm-Q\",\r\n \"value\": \"K93Em7Op15cBUUYXWNZotYkXPuUm71oum_74B-HE_WwdhvtJ3ThVD78jdheunIzJiQWRCa_J8p-WxzqaFEp7IqdoDFPOgPwJG4fW9ZdPlzEtse-CrssrcgLQPq9c9vkvThI2mDzMYoE7bG3t6FZksO8BZJFDx08r0jnk4a5RAOz6D1UWzKT5DBhQFZcmASrRYwMuhAjZ3tEpIJZ_XCx6Mna9wyhxPnzEdQyRtSd6Gly6DWhYmYiSNaQbFi0qg0Cr74TwKpHfw7HPurg1J5hp3yBz-Egr7Q1P0k-XcXAmAflhw-_vrGDBjgj_74A0uPKEQWFkCRHevqfT0XQX3BCa1w\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "483" + ], + "x-ms-client-request-id": [ + "1a3cfa2b-d705-4c5d-8290-fe98818ceebb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": true\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "14" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:14:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "90fac9c9-89c9-4f73-bfd9-a580f2d32b39" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "VaultAddress": "https://kv-sdk-test.vault-int.azure-int.net/", + "KeyName": "sdktestkey", + "KeyVersion": "76c1a0157d6749be942408a8ba77b6e0", + "SoftDeleteEnabled": "True", + "RandomBytes": "W7DduZTWdrorOxao32F3aLss9Qci5VaLA+4jGvEAa2yOXuBnUyd2K0+RF3K661go8DvmocR413VaUrams1zJKg==" + } +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultWrapUnwrapRsaOaep256Test.json b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultWrapUnwrapRsaOaep256Test.json new file mode 100644 index 000000000000..dc2cad0c92e5 --- /dev/null +++ b/src/KeyVault/Microsoft.Azure.KeyVault.Tests/SessionRecords/Microsoft.Azure.KeyVault.Tests.KeyVaultOperationsTest/KeyVaultWrapUnwrapRsaOaep256Test.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "/keys/sdktestkey//wrapkey?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS8vd3JhcGtleT9hcGktdmVyc2lvbj0yMDE2LTEwLTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"RSA-OAEP-256\",\r\n \"value\": \"CIpsKPmL_HU7E5BXsW9ELlH0SmzI83whyXCwVsYKwnA\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "88" + ], + "x-ms-client-request-id": [ + "40b720e8-e458-4986-a4c2-03e11d2ed6a7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/c5c57eb2b32244be9cd87ec9a0a915e0\",\r\n \"value\": \"UPVd8u6cj54-EGuDyMHp96bNIz1DvGOAPLl9CNNELkGOWpWIRslKHVfSnu_HJAyw6rbY9rGU4pTnQuc2b2tANItvGBh5sbRoP2O-MnQqbeFykHUWuusmRW9d0x9bnPUKxTR4UwURFNCP9bZEH3pJBOQJifjSp8xqDAyHOvSn0UpYcf7hXr-62u49kJXwjeDlCnV7_i90cv-I2g8B-2dZdQ-bxH6n8KXfIhy4CaxvghEwlTaSDHZgrW9pNjbj8Sh8OQvktheWcvHPqx26ZK0rMXTZhrNMwJqfpgwFLg3v-Nc1vt45ajkUbgG0qcUq2cpVYRpZzGbRZhZ5WYhrI_wUzQ\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "455" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:15:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "e1b332bb-b1b2-42f4-98fe-a4e871f99700" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/keys/sdktestkey/c5c57eb2b32244be9cd87ec9a0a915e0/unwrapkey?api-version=2016-10-01", + "EncodedRequestUri": "L2tleXMvc2RrdGVzdGtleS9jNWM1N2ViMmIzMjI0NGJlOWNkODdlYzlhMGE5MTVlMC91bndyYXBrZXk/YXBpLXZlcnNpb249MjAxNi0xMC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"alg\": \"RSA-OAEP-256\",\r\n \"value\": \"UPVd8u6cj54-EGuDyMHp96bNIz1DvGOAPLl9CNNELkGOWpWIRslKHVfSnu_HJAyw6rbY9rGU4pTnQuc2b2tANItvGBh5sbRoP2O-MnQqbeFykHUWuusmRW9d0x9bnPUKxTR4UwURFNCP9bZEH3pJBOQJifjSp8xqDAyHOvSn0UpYcf7hXr-62u49kJXwjeDlCnV7_i90cv-I2g8B-2dZdQ-bxH6n8KXfIhy4CaxvghEwlTaSDHZgrW9pNjbj8Sh8OQvktheWcvHPqx26ZK0rMXTZhrNMwJqfpgwFLg3v-Nc1vt45ajkUbgG0qcUq2cpVYRpZzGbRZhZ5WYhrI_wUzQ\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "387" + ], + "x-ms-client-request-id": [ + "0efb1c2b-8b56-4e5b-af8e-fe34121b6c5f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.KeyVault.KeyVaultClient/2.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"kid\": \"https://kv-sdk-test.vault-int.azure-int.net/keys/sdktestkey/c5c57eb2b32244be9cd87ec9a0a915e0\",\r\n \"value\": \"CIpsKPmL_HU7E5BXsW9ELlH0SmzI83whyXCwVsYKwnA\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "156" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 05 Apr 2017 23:15:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "x-ms-keyvault-region": [ + "eastus2" + ], + "x-ms-request-id": [ + "6784a8b9-0b6a-4b46-8f10-0021ab40e0ce" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.1152" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "Strict-Transport-Security": [ + "max-age=31536000;includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "VaultAddress": "https://kv-sdk-test.vault-int.azure-int.net/", + "KeyName": "sdktestkey", + "KeyVersion": "c5c57eb2b32244be9cd87ec9a0a915e0", + "SoftDeleteEnabled": "True", + "SymmetricKeyBytes": "CIpsKPmL/HU7E5BXsW9ELlH0SmzI83whyXCwVsYKwnA=" + } +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeyEncryptionAlgorithms.cs b/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeyEncryptionAlgorithms.cs index 1f07b3a96e80..0a0b5e62755a 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeyEncryptionAlgorithms.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeyEncryptionAlgorithms.cs @@ -13,6 +13,10 @@ public static class JsonWebKeyEncryptionAlgorithm public const string RSAOAEP = "RSA-OAEP"; public const string RSA15 = "RSA1_5"; + // RSAES OAEP using SHA-256 and MGF1 with SHA-256 + // defined https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms + public const string RSAOAEP256 = "RSA-OAEP-256"; + /// /// All algorithms names. Use clone to avoid FxCop violation /// @@ -21,6 +25,6 @@ public static string[] AllAlgorithms get { return (string[])_allAlgorithms.Clone(); } } - private static readonly string[] _allAlgorithms = { RSA15, RSAOAEP }; + private static readonly string[] _allAlgorithms = { RSA15, RSAOAEP, RSAOAEP256 }; } } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeySignatureAlgorithms.cs b/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeySignatureAlgorithms.cs index 99023858e595..c62f071ab8d7 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeySignatureAlgorithms.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault.WebKey/JsonWebKeySignatureAlgorithms.cs @@ -15,6 +15,14 @@ public static class JsonWebKeySignatureAlgorithm public const string RS512 = "RS512"; public const string RSNULL = "RSNULL"; + // RSASSA-PSS using SHA-256 and MGF1 with SHA-256 + // defined https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms + public const string PS256 = "PS256"; + // RSASSA-PSS using SHA-384 and MGF1 with SHA-384 + public const string PS384 = "PS384"; + // RSASSA-PSS using SHA-512 and MGF1 with SHA-512 + public const string PS512 = "PS512"; + /// /// All algorithms names. Use clone to avoid FxCop violation /// @@ -23,6 +31,6 @@ public static string[] AllAlgorithms get { return (string[])_allAlgorithms.Clone(); } } - private static readonly string[] _allAlgorithms = { RS256, RS384, RS512, RSNULL }; + private static readonly string[] _allAlgorithms = { RS256, RS384, RS512, RSNULL, PS256, PS384, PS512 }; } } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/IKeyVaultClient.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/IKeyVaultClient.cs index 1cfadacd1281..6a7828b70546 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/IKeyVaultClient.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/IKeyVaultClient.cs @@ -306,7 +306,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', + /// 'RSA-OAEP-256', 'RSA1_5' /// /// /// @@ -331,7 +332,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', + /// 'RSA-OAEP-256', 'RSA1_5' /// /// /// @@ -358,7 +360,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// /// The signing/verification algorithm identifier. For more information /// on possible algorithm types, see JsonWebKeySignatureAlgorithm. - /// Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + /// Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', + /// 'RS384', 'RS512', 'RSNULL' /// /// /// @@ -385,7 +388,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// /// The signing/verification algorithm. For more information on /// possible algorithm types, see JsonWebKeySignatureAlgorithm. - /// Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + /// Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', + /// 'RS384', 'RS512', 'RSNULL' /// /// /// The digest used for signing. @@ -414,7 +418,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', + /// 'RSA-OAEP-256', 'RSA1_5' /// /// /// @@ -440,7 +445,8 @@ public partial interface IKeyVaultClient : System.IDisposable /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', + /// 'RSA-OAEP-256', 'RSA1_5' /// /// /// @@ -742,7 +748,7 @@ public partial interface IKeyVaultClient : System.IDisposable /// /// The cancellation token. /// - Task> BackupSecretWithHttpMessagesAsync( string vaultBaseUrl, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default( CancellationToken ) ); + Task> BackupSecretWithHttpMessagesAsync(string vaultBaseUrl, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restores a backed up secret to a vault. @@ -759,7 +765,7 @@ public partial interface IKeyVaultClient : System.IDisposable /// /// The cancellation token. /// - Task> RestoreSecretWithHttpMessagesAsync( string vaultBaseUrl, byte[ ] secretBundleBackup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default( CancellationToken ) ); + Task> RestoreSecretWithHttpMessagesAsync(string vaultBaseUrl, byte[] secretBundleBackup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List certificates in a specified key vault diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClient.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClient.cs index 5d9e974d5dd8..8b94e810de41 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClient.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClient.cs @@ -2063,7 +2063,8 @@ private void Initialize() /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -2291,7 +2292,8 @@ private void Initialize() /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -2521,7 +2523,7 @@ private void Initialize() /// /// The signing/verification algorithm identifier. For more information on /// possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values - /// include: 'RS256', 'RS384', 'RS512', 'RSNULL' + /// include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// /// /// @@ -2751,7 +2753,7 @@ private void Initialize() /// /// The signing/verification algorithm. For more information on possible /// algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: - /// 'RS256', 'RS384', 'RS512', 'RSNULL' + /// 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// /// /// The digest used for signing. @@ -2988,7 +2990,8 @@ private void Initialize() /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -3217,7 +3220,8 @@ private void Initialize() /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -6145,126 +6149,126 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> BackupSecretWithHttpMessagesAsync( string vaultBaseUrl, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default( CancellationToken ) ) + public async Task> BackupSecretWithHttpMessagesAsync(string vaultBaseUrl, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if ( vaultBaseUrl == null ) + if (vaultBaseUrl == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "vaultBaseUrl" ); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultBaseUrl"); } - if ( secretName == null ) + if (secretName == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "secretName" ); + throw new ValidationException(ValidationRules.CannotBeNull, "secretName"); } - if ( ApiVersion == null ) + if (ApiVersion == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "this.ApiVersion" ); + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; - if ( _shouldTrace ) + if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString( ); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add( "vaultBaseUrl", vaultBaseUrl ); - tracingParameters.Add( "secretName", secretName ); - tracingParameters.Add( "cancellationToken", cancellationToken ); - ServiceClientTracing.Enter( _invocationId, this, "BackupSecret", tracingParameters ); + tracingParameters.Add("vaultBaseUrl", vaultBaseUrl); + tracingParameters.Add("secretName", secretName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BackupSecret", tracingParameters); } // Construct URL var _baseUrl = BaseUri; var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "secrets/{secret-name}/backup"; - _url = _url.Replace( "{vaultBaseUrl}", vaultBaseUrl ); - _url = _url.Replace( "{secret-name}", System.Uri.EscapeDataString( secretName ) ); + _url = _url.Replace("{vaultBaseUrl}", vaultBaseUrl); + _url = _url.Replace("{secret-name}", System.Uri.EscapeDataString(secretName)); List _queryParameters = new List(); - if ( ApiVersion != null ) + if (ApiVersion != null) { - _queryParameters.Add( string.Format( "api-version={0}", System.Uri.EscapeDataString( ApiVersion ) ) ); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } - if ( _queryParameters.Count > 0 ) + if (_queryParameters.Count > 0) { - _url += ( _url.Contains( "?" ) ? "&" : "?" ) + string.Join( "&", _queryParameters ); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod( "POST" ); - _httpRequest.RequestUri = new System.Uri( _url ); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if ( GenerateClientRequestId != null && GenerateClientRequestId.Value ) + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation( "x-ms-client-request-id", System.Guid.NewGuid( ).ToString( ) ); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if ( AcceptLanguage != null ) + if (AcceptLanguage != null) { - if ( _httpRequest.Headers.Contains( "accept-language" ) ) + if (_httpRequest.Headers.Contains("accept-language")) { - _httpRequest.Headers.Remove( "accept-language" ); + _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation( "accept-language", AcceptLanguage ); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); } - if ( customHeaders != null ) + if (customHeaders != null) { - foreach ( var _header in customHeaders ) + foreach(var _header in customHeaders) { - if ( _httpRequest.Headers.Contains( _header.Key ) ) + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpRequest.Headers.Remove( _header.Key ); + _httpRequest.Headers.Remove(_header.Key); } - _httpRequest.Headers.TryAddWithoutValidation( _header.Key, _header.Value ); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials - if ( Credentials != null ) + if (Credentials != null) { - cancellationToken.ThrowIfCancellationRequested( ); - await Credentials.ProcessHttpRequestAsync( _httpRequest, cancellationToken ).ConfigureAwait( false ); + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request - if ( _shouldTrace ) + if (_shouldTrace) { - ServiceClientTracing.SendRequest( _invocationId, _httpRequest ); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } - cancellationToken.ThrowIfCancellationRequested( ); - _httpResponse = await HttpClient.SendAsync( _httpRequest, cancellationToken ).ConfigureAwait( false ); - if ( _shouldTrace ) + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse( _invocationId, _httpResponse ); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested( ); + cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ( ( int )_statusCode != 200 ) + if ((int)_statusCode != 200) { var ex = new KeyVaultErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync( ).ConfigureAwait( false ); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); KeyVaultError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if ( _errorBody != null ) + if (_errorBody != null) { ex.Body = _errorBody; } } - catch ( JsonException ) + catch (JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper( _httpRequest, _requestContent ); - ex.Response = new HttpResponseMessageWrapper( _httpResponse, _responseContent ); - if ( _shouldTrace ) + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) { - ServiceClientTracing.Error( _invocationId, ex ); + ServiceClientTracing.Error(_invocationId, ex); } - _httpRequest.Dispose( ); - if ( _httpResponse != null ) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpResponse.Dispose( ); + _httpResponse.Dispose(); } throw ex; } @@ -6272,31 +6276,31 @@ private void Initialize() var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - if ( _httpResponse.Headers.Contains( "x-ms-request-id" ) ) + if (_httpResponse.Headers.Contains("x-ms-request-id")) { - _result.RequestId = _httpResponse.Headers.GetValues( "x-ms-request-id" ).FirstOrDefault( ); + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ( ( int )_statusCode == 200 ) + if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync( ).ConfigureAwait( false ); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject( _responseContent, DeserializationSettings ); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } - catch ( JsonException ex ) + catch (JsonException ex) { - _httpRequest.Dispose( ); - if ( _httpResponse != null ) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpResponse.Dispose( ); + _httpResponse.Dispose(); } - throw new SerializationException( "Unable to deserialize the response.", _responseContent, ex ); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - if ( _shouldTrace ) + if (_shouldTrace) { - ServiceClientTracing.Exit( _invocationId, _result ); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -6331,136 +6335,136 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> RestoreSecretWithHttpMessagesAsync( string vaultBaseUrl, byte[ ] secretBundleBackup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default( CancellationToken ) ) + public async Task> RestoreSecretWithHttpMessagesAsync(string vaultBaseUrl, byte[] secretBundleBackup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if ( vaultBaseUrl == null ) + if (vaultBaseUrl == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "vaultBaseUrl" ); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultBaseUrl"); } - if ( ApiVersion == null ) + if (ApiVersion == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "this.ApiVersion" ); + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); } - if ( secretBundleBackup == null ) + if (secretBundleBackup == null) { - throw new ValidationException( ValidationRules.CannotBeNull, "secretBundleBackup" ); + throw new ValidationException(ValidationRules.CannotBeNull, "secretBundleBackup"); } SecretRestoreParameters parameters = new SecretRestoreParameters(); - if ( secretBundleBackup != null ) + if (secretBundleBackup != null) { parameters.SecretBundleBackup = secretBundleBackup; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; - if ( _shouldTrace ) + if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString( ); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add( "vaultBaseUrl", vaultBaseUrl ); - tracingParameters.Add( "parameters", parameters ); - tracingParameters.Add( "cancellationToken", cancellationToken ); - ServiceClientTracing.Enter( _invocationId, this, "RestoreSecret", tracingParameters ); + tracingParameters.Add("vaultBaseUrl", vaultBaseUrl); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RestoreSecret", tracingParameters); } // Construct URL var _baseUrl = BaseUri; var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "secrets/restore"; - _url = _url.Replace( "{vaultBaseUrl}", vaultBaseUrl ); + _url = _url.Replace("{vaultBaseUrl}", vaultBaseUrl); List _queryParameters = new List(); - if ( ApiVersion != null ) + if (ApiVersion != null) { - _queryParameters.Add( string.Format( "api-version={0}", System.Uri.EscapeDataString( ApiVersion ) ) ); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } - if ( _queryParameters.Count > 0 ) + if (_queryParameters.Count > 0) { - _url += ( _url.Contains( "?" ) ? "&" : "?" ) + string.Join( "&", _queryParameters ); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod( "POST" ); - _httpRequest.RequestUri = new System.Uri( _url ); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if ( GenerateClientRequestId != null && GenerateClientRequestId.Value ) + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation( "x-ms-client-request-id", System.Guid.NewGuid( ).ToString( ) ); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if ( AcceptLanguage != null ) + if (AcceptLanguage != null) { - if ( _httpRequest.Headers.Contains( "accept-language" ) ) + if (_httpRequest.Headers.Contains("accept-language")) { - _httpRequest.Headers.Remove( "accept-language" ); + _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation( "accept-language", AcceptLanguage ); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); } - if ( customHeaders != null ) + if (customHeaders != null) { - foreach ( var _header in customHeaders ) + foreach(var _header in customHeaders) { - if ( _httpRequest.Headers.Contains( _header.Key ) ) + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpRequest.Headers.Remove( _header.Key ); + _httpRequest.Headers.Remove(_header.Key); } - _httpRequest.Headers.TryAddWithoutValidation( _header.Key, _header.Value ); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; - if ( parameters != null ) + if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject( parameters, SerializationSettings ); - _httpRequest.Content = new System.Net.Http.StringContent( _requestContent, System.Text.Encoding.UTF8 ); - _httpRequest.Content.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse( "application/json; charset=utf-8" ); + _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if ( Credentials != null ) + if (Credentials != null) { - cancellationToken.ThrowIfCancellationRequested( ); - await Credentials.ProcessHttpRequestAsync( _httpRequest, cancellationToken ).ConfigureAwait( false ); + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request - if ( _shouldTrace ) + if (_shouldTrace) { - ServiceClientTracing.SendRequest( _invocationId, _httpRequest ); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } - cancellationToken.ThrowIfCancellationRequested( ); - _httpResponse = await HttpClient.SendAsync( _httpRequest, cancellationToken ).ConfigureAwait( false ); - if ( _shouldTrace ) + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse( _invocationId, _httpResponse ); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested( ); + cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ( ( int )_statusCode != 200 ) + if ((int)_statusCode != 200) { var ex = new KeyVaultErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync( ).ConfigureAwait( false ); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); KeyVaultError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if ( _errorBody != null ) + if (_errorBody != null) { ex.Body = _errorBody; } } - catch ( JsonException ) + catch (JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper( _httpRequest, _requestContent ); - ex.Response = new HttpResponseMessageWrapper( _httpResponse, _responseContent ); - if ( _shouldTrace ) + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) { - ServiceClientTracing.Error( _invocationId, ex ); + ServiceClientTracing.Error(_invocationId, ex); } - _httpRequest.Dispose( ); - if ( _httpResponse != null ) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpResponse.Dispose( ); + _httpResponse.Dispose(); } throw ex; } @@ -6468,31 +6472,31 @@ private void Initialize() var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - if ( _httpResponse.Headers.Contains( "x-ms-request-id" ) ) + if (_httpResponse.Headers.Contains("x-ms-request-id")) { - _result.RequestId = _httpResponse.Headers.GetValues( "x-ms-request-id" ).FirstOrDefault( ); + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ( ( int )_statusCode == 200 ) + if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync( ).ConfigureAwait( false ); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject( _responseContent, DeserializationSettings ); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } - catch ( JsonException ex ) + catch (JsonException ex) { - _httpRequest.Dispose( ); - if ( _httpResponse != null ) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpResponse.Dispose( ); + _httpResponse.Dispose(); } - throw new SerializationException( "Unable to deserialize the response.", _responseContent, ex ); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - if ( _shouldTrace ) + if (_shouldTrace) { - ServiceClientTracing.Exit( _invocationId, _result ); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClientExtensions.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClientExtensions.cs index e03edfc7b69d..ad327101950a 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClientExtensions.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/KeyVaultClientExtensions.cs @@ -315,7 +315,8 @@ public static partial class KeyVaultClientExtensions /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -346,7 +347,8 @@ public static partial class KeyVaultClientExtensions /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -379,7 +381,7 @@ public static partial class KeyVaultClientExtensions /// /// The signing/verification algorithm identifier. For more information on /// possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values - /// include: 'RS256', 'RS384', 'RS512', 'RSNULL' + /// include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// /// /// @@ -412,7 +414,7 @@ public static partial class KeyVaultClientExtensions /// /// The signing/verification algorithm. For more information on possible /// algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: - /// 'RS256', 'RS384', 'RS512', 'RSNULL' + /// 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// /// /// The digest used for signing. @@ -447,7 +449,8 @@ public static partial class KeyVaultClientExtensions /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -479,7 +482,8 @@ public static partial class KeyVaultClientExtensions /// The version of the key. /// /// - /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA1_5' + /// algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + /// 'RSA1_5' /// /// /// @@ -845,69 +849,69 @@ public static partial class KeyVaultClientExtensions } } - /// - /// Requests that a backup of the specified secret be downloaded to the client. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The vault name, for example https://myvault.vault.azure.net. - /// - /// - /// The name of the secret. - /// - /// - /// The cancellation token. - /// - public static async Task BackupSecretAsync( this IKeyVaultClient operations, string vaultBaseUrl, string secretName, CancellationToken cancellationToken = default( CancellationToken ) ) - { - using ( var _result = await operations.BackupSecretWithHttpMessagesAsync( vaultBaseUrl, secretName, null, cancellationToken ).ConfigureAwait( false ) ) + /// + /// Requests that a backup of the specified secret be downloaded to the client. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The vault name, for example https://myvault.vault.azure.net. + /// + /// + /// The name of the secret. + /// + /// + /// The cancellation token. + /// + public static async Task BackupSecretAsync(this IKeyVaultClient operations, string vaultBaseUrl, string secretName, CancellationToken cancellationToken = default(CancellationToken)) { - return _result.Body; + using (var _result = await operations.BackupSecretWithHttpMessagesAsync(vaultBaseUrl, secretName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } - } - - /// - /// Restores a backed up secret to a vault. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The vault name, for example https://myvault.vault.azure.net. - /// - /// - /// The backup blob associated with a secret bundle. - /// - /// - /// The cancellation token. - /// - public static async Task RestoreSecretAsync( this IKeyVaultClient operations, string vaultBaseUrl, byte[ ] secretBundleBackup, CancellationToken cancellationToken = default( CancellationToken ) ) - { - using ( var _result = await operations.RestoreSecretWithHttpMessagesAsync( vaultBaseUrl, secretBundleBackup, null, cancellationToken ).ConfigureAwait( false ) ) + + /// + /// Restores a backed up secret to a vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The vault name, for example https://myvault.vault.azure.net. + /// + /// + /// The backup blob associated with a secret bundle. + /// + /// + /// The cancellation token. + /// + public static async Task RestoreSecretAsync(this IKeyVaultClient operations, string vaultBaseUrl, byte[] secretBundleBackup, CancellationToken cancellationToken = default(CancellationToken)) { - return _result.Body; + using (var _result = await operations.RestoreSecretWithHttpMessagesAsync(vaultBaseUrl, secretBundleBackup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } - } - - /// - /// List certificates in a specified key vault - /// - /// - /// The operations group for this extension method. - /// - /// - /// The vault name, for example https://myvault.vault.azure.net. - /// - /// - /// Maximum number of results to return in a page. If not specified the service - /// will return up to 25 results. - /// - /// - /// The cancellation token. - /// - public static async Task> GetCertificatesAsync(this IKeyVaultClient operations, string vaultBaseUrl, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + + /// + /// List certificates in a specified key vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The vault name, for example https://myvault.vault.azure.net. + /// + /// + /// Maximum number of results to return in a page. If not specified the service + /// will return up to 25 results. + /// + /// + /// The cancellation token. + /// + public static async Task> GetCertificatesAsync(this IKeyVaultClient operations, string vaultBaseUrl, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetCertificatesWithHttpMessagesAsync(vaultBaseUrl, maxresults, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/BackupSecretResult.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/BackupSecretResult.cs index d8ea9504489f..dd125585911f 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/BackupSecretResult.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/BackupSecretResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // @@ -23,14 +23,14 @@ public partial class BackupSecretResult /// /// Initializes a new instance of the BackupSecretResult class. /// - public BackupSecretResult( ) { } + public BackupSecretResult() { } /// /// Initializes a new instance of the BackupSecretResult class. /// /// The backup blob containing the backed up /// secret. - public BackupSecretResult( byte[ ] value = default( byte[ ] ) ) + public BackupSecretResult(byte[] value = default(byte[])) { Value = value; } @@ -38,9 +38,9 @@ public BackupSecretResult( ) { } /// /// Gets the backup blob containing the backed up secret. /// - [JsonConverter( typeof( Base64UrlJsonConverter ) )] - [JsonProperty( PropertyName = "value" )] - public byte[ ] Value { get; protected set; } + [JsonConverter(typeof(Base64UrlJsonConverter))] + [JsonProperty(PropertyName = "value")] + public byte[] Value { get; protected set; } } -} +} \ No newline at end of file diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyOperationsParameters.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyOperationsParameters.cs index e0f0f92a4e63..ba8a603c354b 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyOperationsParameters.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyOperationsParameters.cs @@ -29,7 +29,7 @@ public KeyOperationsParameters() { } /// Initializes a new instance of the KeyOperationsParameters class. /// /// algorithm identifier. Possible values - /// include: 'RSA-OAEP', 'RSA1_5' + /// include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' public KeyOperationsParameters(string algorithm, byte[] value) { Algorithm = algorithm; @@ -38,7 +38,7 @@ public KeyOperationsParameters(string algorithm, byte[] value) /// /// Gets or sets algorithm identifier. Possible values include: - /// 'RSA-OAEP', 'RSA1_5' + /// 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' /// [JsonProperty(PropertyName = "alg")] public string Algorithm { get; set; } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeySignParameters.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeySignParameters.cs index a1ae0fd35d20..98fdf2b6f8a1 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeySignParameters.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeySignParameters.cs @@ -30,8 +30,8 @@ public KeySignParameters() { } /// /// The signing/verification algorithm /// identifier. For more information on possible algorithm types, see - /// JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', - /// 'RS384', 'RS512', 'RSNULL' + /// JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + /// 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' public KeySignParameters(string algorithm, byte[] value) { Algorithm = algorithm; @@ -41,8 +41,8 @@ public KeySignParameters(string algorithm, byte[] value) /// /// Gets or sets the signing/verification algorithm identifier. For /// more information on possible algorithm types, see - /// JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', - /// 'RS384', 'RS512', 'RSNULL' + /// JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + /// 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// [JsonProperty(PropertyName = "alg")] public string Algorithm { get; set; } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyVerifyParameters.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyVerifyParameters.cs index 5824ee499cc5..3e4ed6a3fec9 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyVerifyParameters.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/KeyVerifyParameters.cs @@ -30,8 +30,8 @@ public KeyVerifyParameters() { } /// /// The signing/verification algorithm. For /// more information on possible algorithm types, see - /// JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', - /// 'RS384', 'RS512', 'RSNULL' + /// JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + /// 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// The digest used for signing. /// The signature to be verified. public KeyVerifyParameters(string algorithm, byte[] digest, byte[] signature) @@ -44,8 +44,8 @@ public KeyVerifyParameters(string algorithm, byte[] digest, byte[] signature) /// /// Gets or sets the signing/verification algorithm. For more /// information on possible algorithm types, see - /// JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', - /// 'RS384', 'RS512', 'RSNULL' + /// JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + /// 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' /// [JsonProperty(PropertyName = "alg")] public string Algorithm { get; set; } diff --git a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/SecretRestoreParameters.cs b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/SecretRestoreParameters.cs index 603613152004..2d04af33a573 100644 --- a/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/SecretRestoreParameters.cs +++ b/src/KeyVault/Microsoft.Azure.KeyVault/Generated/Models/SecretRestoreParameters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // @@ -23,14 +23,14 @@ public partial class SecretRestoreParameters /// /// Initializes a new instance of the SecretRestoreParameters class. /// - public SecretRestoreParameters( ) { } + public SecretRestoreParameters() { } /// /// Initializes a new instance of the SecretRestoreParameters class. /// /// The backup blob associated with a /// secret bundle. - public SecretRestoreParameters( byte[ ] secretBundleBackup ) + public SecretRestoreParameters(byte[] secretBundleBackup) { SecretBundleBackup = secretBundleBackup; } @@ -38,9 +38,9 @@ public SecretRestoreParameters( byte[ ] secretBundleBackup ) /// /// Gets or sets the backup blob associated with a secret bundle. /// - [JsonConverter( typeof( Base64UrlJsonConverter ) )] - [JsonProperty( PropertyName = "value" )] - public byte[ ] SecretBundleBackup { get; set; } + [JsonConverter(typeof(Base64UrlJsonConverter))] + [JsonProperty(PropertyName = "value")] + public byte[] SecretBundleBackup { get; set; } /// /// Validate the object.