crypto

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceNotMatch    = errors.New("signature source not match")
	ErrSigTypeNotSupport = errors.New("signature type not support")
	ErrGenerateKeyFail   = errors.New("generate key fail")
	ErrKeyTypeNotSupport = errors.New("key type not support")
	ErrSigPubKeyNotMatch = errors.New("count of signature and public key not match")
)

Functions

This section is empty.

Types

type Engine

type Engine interface {
	GenKey(params ...interface{}) (*PrivateKey, *PublicKey, error)
	Sign([]byte, PrivateKey) (*Signature, error)
	Verify([]byte, Signature) bool
}

type PrivateKey

type PrivateKey struct {
	Source  string      `json:"source"`
	SigType string      `json:"sigType"`
	PriKey  interface{} `json:"priKey"`
}

type PublicKey

type PublicKey struct {
	Source  string      `json:"source"`
	SigType string      `json:"sigType"`
	PubKey  interface{} `json:"pubKey"`
}

type Signature

type Signature struct {
	PublicKey
	Signature []byte `json:"signature"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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