RSACng class is not supported on linux replacing it by RSA (#7349)

* RSACng class is not supported on linux replacing it by RSA

* update PS samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Ghufz 2020-09-07 12:54:36 +05:30 committed by GitHub
parent 089e1f7271
commit 7ac7974ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)