package ecdsa

import "github.com/ProtonMail/go-crypto/openpgp/ecdsa"

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

Index

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

Source Files

ecdsa.go

Version
v1.3.0 (latest)
Published
May 22, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
2 days ago

Tools for package owners.