Xbase++ Requires Chilkat v11.0.0+
Xbase++
RSA Import Public Key
See more RSA Examples
Shows how to select/import a public key for RSA encryption or signature verification.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oPubKey
LOCAL oRsa
nSuccess := 0
oPubKey := CreateObject("Chilkat.PublicKey")
// In all Chilkat methods expecting a path, you pass either absolute or relative paths.
nSuccess := oPubKey:LoadFromFile("rsaKeys/myTestRsaPublic.pem")
IF (nSuccess == 0)
? oPubKey:LastErrorText
oPubKey:destroy()
RETURN
ENDIF
oRsa := CreateObject("Chilkat.Rsa")
// Tell RSA to use the public key.
oRsa:UsePublicKey(oPubKey)
oPubKey:destroy()
oRsa:destroy()