v3

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LocalPrefix  = "v3.local."
	PublicPrefix = "v3.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, token string, f, i []byte) ([]byte, error)

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

func Sign

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

Sign a message (m) with the private key (sk). PASETO v3 public signature primitive. https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version3.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.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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