ecdsa

package
v0.0.0-...-2db71d7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalECPrivateKey

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

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key interface{}) (der []byte, err error)

func MarshalPrivateKey

func MarshalPrivateKey(key *sm2.PrivateKey, oid asn1.ObjectIdentifier) ([]byte, error)

func New

func New(keyType crypto.KeyType) (crypto.PrivateKey, error)

func ParsePKCS8PrivateKey

func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error)

Types

type PrivateKey

type PrivateKey struct {
	K crypto2.PrivateKey
}

func (*PrivateKey) Bytes

func (sk *PrivateKey) Bytes() ([]byte, error)

func (*PrivateKey) PublicKey

func (sk *PrivateKey) PublicKey() crypto.PublicKey

func (*PrivateKey) Sign

func (sk *PrivateKey) Sign(digest []byte) ([]byte, error)

func (*PrivateKey) SignWithOpts

func (sk *PrivateKey) SignWithOpts(msg []byte, opts *crypto.SignOpts) ([]byte, error)

func (*PrivateKey) String

func (sk *PrivateKey) String() (string, error)

func (*PrivateKey) ToStandardKey

func (sk *PrivateKey) ToStandardKey() crypto2.PrivateKey

func (*PrivateKey) Type

func (sk *PrivateKey) Type() crypto.KeyType

type PublicKey

type PublicKey struct {
	K crypto2.PublicKey
}

func (*PublicKey) Bytes

func (pk *PublicKey) Bytes() ([]byte, error)

func (*PublicKey) String

func (pk *PublicKey) String() (string, error)

func (*PublicKey) ToStandardKey

func (pk *PublicKey) ToStandardKey() crypto2.PublicKey

func (*PublicKey) Type

func (pk *PublicKey) Type() crypto.KeyType

func (*PublicKey) Verify

func (pk *PublicKey) Verify(digest []byte, sig []byte) (bool, error)

func (*PublicKey) VerifyWithOpts

func (pk *PublicKey) VerifyWithOpts(msg []byte, sig []byte, opts *crypto.SignOpts) (bool, error)

type Sig

type Sig struct {
	R *big.Int `json:"r"`
	S *big.Int `json:"s"`
}

Jump to

Keyboard shortcuts

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