crypto

package
v0.2.2-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(msg []byte, sk ed25519.PrivateKey) ([]byte, error)

Decrypt decrypts msg with a cure25519 private key derived from an ed25519 private key

func Encrypt

func Encrypt(msg []byte, pk ed25519.PublicKey) ([]byte, error)

Encrypt encrypts msg with a cure25519 public key derived from an ed25519 public key

func KeyFromHex

func KeyFromHex(h string) (ed25519.PublicKey, error)

KeyFromHex extract the public key from a hex string (used with jsx keys)

func KeyFromID

func KeyFromID(id pkg.Identifier) (ed25519.PublicKey, error)

KeyFromID extract the public key from an Identifier

func Sign

func Sign(privateKey ed25519.PrivateKey, message []byte) ([]byte, error)

Sign signs the message with privateKey and returns a signature.

func Verify

func Verify(publicKey ed25519.PublicKey, message, sig []byte) error

Verify reports whether sig is a valid signature of message by publicKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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