crypto

package
v0.0.0-...-3c4ad8c Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySize = chacha20poly1305.KeySize

	// MaxPlaintextSize is set to 64 MB, which is a fairly generous limit. The implementation in x/crypto/xchacha20poly1305 has a plaintext limit to 256 GB.
	// We generally only handle data that is stored within a cookie or a session store, i.e. it should be reasonably small.
	// In most cases the data is around 4 KB or less, mostly depending on the length of the tokens returned from the identity provider.
	MaxPlaintextSize = 64 * 1024 * 1024
)

Variables

This section is empty.

Functions

func EncryptionKeyOrGenerate

func EncryptionKeyOrGenerate(cfg *config.Config) ([]byte, error)

func NewJwk

func NewJwk() (jwk.Key, error)

Types

type Crypter

type Crypter interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

func NewCrypter

func NewCrypter(key []byte) Crypter

type JwkSet

type JwkSet struct {
	Private jwk.Set
	Public  jwk.Set
}

func NewJwkSet

func NewJwkSet() (*JwkSet, error)

Jump to

Keyboard shortcuts

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