Xbase++
Xbase++
DSA Public Key PEM to DER Conversion
See more DSA Examples
Converts a DSA public key from PEM format to DER.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oDsa
LOCAL cPemPublicKey
nSuccess := 0
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oDsa := CreateObject("Chilkat.Dsa")
// Load a PEM public key.
cPemPublicKey := oDsa:LoadText("dsa_pub.pem")
// Import the public key PEM into the DSA object.
nSuccess := oDsa:FromPublicPem(cPemPublicKey)
IF (nSuccess != 1)
? oDsa:LastErrorText
oDsa:destroy()
RETURN
ENDIF
// Write it out as a DER file:
nSuccess := oDsa:ToPublicDerFile("dsa_pub.der")
IF (nSuccess != 1)
? oDsa:LastErrorText
oDsa:destroy()
RETURN
ENDIF
? "Finished!"
oDsa:destroy()