sdk

package
v1.18.0-RC3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Provides the exported functions and types that are used to build the mobile SDK.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignatureScheme = errors.New("invalid_signature_scheme")

Functions

func SignRequest

func SignRequest(privateKey, signatureScheme string, data string) (string, error)

SignRequest sign data with private key and scheme

  • privateKey: private key to use for signing
  • signatureScheme: signature scheme to use for signing
  • data: data to sign using the private key

func SplitKeys added in v1.13.0

func SplitKeys(privateKey, signatureScheme string, numSplits int) ([]byte, error)

SplitKeys split keys by private key, return json string of wallet

 {
		"client_id":"3943b66200f4702145596de769c5137b333b42bf67c665677355843f233009e2",
		"client_key":"3423af4e1d19b99d5997a7ce5ee9fb46372a5e6a2af18e4640e1aeb3fe116f18580e723ae6d6527ff4cf81b537d4bbf5de670169654fa8f9e54291fa930f9f9a",
		"keys":[{
			"public_key":"3423af4e1d19b99d5997a7ce5ee9fb46372a5e6a2af18e4640e1aeb3fe116f18580e723ae6d6527ff4cf81b537d4bbf5de670169654fa8f9e54291fa930f9f9a",
			"private_key":"69a59735f39eae40b80d53a73c5d7b161998da0b7cea44c94672a01c9128da09"
			}
		],
		"mnemonics":"guitar cook depend snake response major argue abstract script tonight energy soccer copy latin street bracket combine image fabric maximum mercy icon bitter dwarf",
		"version":"1.0","date_created":"2022-11-02T10:21:32+08:00","nonce":0
 }
	- privateKey: private key to use for signing
	- signatureScheme: signature scheme to use for signing
	- numSplits: number of splits

func VerifySignature

func VerifySignature(publicKey, signatureScheme string, data string, signature string) (bool, error)

VerifySignature verify signature with public key, schema and data

  • publicKey: public key to use for verifying signature
  • signatureScheme: signature scheme to use for verifying signature
  • data: data to verify using the public key
  • signature: signature to verify

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL