interop

package module
v0.0.0-...-57c3e09 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCSSM2

type CCSSM2 struct {
	PrivateKey *ccs.PrivateKey
	PublicKey  *ccs.PublicKey
}

func CCSImportKey

func CCSImportKey(privPEM []byte, pubPEM []byte) (*CCSSM2, error)

func NewCCSSM2

func NewCCSSM2() (*CCSSM2, error)

func (*CCSSM2) Decrypt

func (instance *CCSSM2) Decrypt(encrypted []byte) ([]byte, error)

func (*CCSSM2) Encrypt

func (instance *CCSSM2) Encrypt(msg []byte) ([]byte, error)

func (*CCSSM2) ExportKey

func (instance *CCSSM2) ExportKey() (privPEM []byte, pubPEM []byte, err error)

func (*CCSSM2) Sign

func (instance *CCSSM2) Sign(msg []byte) ([]byte, error)

func (*CCSSM2) Verify

func (instance *CCSSM2) Verify(msg []byte, sign []byte) bool

type PKUSM2

type PKUSM2 struct {
	PrivateKey *pku.PrivateKey
	PublicKey  *pku.PublicKey
}

func NewPKUSM2

func NewPKUSM2() (*PKUSM2, error)

func PKUImport

func PKUImport(privPEM []byte, pubPEM []byte) (*PKUSM2, error)

func (*PKUSM2) Decrypt

func (instance *PKUSM2) Decrypt(encrypted []byte) ([]byte, error)

func (*PKUSM2) Encrypt

func (instance *PKUSM2) Encrypt(msg []byte) ([]byte, error)

func (*PKUSM2) ExportKey

func (instance *PKUSM2) ExportKey() (privPEM []byte, pubPEM []byte, err error)

func (*PKUSM2) Sign

func (instance *PKUSM2) Sign(msg []byte) ([]byte, error)

func (*PKUSM2) Verify

func (instance *PKUSM2) Verify(msg []byte, sign []byte) bool

type SM2

type SM2 interface {
	Encrypt(msg []byte) ([]byte, error)
	Decrypt(encrypted []byte) ([]byte, error)
	Sign(msg []byte) ([]byte, error)
	Verify(msg []byte, sign []byte) bool
	ExportKey() (privPEM []byte, pubPEM []byte, err error)
}

type TJSM2

type TJSM2 struct {
	PrivateKey *tj.PrivateKey
	PublicKey  *tj.PublicKey
}

func NewTJSM2

func NewTJSM2() (*TJSM2, error)

func TJImportKey

func TJImportKey(privPEM []byte, pubPEM []byte) (*TJSM2, error)

func (*TJSM2) Decrypt

func (instance *TJSM2) Decrypt(encrypted []byte) ([]byte, error)

func (*TJSM2) Encrypt

func (instance *TJSM2) Encrypt(msg []byte) ([]byte, error)

func (*TJSM2) ExportKey

func (instance *TJSM2) ExportKey() (privPEM []byte, pubPEM []byte, err error)

func (*TJSM2) Sign

func (instance *TJSM2) Sign(msg []byte) ([]byte, error)

func (*TJSM2) Verify

func (instance *TJSM2) Verify(msg []byte, sign []byte) bool

Jump to

Keyboard shortcuts

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