Crypto.RSAVerifyKey

From Xojo Documentation

Method

Crypto.RSAVerifyKey(Key As String) As Boolean

New in 2013r4

Supported for all project types and targets.

Attempts to validate the specified key.

Sample Code

Verifies the generated public key:

Var privateKey As String
Var publicKey As String

If Crypto.RSAGenerateKeyPair( 1024, privateKey, publicKey ) Then
// 1024-bit private and public keys were generated

If Crypto.RSAVerifyKey(publicKey) Then
// publicKey is valid
End If

End If

Verification fails on a "fake" key:

If Crypto.RSAVerifyKey("not a real key!") Then
MessageBox("Valid!")
Else
MessageBox("Not valid!")
End If