From 6e301ce3c481de0f83d0f650ce056a3bfdbbba4b Mon Sep 17 00:00:00 2001 From: Ghufz <18732053+Ghufz@users.noreply.github.com> Date: Fri, 4 Sep 2020 14:36:31 +0530 Subject: [PATCH 1/2] RSACng class is not supported on linux replacing it by RSA --- .../src/main/resources/powershell/http_signature_auth.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache b/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache index fe6a3dc8ec6f..698f9b248f4c 100644 --- a/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache @@ -174,7 +174,7 @@ function Get-{{{apiNamePrefix}}}RSASignature { $keyStr = Get-Content -Path $PrivateKeyFilePath -Raw $ecKeyBase64String = $keyStr.Replace($ecKeyHeader, "").Replace($ecKeyFooter, "").Trim() $keyBytes = [System.Convert]::FromBase64String($ecKeyBase64String) - $rsa = [System.Security.Cryptography.RSACng]::new() + $rsa = [System.Security.Cryptography.RSA]::Create() [int]$bytCount = 0 $rsa.ImportRSAPrivateKey($keyBytes, [ref] $bytCount) From a04949d7720759f1d4c6aaef352dfc49f3d27682 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 7 Sep 2020 14:45:24 +0800 Subject: [PATCH 2/2] update PS samples --- .../powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 index 6cb2087ccf13..e3333ae336f4 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 @@ -180,7 +180,7 @@ function Get-PSRSASignature { $keyStr = Get-Content -Path $PrivateKeyFilePath -Raw $ecKeyBase64String = $keyStr.Replace($ecKeyHeader, "").Replace($ecKeyFooter, "").Trim() $keyBytes = [System.Convert]::FromBase64String($ecKeyBase64String) - $rsa = [System.Security.Cryptography.RSACng]::new() + $rsa = [System.Security.Cryptography.RSA]::Create() [int]$bytCount = 0 $rsa.ImportRSAPrivateKey($keyBytes, [ref] $bytCount)