ed25519

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckKey

func CheckKey(k key.Key) error

CheckKey checks whether the given key is a valid Ed25519 key.

Reference https://datatracker.ietf.org/doc/html/rfc9053#name-edwards-curve-digital-signa Reference https://datatracker.ietf.org/doc/html/rfc9053#name-octet-key-pair

func GenerateKey

func GenerateKey() (key.Key, error)

GenerateKey generates a new key for Ed25519.

func KeyFromPrivate

func KeyFromPrivate(pk ed25519.PrivateKey) (key.Key, error)

KeyFromPrivate returns a private Key with given ed25519.PrivateKey.

func KeyFromPublic

func KeyFromPublic(pk ed25519.PublicKey) (key.Key, error)

KeyFromPublic returns a public Key with given ed25519.PublicKey.

func KeyFromSeed added in v0.4.1

func KeyFromSeed(seed []byte) (key.Key, error)

KeyFromSeed returns a private Key with given ed25519.PrivateKey seed.

func KeyToPrivate added in v0.5.0

func KeyToPrivate(k key.Key) (ed25519.PrivateKey, error)

KeyToPrivate returns the private key from the given key.

func KeyToPublic added in v0.5.0

func KeyToPublic(k key.Key) (ed25519.PublicKey, error)

KeyToPublic returns the public key from the given key.

func NewSigner

func NewSigner(k key.Key) (key.Signer, error)

NewSigner creates a key.Signer for the given private key.

func NewVerifier

func NewVerifier(k key.Key) (key.Verifier, error)

NewVerifier creates a key.Verifier for the given public key.

func ToPublicKey

func ToPublicKey(k key.Key) (key.Key, error)

ToPublicKey converts the given private key to a public key. If the key is already a public key, it is returned as-is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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