cryptokey

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: EUPL-1.2 Imports: 4 Imported by: 0

Documentation

Overview

Package cryptokey provides shared utilities for resolving and decoding hex-encoded 32-byte cryptographic keys used by contrib apps (csrf, session).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(keyHex, keyType string) ([]byte, error)

Decode decodes a hex-encoded string and validates it is exactly 32 bytes. keyType is used in error messages (e.g. "csrf", "session block").

func Resolve

func Resolve(keyHex, keyType string) ([]byte, error)

Resolve returns a 32-byte key from keyHex. If keyHex is empty, a random key is generated and a warning is logged. keyType is used in log and error messages (e.g. "csrf", "session hash").

Types

This section is empty.

Jump to

Keyboard shortcuts

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