verifyMessage

suspend fun verifyMessage(message: ByteArray, signature: ByteArray): Boolean

Verifies a binary message and its signature according to SEP-53.

The message is prefixed with "Stellar Signed Message:\n", hashed with SHA-256, and the resulting digest is verified against the provided signature using this keypair's Ed25519 public key.

Return

true if the signature is valid for the given message and this keypair's public key, false otherwise (including malformed signatures).

Parameters

message

The raw bytes of the original message.

signature

The Ed25519 signature to verify (expected 64 bytes).

See also


suspend fun verifyMessage(message: String, signature: ByteArray): Boolean

Verifies a UTF-8 string message and its signature according to SEP-53.

The message is encoded to UTF-8 bytes, prefixed with "Stellar Signed Message:\n", hashed with SHA-256, and the resulting digest is verified against the provided signature using this keypair's Ed25519 public key.

Return

true if the signature is valid for the given message and this keypair's public key, false otherwise (including malformed signatures).

Parameters

message

The original string message (will be UTF-8 encoded).

signature

The Ed25519 signature to verify (expected 64 bytes).

See also