You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
796 B

  1. package keys
  2. import (
  3. "sort"
  4. crypto "github.com/tendermint/go-crypto"
  5. data "github.com/tendermint/go-wire/data"
  6. )
  7. // Info is the public information about a key
  8. type Info struct {
  9. Name string `json:"name"`
  10. PubKey crypto.PubKey `json:"pubkey"`
  11. }
  12. // Keybase allows simple CRUD on a keystore, as an aid to signing
  13. type Keybase interface {
  14. // Sign some bytes
  15. Sign(name, passphrase string, msg []byte) (crypto.Signature, error)
  16. // Create a new keypair
  17. Create(name, passphrase, algo string) (_ Info, seedphrase string, _ error)
  18. // Recover takes a seedphrase and loads in the key
  19. Recover(name, passphrase, seedphrase string) (Info, error)
  20. List() (Infos, error)
  21. Get(name string) (Info, error)
  22. Update(name, oldpass, newpass string) error
  23. Delete(name, passphrase string) error
  24. }