krab

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 9 Imported by: 0

README

krab

krab is used to implement a valid semi-secure ipfs keystore (ie, adhere's to the Keystore interface) that is a vast improvement over the current IPFS key management options, which rely on storing the private keys in plaintext on disk, or in memory. While suitable for casual usage, this is incredibly sub-optimal for anyone wishin to run an IPFS service. krab isn't intended to be a "total security solution", but is intended to make it much more difficult for an attacker to compromise your keys.

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