identity

package
v0.0.0-...-967d326 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID peer.ID

ID is a generique alias for peer.ID compatible It is usefull to avoid a dependency hell

func StringToID

func StringToID(s string) ID

StringToID return an id with a string as input

func (*ID) Big

func (id *ID) Big() *big.Int

Big returns a big.Int representation of the ID

func (*ID) Pretty

func (id *ID) Pretty() string

Pretty returns a prettified version of the id

func (*ID) String

func (id *ID) String() string

String returns a prettified version of the id

type PrivKey

type PrivKey ecdsa.PrivateKey

PrivKey is a general purpose identity manager

It is coercable in ethereum identities It is coercable in protocol members identities It is also coercable in ethereum private key

func Generate

func Generate() *PrivKey

Generate returns a generated private key

func ReadPrivKey

func ReadPrivKey(pkPath string) (*PrivKey, error)

ReadPrivKey reads a private key from a file

func (*PrivKey) Eth

func (pk *PrivKey) Eth() *ecdsa.PrivateKey

Eth returns the private key casted to be of geth type

func (*PrivKey) ID

func (pk *PrivKey) ID() ID

ID returns the libp2p peer corresponding to the PrivKey

func (*PrivKey) Libp2p

func (pk *PrivKey) Libp2p() p2pcrypto.PrivKey

Libp2p returns the private key casted to be a p2pcrypto.PrivKey

func (*PrivKey) PeerID

func (pk *PrivKey) PeerID() peer.ID

PeerID returns the libp2p peer corresponding to the PrivKey

type PubKey

type PubKey ecdsa.PublicKey

PubKey is a project local alias for ecdsa.PublicKey It is used to have coercion

func UnmarshalPubKey

func UnmarshalPubKey(b []byte) (*PubKey, error)

UnmarshalPubKey attemps to unmarshal a public key

func (*PubKey) Eth

func (pub *PubKey) Eth() *ecdsa.PublicKey

Eth returns the public key casted as an ethereum public key

func (*PubKey) ID

func (pub *PubKey) ID() ID

ID returns the libp2p peer corresponding to the PubKey

func (*PubKey) Libp2p

func (pub *PubKey) Libp2p() p2pcrypto.PubKey

Libp2p returns the public key casted to be a p2pcrypto.PrivKey

func (*PubKey) PeerID

func (pub *PubKey) PeerID() peer.ID

PeerID returns the libp2p peer corresponding to the PubKey

Jump to

Keyboard shortcuts

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