secp256k1

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PrivateKeyLen = 32
View Source
const SignatureRSFormatLen = 64 //64 byte [R || S] format
View Source
const SignatureRSVFormatLen = 65 //65 byte [R || S || V] format
View Source
const SignatureVPosition = 64

Variables

This section is empty.

Functions

func GenerateSigningKeyPair

func GenerateSigningKeyPair() (publicKey, privateKey []byte)

func GetAddress

func GetAddress(publicKey []byte) string

func GetEthAuthKeyFromConfig

func GetEthAuthKeyFromConfig() (public, private []byte, err error)

GetEthAuthKeyFromConfig returns the public and private keys as byte array

func GetIDConfig

func GetIDConfig() (identityConfig *config.IdentityConfig, err error)

GetIDConfig reads the keys and ID from the config and returns a the Identity config

func GetPrivateEthAuthKey

func GetPrivateEthAuthKey(fileName string) (key []byte, err error)

GetPrivateEthAuthKey returns the private key from the file

func GetPublicEthAuthKey

func GetPublicEthAuthKey(fileName string) (key []byte, err error)

GetPublicEthAuthKey returns the public key from the file

func Sign

func Sign(message []byte, privateKey []byte) (signature []byte, err error)

func SignEthereum

func SignEthereum(message []byte, privateKey []byte) (signature []byte, err error)

func SignHash

func SignHash(data []byte) []byte

func VerifySignature

func VerifySignature(publicKey, message, signature []byte) bool

func VerifySignatureWithAddress

func VerifySignatureWithAddress(address, sigHex string, msg []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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