gen

package
v0.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
	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

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 added in v0.5.6

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

Jump to

Keyboard shortcuts

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