v4

package
v0.0.0-...-6748acc Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Decrypt

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

PASETO v4 symmetric decryption primitive https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md#decrypt

func Sign

func Sign(m []byte, sk ed25519.PrivateKey, f, i []byte) (string, error)

Sign a message (m) with the private key (sk). PASETO v4 public signature primitive. https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md#sign

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