session

package
v0.0.0-...-560f09a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptServicePassword

func DecryptServicePassword(cipherText string, key []byte) (string, error)

DecryptServicePassword

	Decrypts the service password using AES256-GCM with
	the passed encryption key

	Args
      - cipherText (string) - base64 encoded encrypted payload
	  - key ([]byte) - encryption key

	Returns
	  string - decrypted string

func EncryptServicePassword

func EncryptServicePassword(password string, key []byte) (string, error)

EncryptServicePassword

Encrypts the service password using AES256-GCM with
the passed encryption key

Args
  password (string) - string to be encrypted
  key ([]byte) - encryption key

Returns
  string - base64 encoded encrypted string

func GenerateServicePassword

func GenerateServicePassword() (string, error)

GenerateServicePassword

Generates a 128 byte random secret using crypto/rand
and returns a base64 encoded string

Returns
  string - base64 encoded secret

Types

This section is empty.

Jump to

Keyboard shortcuts

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