qri: github.com/qri-io/qri/repo/gen Index | Files

package gen

import "github.com/qri-io/qri/repo/gen"

Package gen contains routines that perform expensive cryptographic operations. These should only be used when absolutely needed by top-level commands, and not in, for example, in test code.

Index

Package Files

crypto_generator.go

type CryptoGenerator Uses

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
    GenerateNickname(peerID string) string
    // GenerateEmptyIpfsRepo creates an empty IPFS repo at a given path
    GenerateEmptyIpfsRepo(repoPath, cfgPath string) error
}

CryptoGenerator is an interface for generating cryptographic info like private keys and peerIDs

type CryptoSource Uses

type CryptoSource struct {
}

CryptoSource is a source of cryptographic info

func NewCryptoSource Uses

func NewCryptoSource() *CryptoSource

NewCryptoSource returns a source of p2p cryptographic info that performs expensive computations like repeated primality testing

func (*CryptoSource) GenerateEmptyIpfsRepo Uses

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 Uses

func (g *CryptoSource) GenerateNickname(peerID string) string

GenerateNickname returns a nickname using a peerID as a seed

func (*CryptoSource) GeneratePrivateKeyAndPeerID Uses

func (g *CryptoSource) GeneratePrivateKeyAndPeerID() (privKey, peerID string)

GeneratePrivateKeyAndPeerID returns a private key and peerID

Package gen imports 6 packages (graph) and is imported by 6 packages. Updated 2019-03-24. Refresh now. Tools for package owners.