VerifySignature()

Verify a signature with a public key

Method signature

func VerifySignature(publicKey string, message string, signature string) bool

Parameters

NameTypeDescription

publicKey

String

Public key in hexadecimal format.

message

String

Message that you want to verify

signature

String

Signature that you want to compare

Example

package main

import (
	"fmt"
	
	"github.com/circular-protocol/circular-go/utils"
)

func main() {
	var publicKey = "0x04b5aa6be8b2e3420fb5a8b22e80e64ace8271d88dc4c081436956b0848e7bcf4e864b35c59e218885ed3d839352b81f85872c9460732ca05b8c18dad29dbad00e"
	var message = "cb8a393783b4c22dce96f32b12c86323eac3e8135230773d164a4bba8c7e9b38"
	var signature = "304402201a26641ae8c8cb42fae57401e2ba15309ea16ae8fccdced2699d0d1cae9e7c4502205781563776c29159f34cc63a152842aa956defcffd94b47ca9e8e76e169d4ad4"
	result := utils.VerifySignature(publicKey, message, signature)

	fmt.Println(result)
}

Result

The result will be a boolean object.

true

Last updated