krab

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

README

krab

krab is a "semi secure" keystore that satisfies the IPFS keystore interface, allowing it to be used natively with many existing IPFS implementations, and tools. It stores keys on disk in a badger datastore, encrypting the keys before being stored in the datastore. Each time a key is fetched, it is decrypted first. A single password is used to encrypt all keys.

future improvements

  • Define groups of keys, with each group having a separate encryption password

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoSuchKey is returned if a key of the given name is not found in the store
	ErrNoSuchKey = "no key by the given name was found"
	// ErrKeyExists is returned when writing a key would overwrite an existing key
	ErrKeyExists = "key by that name already exists, refusing to overwrite"
	// ErrKeyFmt is returned when the key's format is invalid
	ErrKeyFmt = "key has invalid format"
)

Functions

This section is empty.

Types

type Krab

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

Krab is used to manage an encrypted IPFS keystore

func NewKrab

func NewKrab(opts Opts) (*Krab, error)

NewKrab is used to create a new krab ipfs keystore manager

func (*Krab) Close

func (km *Krab) Close() error

Close is used to close our badger connection

func (*Krab) Delete

func (km *Krab) Delete(name string) error

Delete is used to remove a key from our keystore

func (*Krab) Get

func (km *Krab) Get(name string) (ci.PrivKey, error)

Get is used to retrieve a key from our keystore

func (*Krab) Has

func (km *Krab) Has(name string) (bool, error)

Has is used to check whether or not the given key name exists

func (*Krab) List

func (km *Krab) List() ([]string, error)

List is used to list all key identifiers in our keystore

func (*Krab) Put

func (km *Krab) Put(name string, privKey ci.PrivKey) error

Put is used to store a key in our keystore

type Opts

type Opts struct {
	Passphrase string
	DSPath     string
	ReadOnly   bool
}

Opts is used to configure a Krab keystore

Jump to

Keyboard shortcuts

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