crypter

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCrypter

func RegisterCrypter(name string, crypter ICrypter)

func UnRegisterCrypter

func UnRegisterCrypter(name string)

Types

type ICrypter

type ICrypter interface {
	Name() string
	GenerateKey() (IPrivateKey, IPublicKey, error)
	Sign(privateKey IPrivateKey, message []byte) ([]byte, error)
	Verify(publicKey IPublicKey, message, signature []byte) bool

	ToPublicKey(data []byte) IPublicKey
	ToPrivateKey(data []byte) IPrivateKey
}

func Crypter

func Crypter(name string) (ICrypter, error)

func MustCrypter

func MustCrypter(name string) ICrypter

type IPrivateKey

type IPrivateKey interface {
	Public() IPublicKey
	Bytes() []byte
}

IPrivateKey defines the interface of privatekey.

type IPublicKey

type IPublicKey interface {
	Bytes() []byte
}

IPublicKey defines the interface of publickey.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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