secgen

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

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

func Base64Bytes(length int) string

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

func DKIM

func DKIM() (string, string, error)

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

func HexBytes added in v1.3.0

func HexBytes(length int) string

HexBytes generates secure bytes with the given length and returns it as a hex string

func Keypair

func Keypair() (string, string, error)

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

func Passphrase added in v1.4.0

func Passphrase(sharedSecret, salt string) string

Passphrase generates secure passphrase, based on shared secret and salt

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