Xojo.Crypto.RSASign
From Xojo Documentation
Method
Xojo.Crypto.RSASign(data As Xojo.Core.MemoryBlock, privateKey As Xojo.Core.MemoryBlock) As Xojo.Core.MemoryBlock
Supported for all project types and targets.
Supported for all project types and targets.
Signs the data block using the specified privateKey using PKCS v1.5 with SHA1.
Sample Code
Sign a message:
Using Xojo.Core
Using Xojo.Crypto
Dim privateKey As MemoryBlock
Dim publicKey As MemoryBlock
If RSAGenerateKeyPair( 1024, privateKey, publicKey ) Then
// 1024-bit private and public keys were generated
Dim msg As MemoryBlock = TextEncoding.UTF8.ConvertTextToData("this is a test")
Dim signature As MemoryBlock = RSASign( msg, privateKey )
If signature <> Nil Then
// msg was successfully signed
End If
End If
Using Xojo.Crypto
Dim privateKey As MemoryBlock
Dim publicKey As MemoryBlock
If RSAGenerateKeyPair( 1024, privateKey, publicKey ) Then
// 1024-bit private and public keys were generated
Dim msg As MemoryBlock = TextEncoding.UTF8.ConvertTextToData("this is a test")
Dim signature As MemoryBlock = RSASign( msg, privateKey )
If signature <> Nil Then
// msg was successfully signed
End If
End If