Xojo Plugin
Xojo Plugin
Use Base64 RSA Key to Encrypt
See more RSA Examples
Loads a Base64 RSA key and uses it to encrypt a string, returning the result in base64.Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Dim pubkey As New Chilkat.PublicKey
success = pubkey.LoadBase64("MIICdgIBADA ... A9PXLk+j5A==")
If (success = False) Then
System.DebugLog(pubkey.LastErrorText)
Return
End If
Dim rsa As New Chilkat.Rsa
success = rsa.UsePublicKey(pubkey)
If (success = False) Then
System.DebugLog(rsa.LastErrorText)
Return
End If
rsa.EncodingMode = "base64"
Dim encryptedStr As String
encryptedStr = rsa.EncryptStringENC("12345678",False)
System.DebugLog(encryptedStr)