ecdsa

package
v1.0.5007 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNamedCurve

func AddNamedCurve(curve elliptic.Curve, oid asn1.ObjectIdentifier)

func DSign added in v1.0.4009

func DSign(priv *ecdsa.PrivateKey, csprng io.Reader, hash []byte, hashFunc Hasher) (r, s *big.Int, err error)

func DSignASN1 added in v1.0.4009

func DSignASN1(priv *ecdsa.PrivateKey, csprng io.Reader, data []byte, hashFunc Hasher) ([]byte, error)

func DSignBytes added in v1.0.4009

func DSignBytes(priv *ecdsa.PrivateKey, csprng io.Reader, data []byte, hashFunc Hasher) ([]byte, error)

func MarshalECPrivateKey

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

MarshalECPrivateKey converts an EC private key to SEC 1, ASN.1 DER form.

This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". For a more flexible key format which is not EC specific, use MarshalPKCS8PrivateKey.

func MarshalPrivateKey

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

Marshal PrivateKey to der

func MarshalPublicKey

func MarshalPublicKey(pub *ecdsa.PublicKey) ([]byte, error)

Marshal PublicKey to der

func NamedCurveFromOid

func NamedCurveFromOid(oid asn1.ObjectIdentifier) elliptic.Curve

func OidFromNamedCurve

func OidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool)

func ParseECPrivateKey

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

ParseECPrivateKey parses an EC private key in SEC 1, ASN.1 DER form.

This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY".

func ParsePrivateKey

func ParsePrivateKey(derBytes []byte) (*ecdsa.PrivateKey, error)

Parse PrivateKey der

func ParsePublicKey

func ParsePublicKey(derBytes []byte) (pub *ecdsa.PublicKey, err error)

Parse PublicKey der

Types

type Hasher added in v1.0.4009

type Hasher = func() hash.Hash

Jump to

Keyboard shortcuts

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