Documentation ¶
Index ¶
- func AddNamedCurve(curve elliptic.Curve, oid asn1.ObjectIdentifier)
- func DSign(priv *ecdsa.PrivateKey, csprng io.Reader, hash []byte, hashFunc Hasher) (r, s *big.Int, err error)
- func DSignASN1(priv *ecdsa.PrivateKey, csprng io.Reader, data []byte, hashFunc Hasher) ([]byte, error)
- func DSignBytes(priv *ecdsa.PrivateKey, csprng io.Reader, data []byte, hashFunc Hasher) ([]byte, error)
- func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)
- func MarshalPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)
- func MarshalPublicKey(pub *ecdsa.PublicKey) ([]byte, error)
- func NamedCurveFromOid(oid asn1.ObjectIdentifier) elliptic.Curve
- func OidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool)
- func ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)
- func ParsePrivateKey(derBytes []byte) (*ecdsa.PrivateKey, error)
- func ParsePublicKey(derBytes []byte) (pub *ecdsa.PublicKey, err error)
- type Hasher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNamedCurve ¶
func AddNamedCurve(curve elliptic.Curve, oid asn1.ObjectIdentifier)
func DSignBytes ¶ added in v1.0.4009
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 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".
Types ¶
Click to show internal directories.
Click to hide internal directories.