gosm

package
v0.0.0-...-dc235c6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoSm2

type GoSm2 struct{}

func (*GoSm2) Decrypt

func (gs *GoSm2) Decrypt(k *primitive.Sm2PrivateKey, ciphertext []byte, opts crypto.DecrypterOpts) ([]byte, error)

func (*GoSm2) Encrypt

func (gs *GoSm2) Encrypt(k *primitive.Sm2PublicKey, plaintext []byte) ([]byte, error)

func (*GoSm2) Sign

func (gs *GoSm2) Sign(k *primitive.Sm2PrivateKey, msg []byte, opts crypto.SignerOpts) ([]byte, error)

func (*GoSm2) Sm2P256Curve

func (gs *GoSm2) Sm2P256Curve() elliptic.Curve

func (*GoSm2) Verify

func (gs *GoSm2) Verify(k *primitive.Sm2PublicKey, sig, msg []byte, opts crypto.SignerOpts) (bool, error)

type GoSm3

type GoSm3 struct{}

func (*GoSm3) NewSm3

func (gs *GoSm3) NewSm3() hash.Hash

type GoSm4

type GoSm4 struct{}

func (*GoSm4) NewSm4Cipher

func (gs *GoSm4) NewSm4Cipher(key []byte) (cipher.Block, error)

type KeysDerive

type KeysDerive struct{}

func (*KeysDerive) GenPrivateKey

func (kd *KeysDerive) GenPrivateKey() (*primitive.Sm2PrivateKey, error)

func (*KeysDerive) MarshalSm2PrivateKey

func (kd *KeysDerive) MarshalSm2PrivateKey(k *primitive.Sm2PrivateKey, pwd []byte) ([]byte, error)

func (*KeysDerive) MarshalSm2PublicKey

func (kd *KeysDerive) MarshalSm2PublicKey(k *primitive.Sm2PublicKey) ([]byte, error)

func (*KeysDerive) ParsePKCS8PrivateKey

func (kd *KeysDerive) ParsePKCS8PrivateKey(der, pwd []byte) (*primitive.Sm2PrivateKey, error)

func (*KeysDerive) ParsePKCS8UnecryptedPrivateKey

func (kd *KeysDerive) ParsePKCS8UnecryptedPrivateKey(der []byte) (*primitive.Sm2PrivateKey, error)

func (*KeysDerive) ParseSm2PublicKey

func (kd *KeysDerive) ParseSm2PublicKey(der []byte) (*primitive.Sm2PublicKey, error)

func (*KeysDerive) PublicKey

Jump to

Keyboard shortcuts

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