ecdsa

package
v0.0.0-...-82916ba Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeStealthAddress

func ComputeStealthAddress(privateKey *ecdsa.PrivateKey, recipientPublicKey *ecdsa.PublicKey) ecdsa.PublicKey

ComputeStealthAddress returns a public key computed using one private key and one public key it creates a unique combination

func EncodePublic

func EncodePublic(publicKey *ecdsa.PublicKey) string

EncodePublic takes the public key and returns a pem encoded string

func GenerateAndSaveKeyPair

func GenerateAndSaveKeyPair(name, path string) (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)

GenerateAndSaveKeyPair generates a pair of public and private keys and save it as files

func GenerateKeyPair

func GenerateKeyPair() (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)

GenerateKeyPair generates a pair of public and private keys of length 256 and returns them

func LoadKeyPair

func LoadKeyPair(name, path string) (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)

LoadKeyPair retrives the pair of keys from the given name in their respective path, decodes them and returns them

func Sign

func Sign(privateKey *ecdsa.PrivateKey, jsonContent map[string]interface{}) (*big.Int, *big.Int, error)

Sign returns the signature of the given JSON object

func Verify

func Verify(publicKey ecdsa.PublicKey, jsonContent map[string]interface{}, signatureX, signatureY *big.Int) bool

Verify returns if the given message using the given public key is verified by the signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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