crypto

package
v0.0.0-...-f0d3103 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilKeyGenerator = errors.New("nil key generator")

ErrNilKeyGenerator signals that a nil key generator was provided

View Source
var ErrNilPrivateKey = errors.New("nil private key")

ErrNilPrivateKey signals that a nil private key was provided

View Source
var ErrNilPublicKey = errors.New("nil public key")

ErrNilPublicKey signals that a nil public key was provided

View Source
var ErrNilSingleSigner = errors.New("nil single signer")

ErrNilSingleSigner signals that a nil single signer was provided

Functions

func ConvertPeerIDToPublicKey

func ConvertPeerIDToPublicKey(keyGen crypto.KeyGenerator, pid core.PeerID) (crypto.PublicKey, error)

ConvertPeerIDToPublicKey will convert core peer id to common public key

func ConvertPrivateKeyToLibp2pPrivateKey

func ConvertPrivateKeyToLibp2pPrivateKey(privateKey crypto.PrivateKey) (libp2pCrypto.PrivKey, error)

ConvertPrivateKeyToLibp2pPrivateKey will convert common private key to libp2p private key

func ConvertPublicKeyToPeerID

func ConvertPublicKeyToPeerID(pk crypto.PublicKey) (core.PeerID, error)

ConvertPublicKeyToPeerID will convert a public key to core.PeerID

func NewIdentityGenerator

func NewIdentityGenerator() *identityGenerator

NewIdentityGenerator creates a new identity generator

func NewP2PSignerWrapper

func NewP2PSignerWrapper(args ArgsP2pSignerWrapper) (*p2pSignerWrapper, error)

NewP2PSignerWrapper creates a new p2pSigner instance

Types

type ArgsP2pSignerWrapper

type ArgsP2pSignerWrapper struct {
	PrivateKey crypto.PrivateKey
	Signer     crypto.SingleSigner
	KeyGen     crypto.KeyGenerator
}

ArgsP2pSignerWrapper defines the arguments needed to create a p2p signer wrapper

Jump to

Keyboard shortcuts

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