ecdsa

package
v1.0.2080 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 8 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 MarshalECPrivateKey added in v1.0.2034

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)

包装私钥

func MarshalPublicKey

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

包装公钥

func NamedCurveFromOid

func NamedCurveFromOid(oid asn1.ObjectIdentifier) elliptic.Curve

func OidFromNamedCurve

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

func ParseECPrivateKey added in v1.0.2034

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)

解析私钥

func ParsePublicKey

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

解析公钥

Types

This section is empty.

Jump to

Keyboard shortcuts

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