forked from loafle/openapi-generator-original
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:
parent
089e1f7271
commit
7ac7974ef5
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user