secgen

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: LGPL-3.0 Imports: 10 Imported by: 2

README

secgen

Secrets generator, supported types:

  • Passwords
  • Random bytes
  • ED25519 SSH keypairs

Simple go environment variables reader, for env-based configs

// password
securePassword := secgen.Password(64)
// base64-encode random bytes (openssl rand -base64 replacement)
randomBytes := secgen.Base64Bytes(64)

// ssh key
publicSSHkey, privateSSHkey, err := secgen.Keypair()

Documentation

Index

Constants

View Source
const RSABits = 3072

RSABits used for DKIM keypair

Variables

This section is empty.

Functions

func Base64Bytes added in v1.2.0

func Base64Bytes(length int) string

Base64Bytes generates secure bytes with the given length and returns it as a base64 string

func DKIM added in v1.1.0

func DKIM() (string, string, error)

DKIM generates DKIM signature and private key (TXT record, private key)

func Keypair

func Keypair() (string, string, error)

Keypair generates ed25519 keypair for ssh (public key, private key)

func Password

func Password(length int) string

Password generates secure password

Types

This section is empty.

Jump to

Keyboard shortcuts

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