fcrcrypto

package
v0.0.0-...-7a4b066 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package fcrcrypto - location for cryptographic tools to perform common operations on hashes, keys and signatures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRetrievalKeyPair

func GenerateRetrievalKeyPair() (string, string, string, error)

GenerateRetrievalKeyPair generates a new key, returns the private key, its associated public key, node id and error.

func GetPublicKey

func GetPublicKey(privKeyStr string) (string, string, error)

GetPublicKey gets the public key, node id and error of giving private key

func GetWalletAddress

func GetWalletAddress(pubKeyStr string) (string, error)

GetWalletAddress gets the wallet address from a public key.

func Sign

func Sign(privKeyStr string, ver byte, data []byte) (string, error)

Sign signs given bytes using given private key and given version, returns the signature in bytes and error.

func Verify

func Verify(pubKeyStr string, ver byte, sigStr string, data []byte) error

Verify verifies the given msg and its signature against the public key and key version, returns error.

func VerifyByID

func VerifyByID(id string, sigStr string, data []byte) error

VerifyByID verifies the signature using the ID (hashed public key). By default, the signing version is 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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