keys

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyTypeEd25519Ripemd160         KeyType = "ed25519,ripemd160"
	KeyTypeEd25519Ripemd160sha256           = "ed25519,ripemd160sha256"
	KeyTypeEd25519Ripemd160sha3             = "ed25519,sha3"
	KeyTypeSecp256k1Ripemd160               = "secp256k1,ripemd160"
	KeyTypeSecp256k1Ripemd160sha256         = "secp256k1,ripemd160sha256"
	KeyTypeSecp256k1Ripemd160sha3           = "secp256k1,sha3"
	KeyTypeDefault                          = KeyTypeEd25519Ripemd160
)

Variables

This section is empty.

Functions

func Addressable added in v0.18.0

func Addressable(keyClient KeyClient, address acm.Address) (acm.Addressable, error)

func NewKeyClient added in v0.18.0

func NewKeyClient(rpcAddress string, logger *logging.Logger) *keyClient

keyClient.New returns a new monax-keys client for provided rpc location Monax-keys connects over http request-responses

func Signer added in v0.18.0

func Signer(keyClient KeyClient, address acm.Address) acm.Signer

Creates a Signer that assumes the address holds an Ed25519 key

Types

type HTTPResponse

type HTTPResponse struct {
	Response string
	Error    string
}

type KeyClient

type KeyClient interface {
	// Sign returns the signature bytes for given message signed with the key associated with signAddress
	Sign(signAddress acm.Address, message []byte) (signature acm.Signature, err error)

	// PublicKey returns the public key associated with a given address
	PublicKey(address acm.Address) (publicKey acm.PublicKey, err error)

	// Generate requests that a key be generate within the keys instance and returns the address
	Generate(keyName string, keyType KeyType) (keyAddress acm.Address, err error)

	// Returns nil if the keys instance is healthy, error otherwise
	HealthCheck() error
}

type KeyType added in v0.18.0

type KeyType string

This mirrors "github.com/monax/keys/crypto/KeyType" but since we have no use for the struct here it seems simpler to replicate rather than cop an import

func (KeyType) String added in v0.18.0

func (kt KeyType) String() string

type KeysConfig added in v0.18.0

type KeysConfig struct {
	URL string
}

func DefaultKeysConfig added in v0.18.0

func DefaultKeysConfig() *KeysConfig

type Requester added in v0.18.0

type Requester func(method string, args map[string]string) (response string, err error)

func DefaultRequester added in v0.18.0

func DefaultRequester(rpcAddress string, logger *logging.Logger) Requester

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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