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 fe6a3dc8ec6..698f9b248f4 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) diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 index 6cb2087ccf1..e3333ae336f 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)