Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrKeyAndIDMismatch = fmt.Errorf("public key does not match identifier")
ErrKeyAndIDMismatch occurs when a key identifier doesn't match it's public key
Functions ¶
func IDFromPrivKey ¶
IDFromPrivKey is a wrapper for calling IDFromPubKey on a private key
Types ¶
type Book ¶
type Book interface { // PubKey stores the public key for a key.ID PubKey(ID) ic.PubKey // AddPubKey stores the public for a key.ID AddPubKey(ID, ic.PubKey) error // PrivKey returns the private key for a key.ID, if known PrivKey(ID) ic.PrivKey // AddPrivKey stores the private key for a key.ID AddPrivKey(ID, ic.PrivKey) error // IDsWithKeys returns all the key IDs stored in the KeyBook IDsWithKeys() []ID }
Book defines the interface for keybook implementations which hold the key information
type CryptoGenerator ¶
type CryptoGenerator interface { // GeneratePrivateKeyAndPeerID returns a base64 encoded private key, and a // peerID GeneratePrivateKeyAndPeerID() (string, string) // GenerateNickname uses a peerID to return a human-friendly nickname // TODO(b5): This should be moved up into the profile pacakge GenerateNickname(peerID string) string // GenerateEmptyIpfsRepo creates an empty IPFS repo at a given path // TODO(b5): This shouldn't be part of the CryptoGenerator interface, should // be moved to github.com/qri-io/qfs/qipfs GenerateEmptyIpfsRepo(repoPath, cfgPath string) error }
CryptoGenerator is an interface for generating cryptographic info like private keys and peerIDs TODO(b5): I've moved this here because the key package should be the source of all cryptographic data, but this needs work. I'd like to see it reduced to just a `GeneratePrivateKey` function
type CryptoSource ¶
type CryptoSource struct { }
CryptoSource is a source of cryptographic info
func NewCryptoSource ¶
func NewCryptoSource() *CryptoSource
NewCryptoSource returns a source of p2p cryptographic info that performs expensive computations like repeated primality testing
func (*CryptoSource) GenerateEmptyIpfsRepo ¶
func (g *CryptoSource) GenerateEmptyIpfsRepo(repoPath, configPath string) error
GenerateEmptyIpfsRepo creates an empty IPFS repo in a secure manner at the given path
func (*CryptoSource) GenerateNickname ¶
func (g *CryptoSource) GenerateNickname(peerID string) string
GenerateNickname returns a nickname using a peerID as a seed
func (*CryptoSource) GeneratePrivateKeyAndPeerID ¶
func (g *CryptoSource) GeneratePrivateKeyAndPeerID() (privKey, peerID string)
GeneratePrivateKeyAndPeerID returns a private key and peerID
type ID ¶
ID is a key identifier note that while this implementation is an alias for a peer.ID, this is not strictly a peerID.
type Store ¶
type Store interface { Book }
Store is an abstraction over a KeyBook In the future we may expand this interface to store symmetric encryption keys
func NewLocalStore ¶
NewLocalStore constructs a local file backed key.Store