v4x

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyLength is the requested encryption key size.
	KeyLength = 32
)
View Source
const (
	LocalPrefix = "v4x.local."
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key *LocalKey, input string, f, i []byte) ([]byte, error)

PASETO v4 symmetric decryption primitive

func Encrypt

func Encrypt(r io.Reader, key *LocalKey, m, f, i []byte) (string, error)

PASETO v4 symmetric encryption primitive.

Types

type LocalKey

type LocalKey [32]byte

LocalKey represents a key for symetric encryption (local).

func GenerateLocalKey

func GenerateLocalKey(r io.Reader) (*LocalKey, error)

GenerateLocalKey generates a key for local encryption.

func LocalKeyFromSeed

func LocalKeyFromSeed(seed []byte) (*LocalKey, error)

LocalKeyFromSeed creates a local key from given input data.

Jump to

Keyboard shortcuts

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