e-CryptIt Engine Xojo Plugin

EinhugurEd25519.Sign Method

Signs message using private and public key pair.

Sign(
   message as String,
   keys as EinhugurEd25519.KeyPair) as String

Parameters

message
The message to sign.
keys
The key pair to use to sign.

Returns

String
The signature. (Note that signatures are binary data, so not string with any encoding, you can use EncodeHex to represent it as Hex though if wanting to display it)

Signature is 64 character long.

Remarks


var message as String = "Some important message"

// Create key pair. (If not passing in seed then random seed is automatically generated)
var keys as new EinhugurEd25519.KeyPair()

// Sign our message with the key pair (Private and public key)
var signature as String = EinhugurEd25519.Sign(message,keys)

MessageBox("Signature: " + EndOfLine + EncodeHex(signature))

// Verify the signature with public key only. (Since person who verifies would only have the public key)
if EinhugurEd25519.Verify(message, signature, keys.PublicKey) then
    MessageBox("Signature was valid")
else
    MessageBox("Signature was not valid")
end if



This function can throw InvalidArgumentException if the keys are nil.

Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS
  • See Also

    EinhugurEd25519 Module