AutoIt
AutoIt
DSA Public Key PEM to DER Conversion
See more DSA Examples
Converts a DSA public key from PEM format to DER.Chilkat AutoIt Downloads
Local $bSuccess = False
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oDsa = ObjCreate("Chilkat.Dsa")
; Load a PEM public key.
Local $sPemPublicKey
$sPemPublicKey = $oDsa.LoadText("dsa_pub.pem")
; Import the public key PEM into the DSA object.
$bSuccess = $oDsa.FromPublicPem($sPemPublicKey)
If ($bSuccess <> True) Then
ConsoleWrite($oDsa.LastErrorText & @CRLF)
Exit
EndIf
; Write it out as a DER file:
$bSuccess = $oDsa.ToPublicDerFile("dsa_pub.der")
If ($bSuccess <> True) Then
ConsoleWrite($oDsa.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Finished!" & @CRLF)