secp256k1

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PublicKeySize = 33

Variables

This section is empty.

Functions

func NewPemPair

func NewPemPair() ([]byte, []byte, error)

func PemToPrivateKey

func PemToPrivateKey(content []byte) (*secp256k1.PrivateKey, error)

func PrivateKeyToPem

func PrivateKeyToPem(priv *secp256k1.PrivateKey) ([]byte, error)

func PublicKeyToPem

func PublicKeyToPem(pub *secp256k1.PublicKey) ([]byte, error)

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func GeneratePrivateKey added in v1.4.2

func GeneratePrivateKey() (PrivateKey, error)

func NewPrivateKeyFromPem

func NewPrivateKeyFromPem(content []byte) (PrivateKey, error)

func (PrivateKey) PublicKeyBytes

func (v PrivateKey) PublicKeyBytes() []byte

func (PrivateKey) Sign

func (v PrivateKey) Sign(mes []byte) ([]byte, error)

func (PrivateKey) ToPem added in v1.4.3

func (v PrivateKey) ToPem() ([]byte, error)

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(data []byte) (PublicKey, error)

func (PublicKey) Bytes

func (v PublicKey) Bytes() []byte

func (PublicKey) VerifySignature

func (v PublicKey) VerifySignature(msg []byte, sigStr []byte) bool

VerifySignature verifies a signature of the form R || S. It rejects signatures which are not in lower-S form.

Jump to

Keyboard shortcuts

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