ed25519

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalPrivateKey

func MarshalPrivateKey(key PrivateKey) ([]byte, error)

MarshalPrivateKey returns the base64 encoded private key.

func MarshalPublicKey

func MarshalPublicKey(key PublicKey) ([]byte, error)

MarshalPublicKey returns the base64 encoded public key.

func Sign

func Sign(key PrivateKey, data []byte) ([]byte, error)

Sign signs the data with the private key.

func Verify

func Verify(key PublicKey, data, sig []byte) bool

Verify verifies the signature of the data with the public key.

Types

type PrivateKey

type PrivateKey = ed25519.PrivateKey

func NewPrivateKey

func NewPrivateKey() (PrivateKey, error)

NewPrivateKey returns a new private key.

func UnmarshalPrivateKey

func UnmarshalPrivateKey(b []byte) (PrivateKey, error)

UnmarshalPrivateKey returns a private key from a base64 encoded key.

type PublicKey

type PublicKey = ed25519.PublicKey

func Public

func Public(key PrivateKey) PublicKey

Public extracts the public key from a private key.

func UnmarshalPublicKey

func UnmarshalPublicKey(b []byte) (PublicKey, error)

UnmarshalPublicKey returns a public key from a base64 encoded key.

Jump to

Keyboard shortcuts

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