ed25519

package
v1.187.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(NewAlgo),
)

Module for fx.

Functions

func Generate

func Generate() (string, string, error)

Generate key pair with Ed25519.

func IsEnabled

func IsEnabled(cfg *Config) bool

IsEnabled for ed25519.

Types

type Algo

type Algo interface {
	// Generate an encoded msg.
	Generate(msg string) string

	// Compare encoded with msg.
	Compare(enc, msg string) error

	// PublicKey for Ed25519.
	PublicKey() ed25519.PublicKey

	// PrivateKey for Ed25519.
	PrivateKey() ed25519.PrivateKey
}

Algo for ed25519.

func NewAlgo

func NewAlgo(cfg *Config) (Algo, error)

NewAlgo for ed25519.

type Config

type Config struct {
	Public  string `yaml:"public,omitempty" json:"public,omitempty" toml:"public,omitempty"`
	Private string `yaml:"private,omitempty" json:"private,omitempty" toml:"private,omitempty"`
}

Config for ed25519.

func (Config) GetPrivate

func (c Config) GetPrivate() string

GetPrivate from config or env.

Jump to

Keyboard shortcuts

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