ec

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: LGPL-3.0 Imports: 8 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructPrivateKey

func ConstructPrivateKey(data []byte, curve elliptic.Curve) *ecdsa.PrivateKey

func DecodePublicKey

func DecodePublicKey(data []byte, curve elliptic.Curve) (*ecdsa.PublicKey, error)

func EncodePublicKey

func EncodePublicKey(key *ecdsa.PublicKey, compressed bool) []byte

func GenerateECKeyPair

func GenerateECKeyPair(c elliptic.Curve, rand io.Reader, alg ECAlgorithm) (*PrivateKey, *PublicKey, error)

Types

type ECAlgorithm

type ECAlgorithm byte
const (
	ECDSA ECAlgorithm = iota
	SM2
)

type EthereumPrivateKey added in v1.1.0

type EthereumPrivateKey struct {
	*ecdsa.PrivateKey
}

type EthereumPublicKey added in v1.1.0

type EthereumPublicKey struct {
	*ecdsa.PublicKey
}

type PrivateKey

type PrivateKey struct {
	Algorithm ECAlgorithm
	*ecdsa.PrivateKey
}

func (*PrivateKey) Public

func (this *PrivateKey) Public() crypto.PublicKey

type PublicKey

type PublicKey struct {
	Algorithm ECAlgorithm
	*ecdsa.PublicKey
}

Jump to

Keyboard shortcuts

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