PowerShell
PowerShell
Convert DSA Public Key DER to PEM
See more DSA Examples
Converts a DSA public key from DER format to PEM.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
$dsa = New-Object Chilkat.Dsa
# Load a DER public key.
$success = $dsa.FromPublicDerFile("dsa_pub.der")
if ($success -ne $true) {
$($dsa.LastErrorText)
exit
}
# Save the public key to PEM:
$pemStr = $dsa.ToPublicPem()
$success = $dsa.SaveText($pemStr,"dsa_pub.pem")
if ($success -ne $true) {
$($dsa.LastErrorText)
exit
}
$("Finished!")