Documentation ¶
Index ¶
- Variables
- func NewEd25519PrivateKey(cfg *Config) (ed25519.PrivateKey, error)
- func NewEd25519PublicKey(cfg *Config) (ed25519.PublicKey, error)
- func NewRSAPrivateKey(cfg *Config) (*rsa.PrivateKey, error)
- func NewRSAPublicKey(cfg *Config) (*rsa.PublicKey, error)
- type Config
- type Ed25519
- type Generator
- type Pair
- type RSA
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidKind = errors.New("invalid kind")
ErrInvalidKind for key.
View Source
var Module = fx.Options( fx.Provide(NewRSA), fx.Provide(NewEd25519), fx.Provide(NewGenerator), fx.Provide(NewRSAPrivateKey), fx.Provide(NewRSAPublicKey), fx.Provide(NewEd25519PrivateKey), fx.Provide(NewEd25519PublicKey), )
Module for fx.
Functions ¶
func NewEd25519PrivateKey ¶ added in v1.22.0
func NewEd25519PrivateKey(cfg *Config) (ed25519.PrivateKey, error)
NewEd25519PrivateKey from key.
func NewEd25519PublicKey ¶ added in v1.22.0
NewEd25519PublicKey from key.
func NewRSAPrivateKey ¶ added in v1.22.0
func NewRSAPrivateKey(cfg *Config) (*rsa.PrivateKey, error)
NewRSAPrivateKey from key.
Types ¶
type Config ¶ added in v1.22.0
type Config struct { RSA *Pair `yaml:"rsa,omitempty" json:"rsa,omitempty" toml:"rsa,omitempty"` Ed25519 *Pair `yaml:"ed25519,omitempty" json:"ed25519,omitempty" toml:"ed25519,omitempty"` }
Config for key.
type Ed25519 ¶ added in v1.10.3
type Ed25519 struct {
// contains filtered or unexported fields
}
Ed25519 for key.
func NewEd25519 ¶ added in v1.10.3
func NewEd25519(publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey) *Ed25519
NewEd25519 for key.
func (*Ed25519) PrivateKey ¶ added in v1.105.0
func (e *Ed25519) PrivateKey() ed25519.PrivateKey
PrivateKey for Ed25519.
type Generator ¶ added in v1.10.3
type Generator struct {
// contains filtered or unexported fields
}
Generator of key pairs.
func NewGenerator ¶ added in v1.10.3
NewGenerator of key pairs.
type Pair ¶ added in v1.22.0
type Pair struct { Public string `yaml:"public,omitempty" json:"public,omitempty" toml:"public,omitempty"` Private string `yaml:"private,omitempty" json:"private,omitempty" toml:"private,omitempty"` }
Pair for key.
func (Pair) GetPrivate ¶ added in v1.45.0
GetPrivate from config or env.
type RSA ¶ added in v1.10.3
type RSA struct {
// contains filtered or unexported fields
}
RSA cipher.
func NewRSA ¶ added in v1.10.3
func NewRSA(publicKey *rsa.PublicKey, privateKey *rsa.PrivateKey) *RSA
NewRSA cipher.
Click to show internal directories.
Click to hide internal directories.