PowerShell
PowerShell
RSA Import Private Key
See more RSA Examples
Shows how to select/import a private key for RSA signing or decryption.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
$privKey = New-Object Chilkat.PrivateKey
$password = "secret"
# In all Chilkat methods expecting a path, you pass either absolute or relative paths.
$success = $privKey.LoadAnyFormatFile("rsaKeys/myTestRsaPrivate.pem",$password)
if ($success -eq $false) {
$($privKey.LastErrorText)
exit
}
$rsa = New-Object Chilkat.Rsa
# Tell the RSA object to use the private key (i.e. import the private key)
$rsa.UsePrivateKey($privKey)