ed25519

package
v1.192.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 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() (PublicKey, PrivateKey, 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  PublicKey  `yaml:"public,omitempty" json:"public,omitempty" toml:"public,omitempty"`
	Private PrivateKey `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.

type PrivateKey added in v1.189.0

type PrivateKey string

PrivateKey for ed25519.

type PublicKey added in v1.189.0

type PublicKey string

PublicKey for ed25519.

Jump to

Keyboard shortcuts

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