sm2c

package
v0.0.0-...-c9d2d86 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func P256

func P256() elliptic.Curve

Curve returns an instance of the sm2 curve

Types

type Crypter

type Crypter struct {
}

func (*Crypter) DoubleSha256

func (this *Crypter) DoubleSha256(data []byte) []byte

func (*Crypter) GenerateKey

func (this *Crypter) GenerateKey() (crypter.IPrivateKey, crypter.IPublicKey, error)

func (*Crypter) Name

func (this *Crypter) Name() string

func (*Crypter) Sign

func (this *Crypter) Sign(privateKey crypter.IPrivateKey, message []byte) ([]byte, error)

func (*Crypter) ToPrivateKey

func (this *Crypter) ToPrivateKey(data []byte) crypter.IPrivateKey

func (*Crypter) ToPublicKey

func (this *Crypter) ToPublicKey(data []byte) crypter.IPublicKey

func (*Crypter) Verify

func (this *Crypter) Verify(publicKey crypter.IPublicKey, message, sig []byte) bool

type PrivateKey

type PrivateKey ecdsa.PrivateKey

func (*PrivateKey) Bytes

func (priv *PrivateKey) Bytes() []byte

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypter.IPublicKey

type PublicKey

type PublicKey ecdsa.PublicKey

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() []byte

Jump to

Keyboard shortcuts

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