crypto

package
v0.0.0-...-5d5b006 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ED25519Sign

func ED25519Sign(p ed25519.PrivateKey, data []byte) (string, error)

func ED25519SignFile

func ED25519SignFile(p ed25519.PrivateKey, path string) (string, error)

Sign reads the input file and compute the ED25519 signature using the private key.

func ED25519Verify

func ED25519Verify(signature string, p ed25519.PublicKey, data []byte) (bool, error)

Verify checks that input signature is valid. That is, if input file was signed by private key corresponding to input public key.

func ED25519VerifyFile

func ED25519VerifyFile(signature string, p ed25519.PublicKey, file string) (bool, error)

func GenerateED25519Key

func GenerateED25519Key(private string, public string)

func GenerateIdentity

func GenerateIdentity() (string, string)

func GetED25519PrivateKey

func GetED25519PrivateKey(privateKey string) (ed25519.PrivateKey, error)

GetPrivateKey reads the private key from input file and returns the initialized PrivateKey.

func GetED25519PublicKey

func GetED25519PublicKey(publicKey string) (ed25519.PublicKey, error)

GetPublicKey reads the public key from input file and returns the initialized PublicKey.

func GetIdentity

func GetIdentity(pubkey string) peer.ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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