ecdsa

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Overview

Package ecdsa implements ECDSA signature, suitable for OpenPGP, as specified in RFC 6637, section 5.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)

func Validate

func Validate(priv *PrivateKey) error

func Verify

func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	D *big.Int
}

func GenerateKey

func GenerateKey(rand io.Reader, c ecc.ECDSACurve) (priv *PrivateKey, err error)

func NewPrivateKey

func NewPrivateKey(key PublicKey) *PrivateKey

func (*PrivateKey) MarshalIntegerSecret

func (sk *PrivateKey) MarshalIntegerSecret() []byte

func (*PrivateKey) UnmarshalIntegerSecret

func (sk *PrivateKey) UnmarshalIntegerSecret(d []byte) error

type PublicKey

type PublicKey struct {
	X, Y *big.Int
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(curve ecc.ECDSACurve) *PublicKey

func (*PublicKey) GetCurve

func (pk *PublicKey) GetCurve() ecc.ECDSACurve

func (*PublicKey) MarshalPoint

func (pk *PublicKey) MarshalPoint() []byte

func (*PublicKey) UnmarshalPoint

func (pk *PublicKey) UnmarshalPoint(p []byte) error

Jump to

Keyboard shortcuts

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