secp256k1

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate() (*ecdsa.PrivateKey, error)

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key *ecdsa.PrivateKey) ([]byte, error)

marshal only secp256k1 ecdsa key, use x509.MarshalPKCS8PrivateKey for others

func MarshalPKIXPublicKey

func MarshalPKIXPublicKey(key *ecdsa.PublicKey) ([]byte, error)

func ParsePKCS8PrivateKey

func ParsePKCS8PrivateKey(der []byte) (*ecdsa.PrivateKey, error)

func ParsePKIXPublicKey

func ParsePKIXPublicKey(der []byte) (*ecdsa.PublicKey, error)

Types

type Secp256k1Algorithm

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

func (*Secp256k1Algorithm) Generate

func (a *Secp256k1Algorithm) Generate() (algo.DerKeys, error)

func (*Secp256k1Algorithm) Name

func (a *Secp256k1Algorithm) Name() string

func (*Secp256k1Algorithm) Sign

func (a *Secp256k1Algorithm) Sign(privateKey []byte, data []byte) ([]byte, error)

func (*Secp256k1Algorithm) ValidateSignature

func (a *Secp256k1Algorithm) ValidateSignature(publicKey []byte, signature []byte, data []byte) error

Jump to

Keyboard shortcuts

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