Sample code for 30+ languages & platforms
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

AutoIt
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)