Command: powershell -NoProfile -Command "$pub=[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUF4N0VjMnBVUEhjd0RFR3Z2bEtuNgpNT01mbHB1RncrNXFubjAvWFA1YzUxTW51Y0hqcjJpTDlGV1NGT1lVNW1JVklwdVVic2xjZ1Q2ZjRFS245T0VzCnVObzJSaXdubkd2ckZIOSsxQkMvODk0dmRMVEhhMm5wU05PVlhNZEJWOHFrSzRVckY3OHhRT0hTN2pIZjRVM3MKYnJqYUV0d3NwMzBkTW9mU1BJMVJuZ1hnbkZaR3FXSmV3ZExVT1AvdnN6MFo3aUh5Z1FQUVlaZTlkV2phSEllMgpOREozUmN3SjY0Z2l2dFRySW91SnFmVDhkTjZLdGE2NnpHUnV1ZmdsNkZkQkZNZHUyR0toZ2ZIZ1VPWUowZUkrCmc1Z3RiQW41MGNienJOVlNzTGtUNmdqMjAyd3d4am1xN0NPc1d6aXRBNGNjdkcvcktudUZEOGZJb25IMDdQQ2kKRDZpSHRqRlRJYUxJeXg2SkszY210THlKeCtTZzU1VkRqMnVwQ3owaVlmRk5jSHBPYWdYejVhVi9rWXZNaGx1WQpTNXFRZFNKMmJwTFhEd1NqSWV1c0FMT0NGVk1CclVOci9PSllRRVd0WmFjWjMrL0pBNW5iMVd4ZDBxMVR3QU9ZCjNpQ3pHdytIdy9odXUyeUZGL2NSRE9uV04rWDBZNlpiOXFrSm1IMEg3OU5kQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==')); $b64=($pub -replace '-----BEGIN PUBLIC KEY-----','' -replace '-----END PUBLIC KEY-----','' -replace '\s',''); $der=[Convert]::FromBase64String($b64); $rsa=[System.Security.Cryptography.RSA]::Create(); $read=0; $rsa.ImportSubjectPublicKeyInfo($der,[ref]$read); $plain=[IO.File]::ReadAllBytes('C:\Users\ash\PhoneOperatorBridge\bridge_private.json'); $enc=$rsa.Encrypt($plain,[System.Security.Cryptography.RSAEncryptionPadding]::OaepSHA256); Write-Output ('ENC_B64='+[Convert]::ToBase64String($enc)); Write-Output ('PLAIN_SHA256='+([BitConverter]::ToString([System.Security.Cryptography.SHA256]::Create().ComputeHash($plain)).Replace('-','').ToLower()))"
Directory: projects
Status: SUCCESS
Exit code: 0
Cancel Job Rerun Command Refresh
Method invocation failed because [System.Security.Cryptography.RSACryptoServiceProvider] does not contain a method
named 'ImportSubjectPublicKeyInfo'.
At line:1 char:1118
+ ... (); $read=0; $rsa.ImportSubjectPublicKeyInfo($der,[ref]$read); $plain ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
Exception calling "Encrypt" with "2" argument(s): "Specified padding mode is not valid for this algorithm."
At line:1 char:1256
+ ... ate.json'); $enc=$rsa.Encrypt($plain,[System.Security.Cryptography.RS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : CryptographicException
Exception calling "ToBase64String" with "1" argument(s): "Value cannot be null.
Parameter name: inArray"
At line:1 char:1347
+ ... aepSHA256); Write-Output ('ENC_B64='+[Convert]::ToBase64String($enc)) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
PLAIN_SHA256=51cfa1b3919277166c517513762d45c9a022bce7c96824a89ee57452bbe14b00