Documentation

Index

Constants

View Source
const (
	DefaultHost     = "localhost"
	DefaultPort     = "10997"
	DefaultHashType = "sha256"
	DefaultKeysDir  = ".keys"
	TestPort        = "0"
)
View Source
const (
	CryptoNone    = "none"
	CryptoAESGCM  = "scrypt-aes-gcm"
	HashEd25519   = "go-crypto-0.5.0"
	HashSecp256k1 = "btc"
)

Variables

This section is empty.

Functions

func RegisterKeysServer

func RegisterKeysServer(s *grpc.Server, srv KeysServer)

func StandAloneServer

func StandAloneServer(keysDir string, AllowBadFilePermissions bool) *grpc.Server

func WriteKeyFile

func WriteKeyFile(addr []byte, dataDirPath string, content []byte) (err error)

Types

type AddNameRequest

type AddNameRequest struct {
	Keyname              string   `protobuf:"bytes,1,opt,name=Keyname,proto3" json:"Keyname,omitempty"`
	Address              string   `protobuf:"bytes,2,opt,name=Address,proto3" json:"Address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddNameRequest) Descriptor

func (*AddNameRequest) Descriptor() ([]byte, []int)

func (*AddNameRequest) GetAddress

func (m *AddNameRequest) GetAddress() string

func (*AddNameRequest) GetKeyname

func (m *AddNameRequest) GetKeyname() string

func (*AddNameRequest) ProtoMessage

func (*AddNameRequest) ProtoMessage()

func (*AddNameRequest) Reset

func (m *AddNameRequest) Reset()

func (*AddNameRequest) Size

func (m *AddNameRequest) Size() (n int)

func (*AddNameRequest) String

func (m *AddNameRequest) String() string

func (*AddNameRequest) XXX_DiscardUnknown

func (m *AddNameRequest) XXX_DiscardUnknown()

func (*AddNameRequest) XXX_Marshal

func (m *AddNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddNameRequest) XXX_Merge

func (m *AddNameRequest) XXX_Merge(src proto.Message)

func (*AddNameRequest) XXX_MessageName

func (*AddNameRequest) XXX_MessageName() string

func (*AddNameRequest) XXX_Size

func (m *AddNameRequest) XXX_Size() int

func (*AddNameRequest) XXX_Unmarshal

func (m *AddNameRequest) XXX_Unmarshal(b []byte) error

type AddNameResponse

type AddNameResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddNameResponse) Descriptor

func (*AddNameResponse) Descriptor() ([]byte, []int)

func (*AddNameResponse) ProtoMessage

func (*AddNameResponse) ProtoMessage()

func (*AddNameResponse) Reset

func (m *AddNameResponse) Reset()

func (*AddNameResponse) Size

func (m *AddNameResponse) Size() (n int)

func (*AddNameResponse) String

func (m *AddNameResponse) String() string

func (*AddNameResponse) XXX_DiscardUnknown

func (m *AddNameResponse) XXX_DiscardUnknown()

func (*AddNameResponse) XXX_Marshal

func (m *AddNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddNameResponse) XXX_Merge

func (m *AddNameResponse) XXX_Merge(src proto.Message)

func (*AddNameResponse) XXX_MessageName

func (*AddNameResponse) XXX_MessageName() string

func (*AddNameResponse) XXX_Size

func (m *AddNameResponse) XXX_Size() int

func (*AddNameResponse) XXX_Unmarshal

func (m *AddNameResponse) XXX_Unmarshal(b []byte) error

type ExportRequest

type ExportRequest struct {
	Passphrase           string   `protobuf:"bytes,1,opt,name=Passphrase,proto3" json:"Passphrase,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	Address              string   `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ExportRequest) Descriptor

func (*ExportRequest) Descriptor() ([]byte, []int)

func (*ExportRequest) GetAddress

func (m *ExportRequest) GetAddress() string

func (*ExportRequest) GetName

func (m *ExportRequest) GetName() string

func (*ExportRequest) GetPassphrase

func (m *ExportRequest) GetPassphrase() string

func (*ExportRequest) ProtoMessage

func (*ExportRequest) ProtoMessage()

func (*ExportRequest) Reset

func (m *ExportRequest) Reset()

func (*ExportRequest) Size

func (m *ExportRequest) Size() (n int)

func (*ExportRequest) String

func (m *ExportRequest) String() string

func (*ExportRequest) XXX_DiscardUnknown

func (m *ExportRequest) XXX_DiscardUnknown()

func (*ExportRequest) XXX_Marshal

func (m *ExportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExportRequest) XXX_Merge

func (m *ExportRequest) XXX_Merge(src proto.Message)

func (*ExportRequest) XXX_MessageName

func (*ExportRequest) XXX_MessageName() string

func (*ExportRequest) XXX_Size

func (m *ExportRequest) XXX_Size() int

func (*ExportRequest) XXX_Unmarshal

func (m *ExportRequest) XXX_Unmarshal(b []byte) error

type ExportResponse

type ExportResponse struct {
	Publickey            []byte   `protobuf:"bytes,1,opt,name=Publickey,proto3" json:"Publickey,omitempty"`
	Privatekey           []byte   `protobuf:"bytes,2,opt,name=Privatekey,proto3" json:"Privatekey,omitempty"`
	Address              []byte   `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"`
	CurveType            string   `protobuf:"bytes,4,opt,name=CurveType,proto3" json:"CurveType,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ExportResponse) Descriptor

func (*ExportResponse) Descriptor() ([]byte, []int)

func (*ExportResponse) GetAddress

func (m *ExportResponse) GetAddress() []byte

func (*ExportResponse) GetCurveType

func (m *ExportResponse) GetCurveType() string

func (*ExportResponse) GetPrivatekey

func (m *ExportResponse) GetPrivatekey() []byte

func (*ExportResponse) GetPublickey

func (m *ExportResponse) GetPublickey() []byte

func (*ExportResponse) ProtoMessage

func (*ExportResponse) ProtoMessage()

func (*ExportResponse) Reset

func (m *ExportResponse) Reset()

func (*ExportResponse) Size

func (m *ExportResponse) Size() (n int)

func (*ExportResponse) String

func (m *ExportResponse) String() string

func (*ExportResponse) XXX_DiscardUnknown

func (m *ExportResponse) XXX_DiscardUnknown()

func (*ExportResponse) XXX_Marshal

func (m *ExportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExportResponse) XXX_Merge

func (m *ExportResponse) XXX_Merge(src proto.Message)

func (*ExportResponse) XXX_MessageName

func (*ExportResponse) XXX_MessageName() string

func (*ExportResponse) XXX_Size

func (m *ExportResponse) XXX_Size() int

func (*ExportResponse) XXX_Unmarshal

func (m *ExportResponse) XXX_Unmarshal(b []byte) error

type FilesystemKeyStore

type FilesystemKeyStore struct {
	sync.Mutex
	AllowBadFilePermissions bool
	// contains filtered or unexported fields
}

func NewFilesystemKeyStore

func NewFilesystemKeyStore(dir string, AllowBadFilePermissions bool) *FilesystemKeyStore

func (*FilesystemKeyStore) AddName

func (*FilesystemKeyStore) AllKeys

func (ks *FilesystemKeyStore) AllKeys() ([]*Key, error)

func (*FilesystemKeyStore) DeleteKey

func (ks *FilesystemKeyStore) DeleteKey(passphrase string, keyAddr []byte) (err error)

func (*FilesystemKeyStore) Export

func (*FilesystemKeyStore) Gen

func (ks *FilesystemKeyStore) Gen(passphrase string, curveType crypto.CurveType) (key *Key, err error)

func (*FilesystemKeyStore) GenerateKey

func (k *FilesystemKeyStore) GenerateKey(ctx context.Context, in *GenRequest) (*GenResponse, error)

func (*FilesystemKeyStore) GetAddressForKeyName

func (ks *FilesystemKeyStore) GetAddressForKeyName(name string) (crypto.Address, error)

func (*FilesystemKeyStore) GetAllAddresses

func (ks *FilesystemKeyStore) GetAllAddresses() (addresses []string, err error)

func (*FilesystemKeyStore) GetAllNames

func (ks *FilesystemKeyStore) GetAllNames() (map[string]string, error)

func (*FilesystemKeyStore) GetKey

func (ks *FilesystemKeyStore) GetKey(passphrase string, keyAddr []byte) (*Key, error)

func (*FilesystemKeyStore) GetKeyFile

func (ks *FilesystemKeyStore) GetKeyFile(dataDirPath string, keyAddr []byte) (fileContent []byte, err error)

func (*FilesystemKeyStore) Hash

func (*FilesystemKeyStore) Import

func (*FilesystemKeyStore) ImportJSON

func (*FilesystemKeyStore) List

func (*FilesystemKeyStore) PublicKey

func (k *FilesystemKeyStore) PublicKey(ctx context.Context, in *PubRequest) (*PubResponse, error)

func (*FilesystemKeyStore) RemoveName

func (*FilesystemKeyStore) Sign

func (*FilesystemKeyStore) StoreKey

func (ks *FilesystemKeyStore) StoreKey(passphrase string, key *Key) error

func (*FilesystemKeyStore) StoreKeyEncrypted

func (ks *FilesystemKeyStore) StoreKeyEncrypted(passphrase string, key *Key) error

func (*FilesystemKeyStore) StoreKeyPlain

func (ks *FilesystemKeyStore) StoreKeyPlain(key *Key) (err error)

func (*FilesystemKeyStore) Verify

type GenRequest

type GenRequest struct {
	Passphrase           string   `protobuf:"bytes,1,opt,name=Passphrase,proto3" json:"Passphrase,omitempty"`
	CurveType            string   `protobuf:"bytes,2,opt,name=CurveType,proto3" json:"CurveType,omitempty"`
	KeyName              string   `protobuf:"bytes,3,opt,name=KeyName,proto3" json:"KeyName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GenRequest) Descriptor

func (*GenRequest) Descriptor() ([]byte, []int)

func (*GenRequest) GetCurveType

func (m *GenRequest) GetCurveType() string

func (*GenRequest) GetKeyName

func (m *GenRequest) GetKeyName() string

func (*GenRequest) GetPassphrase

func (m *GenRequest) GetPassphrase() string

func (*GenRequest) ProtoMessage

func (*GenRequest) ProtoMessage()

func (*GenRequest) Reset

func (m *GenRequest) Reset()

func (*GenRequest) Size

func (m *GenRequest) Size() (n int)

func (*GenRequest) String

func (m *GenRequest) String() string

func (*GenRequest) XXX_DiscardUnknown

func (m *GenRequest) XXX_DiscardUnknown()

func (*GenRequest) XXX_Marshal

func (m *GenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenRequest) XXX_Merge

func (m *GenRequest) XXX_Merge(src proto.Message)

func (*GenRequest) XXX_MessageName

func (*GenRequest) XXX_MessageName() string

func (*GenRequest) XXX_Size

func (m *GenRequest) XXX_Size() int

func (*GenRequest) XXX_Unmarshal

func (m *GenRequest) XXX_Unmarshal(b []byte) error

type GenResponse

type GenResponse struct {
	Address              string   `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GenResponse) Descriptor

func (*GenResponse) Descriptor() ([]byte, []int)

func (*GenResponse) GetAddress

func (m *GenResponse) GetAddress() string

func (*GenResponse) ProtoMessage

func (*GenResponse) ProtoMessage()

func (*GenResponse) Reset

func (m *GenResponse) Reset()

func (*GenResponse) Size

func (m *GenResponse) Size() (n int)

func (*GenResponse) String

func (m *GenResponse) String() string

func (*GenResponse) XXX_DiscardUnknown

func (m *GenResponse) XXX_DiscardUnknown()

func (*GenResponse) XXX_Marshal

func (m *GenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenResponse) XXX_Merge

func (m *GenResponse) XXX_Merge(src proto.Message)

func (*GenResponse) XXX_MessageName

func (*GenResponse) XXX_MessageName() string

func (*GenResponse) XXX_Size

func (m *GenResponse) XXX_Size() int

func (*GenResponse) XXX_Unmarshal

func (m *GenResponse) XXX_Unmarshal(b []byte) error

type HashRequest

type HashRequest struct {
	Hashtype             string   `protobuf:"bytes,1,opt,name=Hashtype,proto3" json:"Hashtype,omitempty"`
	Message              []byte   `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashRequest) Descriptor

func (*HashRequest) Descriptor() ([]byte, []int)

func (*HashRequest) GetHashtype

func (m *HashRequest) GetHashtype() string

func (*HashRequest) GetMessage

func (m *HashRequest) GetMessage() []byte

func (*HashRequest) ProtoMessage

func (*HashRequest) ProtoMessage()

func (*HashRequest) Reset

func (m *HashRequest) Reset()

func (*HashRequest) Size

func (m *HashRequest) Size() (n int)

func (*HashRequest) String

func (m *HashRequest) String() string

func (*HashRequest) XXX_DiscardUnknown

func (m *HashRequest) XXX_DiscardUnknown()

func (*HashRequest) XXX_Marshal

func (m *HashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HashRequest) XXX_Merge

func (m *HashRequest) XXX_Merge(src proto.Message)

func (*HashRequest) XXX_MessageName

func (*HashRequest) XXX_MessageName() string

func (*HashRequest) XXX_Size

func (m *HashRequest) XXX_Size() int

func (*HashRequest) XXX_Unmarshal

func (m *HashRequest) XXX_Unmarshal(b []byte) error

type HashResponse

type HashResponse struct {
	Hash                 string   `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashResponse) Descriptor

func (*HashResponse) Descriptor() ([]byte, []int)

func (*HashResponse) GetHash

func (m *HashResponse) GetHash() string

func (*HashResponse) ProtoMessage

func (*HashResponse) ProtoMessage()

func (*HashResponse) Reset

func (m *HashResponse) Reset()

func (*HashResponse) Size

func (m *HashResponse) Size() (n int)

func (*HashResponse) String

func (m *HashResponse) String() string

func (*HashResponse) XXX_DiscardUnknown

func (m *HashResponse) XXX_DiscardUnknown()

func (*HashResponse) XXX_Marshal

func (m *HashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HashResponse) XXX_Merge

func (m *HashResponse) XXX_Merge(src proto.Message)

func (*HashResponse) XXX_MessageName

func (*HashResponse) XXX_MessageName() string

func (*HashResponse) XXX_Size

func (m *HashResponse) XXX_Size() int

func (*HashResponse) XXX_Unmarshal

func (m *HashResponse) XXX_Unmarshal(b []byte) error

type ImportJSONRequest

type ImportJSONRequest struct {
	Passphrase           string   `protobuf:"bytes,1,opt,name=Passphrase,proto3" json:"Passphrase,omitempty"`
	JSON                 string   `protobuf:"bytes,2,opt,name=JSON,proto3" json:"JSON,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ImportJSONRequest) Descriptor

func (*ImportJSONRequest) Descriptor() ([]byte, []int)

func (*ImportJSONRequest) GetJSON

func (m *ImportJSONRequest) GetJSON() string

func (*ImportJSONRequest) GetPassphrase

func (m *ImportJSONRequest) GetPassphrase() string

func (*ImportJSONRequest) ProtoMessage

func (*ImportJSONRequest) ProtoMessage()

func (*ImportJSONRequest) Reset

func (m *ImportJSONRequest) Reset()

func (*ImportJSONRequest) Size

func (m *ImportJSONRequest) Size() (n int)

func (*ImportJSONRequest) String

func (m *ImportJSONRequest) String() string

func (*ImportJSONRequest) XXX_DiscardUnknown

func (m *ImportJSONRequest) XXX_DiscardUnknown()

func (*ImportJSONRequest) XXX_Marshal

func (m *ImportJSONRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ImportJSONRequest) XXX_Merge

func (m *ImportJSONRequest) XXX_Merge(src proto.Message)

func (*ImportJSONRequest) XXX_MessageName

func (*ImportJSONRequest) XXX_MessageName() string

func (*ImportJSONRequest) XXX_Size

func (m *ImportJSONRequest) XXX_Size() int

func (*ImportJSONRequest) XXX_Unmarshal

func (m *ImportJSONRequest) XXX_Unmarshal(b []byte) error

type ImportRequest

type ImportRequest struct {
	Passphrase           string   `protobuf:"bytes,1,opt,name=Passphrase,proto3" json:"Passphrase,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	CurveType            string   `protobuf:"bytes,3,opt,name=CurveType,proto3" json:"CurveType,omitempty"`
	KeyBytes             []byte   `protobuf:"bytes,4,opt,name=KeyBytes,proto3" json:"KeyBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ImportRequest) Descriptor

func (*ImportRequest) Descriptor() ([]byte, []int)

func (*ImportRequest) GetCurveType

func (m *ImportRequest) GetCurveType() string

func (*ImportRequest) GetKeyBytes

func (m *ImportRequest) GetKeyBytes() []byte

func (*ImportRequest) GetName

func (m *ImportRequest) GetName() string

func (*ImportRequest) GetPassphrase

func (m *ImportRequest) GetPassphrase() string

func (*ImportRequest) ProtoMessage

func (*ImportRequest) ProtoMessage()

func (*ImportRequest) Reset

func (m *ImportRequest) Reset()

func (*ImportRequest) Size

func (m *ImportRequest) Size() (n int)

func (*ImportRequest) String

func (m *ImportRequest) String() string

func (*ImportRequest) XXX_DiscardUnknown

func (m *ImportRequest) XXX_DiscardUnknown()

func (*ImportRequest) XXX_Marshal

func (m *ImportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ImportRequest) XXX_Merge

func (m *ImportRequest) XXX_Merge(src proto.Message)

func (*ImportRequest) XXX_MessageName

func (*ImportRequest) XXX_MessageName() string

func (*ImportRequest) XXX_Size

func (m *ImportRequest) XXX_Size() int

func (*ImportRequest) XXX_Unmarshal

func (m *ImportRequest) XXX_Unmarshal(b []byte) error

type ImportResponse

type ImportResponse struct {
	Address              string   `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ImportResponse) Descriptor

func (*ImportResponse) Descriptor() ([]byte, []int)

func (*ImportResponse) GetAddress

func (m *ImportResponse) GetAddress() string

func (*ImportResponse) ProtoMessage

func (*ImportResponse) ProtoMessage()

func (*ImportResponse) Reset

func (m *ImportResponse) Reset()

func (*ImportResponse) Size

func (m *ImportResponse) Size() (n int)

func (*ImportResponse) String

func (m *ImportResponse) String() string

func (*ImportResponse) XXX_DiscardUnknown

func (m *ImportResponse) XXX_DiscardUnknown()

func (*ImportResponse) XXX_Marshal

func (m *ImportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ImportResponse) XXX_Merge

func (m *ImportResponse) XXX_Merge(src proto.Message)

func (*ImportResponse) XXX_MessageName

func (*ImportResponse) XXX_MessageName() string

func (*ImportResponse) XXX_Size

func (m *ImportResponse) XXX_Size() int

func (*ImportResponse) XXX_Unmarshal

func (m *ImportResponse) XXX_Unmarshal(b []byte) error

type Key

type Key struct {
	CurveType  crypto.CurveType
	Address    crypto.Address
	PublicKey  crypto.PublicKey
	PrivateKey crypto.PrivateKey
}

func DecryptKey

func DecryptKey(passphrase string, keyProtected *keyJSON) (*Key, error)

func NewKey

func NewKey(typ crypto.CurveType) (*Key, error)

func NewKeyFromPriv

func NewKeyFromPriv(curveType crypto.CurveType, PrivKeyBytes []byte) (*Key, error)

func NewKeyFromPub

func NewKeyFromPub(curveType crypto.CurveType, PubKeyBytes []byte) (*Key, error)

func (*Key) MarshalJSON

func (k *Key) MarshalJSON() (j []byte, err error)

func (*Key) Pubkey

func (k *Key) Pubkey() []byte

func (*Key) UnmarshalJSON

func (k *Key) UnmarshalJSON(j []byte) (err error)

type KeyClient

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

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

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

	// Get the address for a keyname or the adress itself
	GetAddressForKeyName(keyName string) (keyAddress crypto.Address, err error)

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

func NewLocalKeyClient

func NewLocalKeyClient(ks KeyStore, logger *logging.Logger) KeyClient

    NewLocalKeyClient returns a new keys client, backed by the local filesystem

    func NewRemoteKeyClient

    func NewRemoteKeyClient(rpcAddress string, logger *logging.Logger) (KeyClient, error)

      NewRemoteKeyClient returns a new keys client for provided rpc location

      type KeyID

      type KeyID struct {
      	Address              string   `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
      	KeyName              []string `protobuf:"bytes,2,rep,name=KeyName,proto3" json:"KeyName,omitempty"`
      	XXX_NoUnkeyedLiteral struct{} `json:"-"`
      	XXX_unrecognized     []byte   `json:"-"`
      	XXX_sizecache        int32    `json:"-"`
      }

      func (*KeyID) Descriptor

      func (*KeyID) Descriptor() ([]byte, []int)

      func (*KeyID) GetAddress

      func (m *KeyID) GetAddress() string

      func (*KeyID) GetKeyName

      func (m *KeyID) GetKeyName() []string

      func (*KeyID) ProtoMessage

      func (*KeyID) ProtoMessage()

      func (*KeyID) Reset

      func (m *KeyID) Reset()

      func (*KeyID) Size

      func (m *KeyID) Size() (n int)

      func (*KeyID) String

      func (m *KeyID) String() string

      func (*KeyID) XXX_DiscardUnknown

      func (m *KeyID) XXX_DiscardUnknown()

      func (*KeyID) XXX_Marshal

      func (m *KeyID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

      func (*KeyID) XXX_Merge

      func (m *KeyID) XXX_Merge(src proto.Message)

      func (*KeyID) XXX_MessageName

      func (*KeyID) XXX_MessageName() string

      func (*KeyID) XXX_Size

      func (m *KeyID) XXX_Size() int

      func (*KeyID) XXX_Unmarshal

      func (m *KeyID) XXX_Unmarshal(b []byte) error

      type KeyStore

      type KeyStore interface {
      	GetAddressForKeyName(keyName string) (keyAddress crypto.Address, err error)
      	GenerateKey(ctx context.Context, in *GenRequest) (*GenResponse, error)
      	PublicKey(ctx context.Context, in *PubRequest) (*PubResponse, error)
      	Sign(ctx context.Context, in *SignRequest) (*SignResponse, error)
      }

      type KeysClient

      type KeysClient interface {
      	GenerateKey(ctx context.Context, in *GenRequest, opts ...grpc.CallOption) (*GenResponse, error)
      	PublicKey(ctx context.Context, in *PubRequest, opts ...grpc.CallOption) (*PubResponse, error)
      	Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error)
      	Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error)
      	Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error)
      	ImportJSON(ctx context.Context, in *ImportJSONRequest, opts ...grpc.CallOption) (*ImportResponse, error)
      	Export(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportResponse, error)
      	Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error)
      	RemoveName(ctx context.Context, in *RemoveNameRequest, opts ...grpc.CallOption) (*RemoveNameResponse, error)
      	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
      	AddName(ctx context.Context, in *AddNameRequest, opts ...grpc.CallOption) (*AddNameResponse, error)
      }

        KeysClient is the client API for Keys service.

        For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

        func NewKeysClient

        func NewKeysClient(cc *grpc.ClientConn) KeysClient

        type KeysConfig

        type KeysConfig struct {
        	GRPCServiceEnabled      bool
        	AllowBadFilePermissions bool
        	RemoteAddress           string
        	KeysDirectory           string
        }

        func DefaultKeysConfig

        func DefaultKeysConfig() *KeysConfig

        type ListRequest

        type ListRequest struct {
        	KeyName              string   `protobuf:"bytes,1,opt,name=KeyName,proto3" json:"KeyName,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*ListRequest) Descriptor

        func (*ListRequest) Descriptor() ([]byte, []int)

        func (*ListRequest) GetKeyName

        func (m *ListRequest) GetKeyName() string

        func (*ListRequest) ProtoMessage

        func (*ListRequest) ProtoMessage()

        func (*ListRequest) Reset

        func (m *ListRequest) Reset()

        func (*ListRequest) Size

        func (m *ListRequest) Size() (n int)

        func (*ListRequest) String

        func (m *ListRequest) String() string

        func (*ListRequest) XXX_DiscardUnknown

        func (m *ListRequest) XXX_DiscardUnknown()

        func (*ListRequest) XXX_Marshal

        func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*ListRequest) XXX_Merge

        func (m *ListRequest) XXX_Merge(src proto.Message)

        func (*ListRequest) XXX_MessageName

        func (*ListRequest) XXX_MessageName() string

        func (*ListRequest) XXX_Size

        func (m *ListRequest) XXX_Size() int

        func (*ListRequest) XXX_Unmarshal

        func (m *ListRequest) XXX_Unmarshal(b []byte) error

        type ListResponse

        type ListResponse struct {
        	Key                  []*KeyID `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*ListResponse) Descriptor

        func (*ListResponse) Descriptor() ([]byte, []int)

        func (*ListResponse) GetKey

        func (m *ListResponse) GetKey() []*KeyID

        func (*ListResponse) ProtoMessage

        func (*ListResponse) ProtoMessage()

        func (*ListResponse) Reset

        func (m *ListResponse) Reset()

        func (*ListResponse) Size

        func (m *ListResponse) Size() (n int)

        func (*ListResponse) String

        func (m *ListResponse) String() string

        func (*ListResponse) XXX_DiscardUnknown

        func (m *ListResponse) XXX_DiscardUnknown()

        func (*ListResponse) XXX_Marshal

        func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*ListResponse) XXX_Merge

        func (m *ListResponse) XXX_Merge(src proto.Message)

        func (*ListResponse) XXX_MessageName

        func (*ListResponse) XXX_MessageName() string

        func (*ListResponse) XXX_Size

        func (m *ListResponse) XXX_Size() int

        func (*ListResponse) XXX_Unmarshal

        func (m *ListResponse) XXX_Unmarshal(b []byte) error

        type MemoryKeyStore

        type MemoryKeyStore struct {
        	// contains filtered or unexported fields
        }

        func NewMemoryKeyStore

        func NewMemoryKeyStore(privateAccounts ...*acm.PrivateAccount) *MemoryKeyStore

        func (*MemoryKeyStore) GenerateKey

        func (mks *MemoryKeyStore) GenerateKey(ctx context.Context, in *GenRequest) (*GenResponse, error)

        func (*MemoryKeyStore) GetAddressForKeyName

        func (mks *MemoryKeyStore) GetAddressForKeyName(keyName string) (crypto.Address, error)

        func (*MemoryKeyStore) PublicKey

        func (mks *MemoryKeyStore) PublicKey(ctx context.Context, in *PubRequest) (*PubResponse, error)

        func (*MemoryKeyStore) Sign

        func (mks *MemoryKeyStore) Sign(ctx context.Context, in *SignRequest) (*SignResponse, error)

        type PubRequest

        type PubRequest struct {
        	Address              string   `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
        	Name                 string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*PubRequest) Descriptor

        func (*PubRequest) Descriptor() ([]byte, []int)

        func (*PubRequest) GetAddress

        func (m *PubRequest) GetAddress() string

        func (*PubRequest) GetName

        func (m *PubRequest) GetName() string

        func (*PubRequest) ProtoMessage

        func (*PubRequest) ProtoMessage()

        func (*PubRequest) Reset

        func (m *PubRequest) Reset()

        func (*PubRequest) Size

        func (m *PubRequest) Size() (n int)

        func (*PubRequest) String

        func (m *PubRequest) String() string

        func (*PubRequest) XXX_DiscardUnknown

        func (m *PubRequest) XXX_DiscardUnknown()

        func (*PubRequest) XXX_Marshal

        func (m *PubRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*PubRequest) XXX_Merge

        func (m *PubRequest) XXX_Merge(src proto.Message)

        func (*PubRequest) XXX_MessageName

        func (*PubRequest) XXX_MessageName() string

        func (*PubRequest) XXX_Size

        func (m *PubRequest) XXX_Size() int

        func (*PubRequest) XXX_Unmarshal

        func (m *PubRequest) XXX_Unmarshal(b []byte) error

        type PubResponse

        type PubResponse struct {
        	PublicKey            []byte   `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"`
        	CurveType            string   `protobuf:"bytes,2,opt,name=CurveType,proto3" json:"CurveType,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*PubResponse) Descriptor

        func (*PubResponse) Descriptor() ([]byte, []int)

        func (*PubResponse) GetCurveType

        func (m *PubResponse) GetCurveType() string

        func (*PubResponse) GetPublicKey

        func (m *PubResponse) GetPublicKey() []byte

        func (*PubResponse) ProtoMessage

        func (*PubResponse) ProtoMessage()

        func (*PubResponse) Reset

        func (m *PubResponse) Reset()

        func (*PubResponse) Size

        func (m *PubResponse) Size() (n int)

        func (*PubResponse) String

        func (m *PubResponse) String() string

        func (*PubResponse) XXX_DiscardUnknown

        func (m *PubResponse) XXX_DiscardUnknown()

        func (*PubResponse) XXX_Marshal

        func (m *PubResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*PubResponse) XXX_Merge

        func (m *PubResponse) XXX_Merge(src proto.Message)

        func (*PubResponse) XXX_MessageName

        func (*PubResponse) XXX_MessageName() string

        func (*PubResponse) XXX_Size

        func (m *PubResponse) XXX_Size() int

        func (*PubResponse) XXX_Unmarshal

        func (m *PubResponse) XXX_Unmarshal(b []byte) error

        type RemoveNameRequest

        type RemoveNameRequest struct {
        	KeyName              string   `protobuf:"bytes,1,opt,name=KeyName,proto3" json:"KeyName,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*RemoveNameRequest) Descriptor

        func (*RemoveNameRequest) Descriptor() ([]byte, []int)

        func (*RemoveNameRequest) GetKeyName

        func (m *RemoveNameRequest) GetKeyName() string

        func (*RemoveNameRequest) ProtoMessage

        func (*RemoveNameRequest) ProtoMessage()

        func (*RemoveNameRequest) Reset

        func (m *RemoveNameRequest) Reset()

        func (*RemoveNameRequest) Size

        func (m *RemoveNameRequest) Size() (n int)

        func (*RemoveNameRequest) String

        func (m *RemoveNameRequest) String() string

        func (*RemoveNameRequest) XXX_DiscardUnknown

        func (m *RemoveNameRequest) XXX_DiscardUnknown()

        func (*RemoveNameRequest) XXX_Marshal

        func (m *RemoveNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*RemoveNameRequest) XXX_Merge

        func (m *RemoveNameRequest) XXX_Merge(src proto.Message)

        func (*RemoveNameRequest) XXX_MessageName

        func (*RemoveNameRequest) XXX_MessageName() string

        func (*RemoveNameRequest) XXX_Size

        func (m *RemoveNameRequest) XXX_Size() int

        func (*RemoveNameRequest) XXX_Unmarshal

        func (m *RemoveNameRequest) XXX_Unmarshal(b []byte) error

        type RemoveNameResponse

        type RemoveNameResponse struct {
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*RemoveNameResponse) Descriptor

        func (*RemoveNameResponse) Descriptor() ([]byte, []int)

        func (*RemoveNameResponse) ProtoMessage

        func (*RemoveNameResponse) ProtoMessage()

        func (*RemoveNameResponse) Reset

        func (m *RemoveNameResponse) Reset()

        func (*RemoveNameResponse) Size

        func (m *RemoveNameResponse) Size() (n int)

        func (*RemoveNameResponse) String

        func (m *RemoveNameResponse) String() string

        func (*RemoveNameResponse) XXX_DiscardUnknown

        func (m *RemoveNameResponse) XXX_DiscardUnknown()

        func (*RemoveNameResponse) XXX_Marshal

        func (m *RemoveNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*RemoveNameResponse) XXX_Merge

        func (m *RemoveNameResponse) XXX_Merge(src proto.Message)

        func (*RemoveNameResponse) XXX_MessageName

        func (*RemoveNameResponse) XXX_MessageName() string

        func (*RemoveNameResponse) XXX_Size

        func (m *RemoveNameResponse) XXX_Size() int

        func (*RemoveNameResponse) XXX_Unmarshal

        func (m *RemoveNameResponse) XXX_Unmarshal(b []byte) error

        type SignRequest

        type SignRequest struct {
        	Passphrase           string   `protobuf:"bytes,1,opt,name=Passphrase,proto3" json:"Passphrase,omitempty"`
        	Address              string   `protobuf:"bytes,2,opt,name=Address,proto3" json:"Address,omitempty"`
        	Name                 string   `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
        	Message              []byte   `protobuf:"bytes,4,opt,name=Message,proto3" json:"Message,omitempty"`
        	XXX_NoUnkeyedLiteral struct{} `json:"-"`
        	XXX_unrecognized     []byte   `json:"-"`
        	XXX_sizecache        int32    `json:"-"`
        }

        func (*SignRequest) Descriptor

        func (*SignRequest) Descriptor() ([]byte, []int)

        func (*SignRequest) GetAddress

        func (m *SignRequest) GetAddress() string

        func (*SignRequest) GetMessage

        func (m *SignRequest) GetMessage() []byte

        func (*SignRequest) GetName

        func (m *SignRequest) GetName() string

        func (*SignRequest) GetPassphrase

        func (m *SignRequest) GetPassphrase() string

        func (*SignRequest) ProtoMessage

        func (*SignRequest) ProtoMessage()

        func (*SignRequest) Reset

        func (m *SignRequest) Reset()

        func (*SignRequest) Size

        func (m *SignRequest) Size() (n int)

        func (*SignRequest) String

        func (m *SignRequest) String() string

        func (*SignRequest) XXX_DiscardUnknown

        func (m *SignRequest) XXX_DiscardUnknown()

        func (*SignRequest) XXX_Marshal

        func (m *SignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*SignRequest) XXX_Merge

        func (m *SignRequest) XXX_Merge(src proto.Message)

        func (*SignRequest) XXX_MessageName

        func (*SignRequest) XXX_MessageName() string

        func (*SignRequest) XXX_Size

        func (m *SignRequest) XXX_Size() int

        func (*SignRequest) XXX_Unmarshal

        func (m *SignRequest) XXX_Unmarshal(b []byte) error

        type SignResponse

        type SignResponse struct {
        	Signature            *crypto.Signature `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"`
        	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
        	XXX_unrecognized     []byte            `json:"-"`
        	XXX_sizecache        int32             `json:"-"`
        }

        func (*SignResponse) Descriptor

        func (*SignResponse) Descriptor() ([]byte, []int)

        func (*SignResponse) GetSignature

        func (m *SignResponse) GetSignature() *crypto.Signature

        func (*SignResponse) ProtoMessage

        func (*SignResponse) ProtoMessage()

        func (*SignResponse) Reset

        func (m *SignResponse) Reset()

        func (*SignResponse) Size

        func (m *SignResponse) Size() (n int)

        func (*SignResponse) String

        func (m *SignResponse) String() string

        func (*SignResponse) XXX_DiscardUnknown

        func (m *SignResponse) XXX_DiscardUnknown()

        func (*SignResponse) XXX_Marshal

        func (m *SignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

        func (*SignResponse) XXX_Merge

        func (m *SignResponse) XXX_Merge(src proto.Message)

        func (*SignResponse) XXX_MessageName

        func (*SignResponse) XXX_MessageName() string

        func (*SignResponse) XXX_Size

        func (m *SignResponse) XXX_Size() int

        func (*SignResponse) XXX_Unmarshal

        func (m *SignResponse) XXX_Unmarshal(b []byte) error

        type Signer

        type Signer struct {
        	// contains filtered or unexported fields
        }

        func AddressableSigner

        func AddressableSigner(keyClient KeyClient, address crypto.Address) (*Signer, error)

          AddressableSigner creates a signer that assumes the address holds an Ed25519 key

          func (*Signer) GetAddress

          func (ms *Signer) GetAddress() crypto.Address

          func (*Signer) GetPublicKey

          func (ms *Signer) GetPublicKey() crypto.PublicKey

          func (*Signer) Sign

          func (ms *Signer) Sign(message []byte) (*crypto.Signature, error)

          type UnimplementedKeysServer

          type UnimplementedKeysServer struct {
          }

            UnimplementedKeysServer can be embedded to have forward compatible implementations.

            func (*UnimplementedKeysServer) AddName

            func (*UnimplementedKeysServer) Export

            func (*UnimplementedKeysServer) GenerateKey

            func (*UnimplementedKeysServer) GenerateKey(ctx context.Context, req *GenRequest) (*GenResponse, error)

            func (*UnimplementedKeysServer) Hash

            func (*UnimplementedKeysServer) Import

            func (*UnimplementedKeysServer) ImportJSON

            func (*UnimplementedKeysServer) List

            func (*UnimplementedKeysServer) PublicKey

            func (*UnimplementedKeysServer) RemoveName

            func (*UnimplementedKeysServer) Sign

            func (*UnimplementedKeysServer) Verify

            type VerifyRequest

            type VerifyRequest struct {
            	PublicKey            []byte            `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"`
            	Message              []byte            `protobuf:"bytes,3,opt,name=Message,proto3" json:"Message,omitempty"`
            	Signature            *crypto.Signature `protobuf:"bytes,5,opt,name=Signature,proto3" json:"Signature,omitempty"`
            	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
            	XXX_unrecognized     []byte            `json:"-"`
            	XXX_sizecache        int32             `json:"-"`
            }

            func (*VerifyRequest) Descriptor

            func (*VerifyRequest) Descriptor() ([]byte, []int)

            func (*VerifyRequest) GetMessage

            func (m *VerifyRequest) GetMessage() []byte

            func (*VerifyRequest) GetPublicKey

            func (m *VerifyRequest) GetPublicKey() []byte

            func (*VerifyRequest) GetSignature

            func (m *VerifyRequest) GetSignature() *crypto.Signature

            func (*VerifyRequest) ProtoMessage

            func (*VerifyRequest) ProtoMessage()

            func (*VerifyRequest) Reset

            func (m *VerifyRequest) Reset()

            func (*VerifyRequest) Size

            func (m *VerifyRequest) Size() (n int)

            func (*VerifyRequest) String

            func (m *VerifyRequest) String() string

            func (*VerifyRequest) XXX_DiscardUnknown

            func (m *VerifyRequest) XXX_DiscardUnknown()

            func (*VerifyRequest) XXX_Marshal

            func (m *VerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

            func (*VerifyRequest) XXX_Merge

            func (m *VerifyRequest) XXX_Merge(src proto.Message)

            func (*VerifyRequest) XXX_MessageName

            func (*VerifyRequest) XXX_MessageName() string

            func (*VerifyRequest) XXX_Size

            func (m *VerifyRequest) XXX_Size() int

            func (*VerifyRequest) XXX_Unmarshal

            func (m *VerifyRequest) XXX_Unmarshal(b []byte) error

            type VerifyResponse

            type VerifyResponse struct {
            	XXX_NoUnkeyedLiteral struct{} `json:"-"`
            	XXX_unrecognized     []byte   `json:"-"`
            	XXX_sizecache        int32    `json:"-"`
            }

            func (*VerifyResponse) Descriptor

            func (*VerifyResponse) Descriptor() ([]byte, []int)

            func (*VerifyResponse) ProtoMessage

            func (*VerifyResponse) ProtoMessage()

            func (*VerifyResponse) Reset

            func (m *VerifyResponse) Reset()

            func (*VerifyResponse) Size

            func (m *VerifyResponse) Size() (n int)

            func (*VerifyResponse) String

            func (m *VerifyResponse) String() string

            func (*VerifyResponse) XXX_DiscardUnknown

            func (m *VerifyResponse) XXX_DiscardUnknown()

            func (*VerifyResponse) XXX_Marshal

            func (m *VerifyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

            func (*VerifyResponse) XXX_Merge

            func (m *VerifyResponse) XXX_Merge(src proto.Message)

            func (*VerifyResponse) XXX_MessageName

            func (*VerifyResponse) XXX_MessageName() string

            func (*VerifyResponse) XXX_Size

            func (m *VerifyResponse) XXX_Size() int

            func (*VerifyResponse) XXX_Unmarshal

            func (m *VerifyResponse) XXX_Unmarshal(b []byte) error

            Directories

            Path Synopsis