Sample code for 30+ languages & platforms
AutoIt

Get Public Key from Certificate PEM

See more Certificates Examples

Loads a certificate from a PEM file and gets the cert's public key.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

$oCert = ObjCreate("Chilkat.Cert")

$bSuccess = $oCert.LoadFromFile("qa_data/certs/someCert.pem")
If ($bSuccess = False) Then
    ConsoleWrite($oCert.LastErrorText & @CRLF)
    Exit
EndIf

; Get the certificate's public key:
$oPubkey = ObjCreate("Chilkat.PublicKey")
$oCert.GetPublicKey($oPubkey)

ConsoleWrite($oPubkey.GetPem(False) & @CRLF)

; OK.. we have the public key which can be used in other Chilkat classes/methods...