Documentation
¶
Index ¶
- Variables
- func Decrypt(encryptor string, key Key, attrs map[string]string, reader io.Reader) error
- func Encrypt(encryptor string, key Key, attrs map[string]string, writer io.Writer) error
- func PublicKeyToAddress(driver string, pubkey []byte) (string, error)
- func Recover(driver string, sig []byte, hash []byte) ([]byte, error)
- func RegisterEncryptor(name string, f Encryptor)
- func RegisterProvider(provider Provider)
- func ValidAddress(driver string, address string) (bool, error)
- func Verify(driver string, pubkey []byte, sig []byte, hash []byte) (bool, error)
- type Encryptor
- type Key
- type Provider
- type RecoverableProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDriver = errors.New("unknown driver") ErrPublicKey = errors.New("invalid public key") )
Errors
Functions ¶
func PublicKeyToAddress ¶
PublicKeyToAddress .
func RegisterEncryptor ¶
RegisterEncryptor register key encrypto
Types ¶
type Encryptor ¶
type Encryptor interface {
Encrypt(key Key, attrs map[string]string, writer io.Writer) error
Decrypt(key Key, attrs map[string]string, reader io.Reader) error
}
Encryptor .
type Key ¶
type Key interface {
Address() string // address display string
PriKey() []byte // private key byte array
PubKey() []byte // public key byte array
SetBytes(priKey []byte) // set private key bytes
Sign(hashed []byte) ([]byte, error) // sign the hashed message
Provider() Provider // provider
}
Key blockchain key facade
Click to show internal directories.
Click to hide internal directories.