...
Package ecdsa
import "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
- Overview
- Index
Package ecdsa implements ECDSA signature, suitable for OpenPGP,
as specified in RFC 6637, section 5.
func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)
func Validate(priv *PrivateKey) error
func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool
type PrivateKey struct {
PublicKey
D *big.Int
}
func GenerateKey(rand io.Reader, c ecc.ECDSACurve) (priv *PrivateKey, err error)
func NewPrivateKey(key PublicKey) *PrivateKey
func (sk *PrivateKey) MarshalIntegerSecret() []byte
func (sk *PrivateKey) UnmarshalIntegerSecret(d []byte) error
type PublicKey struct {
X, Y *big.Int
}
func NewPublicKey(curve ecc.ECDSACurve) *PublicKey
func (*PublicKey) GetCurve
¶
func (pk *PublicKey) GetCurve() ecc.ECDSACurve
func (pk *PublicKey) MarshalPoint() []byte
func (pk *PublicKey) UnmarshalPoint(p []byte) error