security

package
v0.0.0-...-d3aecbb Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptToken

func DecryptToken(ciphertext64 string, protectionkey [32]byte) (string, error)

func EncryptToken

func EncryptToken(token string, protectionkey [32]byte) (string, error)

func EnsureProtectionKey

func EnsureProtectionKey() ([32]byte, bool, error)

func FetchProtectionKey

func FetchProtectionKey() ([32]byte, error)

func FetchToken

func FetchToken(server, project string) (string, bool, error)

func GenerateProtectionKey

func GenerateProtectionKey() ([32]byte, error)

func KeyringIsAvailable

func KeyringIsAvailable() bool

func LoadCACerts

func LoadCACerts(certfilepem string) (*tls.Config, error)

func StoreProtectionKey

func StoreProtectionKey(key [32]byte) error

func StoreToken

func StoreToken(server, project, data string) error

func ValidateProtectionKeyArgon2

func ValidateProtectionKeyArgon2(password string, params *ProtectionKeyArgon2Params) ([32]byte, error)

Types

type ProtectionKeyArgon2Params

type ProtectionKeyArgon2Params struct {
	KeyLen       uint32
	Salt         []byte
	Time         uint32
	Memory       uint32
	Parallelism  uint8
	Digest       []byte
	DigestSalt   []byte
	DigestTime   uint32
	DigestMemory uint32
}

func GenerateProtectionKeyArgon2

func GenerateProtectionKeyArgon2(password string) ([32]byte, *ProtectionKeyArgon2Params, error)

Jump to

Keyboard shortcuts

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