sprawl: github.com/sprawl/sprawl/identity Index | Files

package identity

import "github.com/sprawl/sprawl/identity"


Package Files


func GenerateKeyPair Uses

func GenerateKeyPair(reader io.Reader) (crypto.PrivKey, crypto.PubKey, error)

GenerateKeyPair generates a private and a public key

func GetIdentity Uses

func GetIdentity(storage interfaces.Storage) (crypto.PrivKey, crypto.PubKey, error)

GetIdentity returns the created private and public key from storage

func NewKeyPair Uses

func NewKeyPair(storage interfaces.Storage, reader io.Reader) (crypto.PrivKey, crypto.PubKey, error)

NewKeyPair generates a private and a public key to use with libp2p peer and stores it

func Sign Uses

func Sign(storage interfaces.Storage, data []byte) (signature []byte, err error)

Sign returns a signature for given data with this node's identity

func Verify Uses

func Verify(publicKey crypto.PubKey, data []byte, signature []byte) (success bool, err error)

Verify verifies data and its signature with a public key

Package identity imports 5 packages (graph) and is imported by 4 packages. Updated 2020-02-20. Refresh now. Tools for package owners.