hmac

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0, BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package hmac implements CEL extension functions for Hash-based Message Authentication Code (HMAC) verification and computation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Library

func Library(options ...Option) cel.EnvOption

Library returns a cel.EnvOption to configure extended functions for HMAC signature verification and computation.

Types

type Option

type Option func(*hmacLib) *hmacLib

Option declares a functional operator for configuring HMAC extension library behavior.

func Algorithm

func Algorithm(h crypto.Hash, aliases ...string) Option

Algorithm registers a crypto.Hash algorithm with optional aliases (e.g. Algorithm(crypto.SHA256, "HS256")), exposing constant declarations (e.g., hmac.SHA256, hmac.HS256) in CEL and enabling it for HMAC operations.

func CommonAlgorithms

func CommonAlgorithms() Option

CommonAlgorithms registers the most common HMAC hash algorithms (SHA256, SHA384, SHA512, SHA224, SHA512/256, SHA512/224) along with their JOSE/JWT aliases (HS256, HS384, HS512, HS224, HS512/256, HS512/224) using Algorithm options by proxy.

func MaxPrefixLength

func MaxPrefixLength(limit int) Option

MaxPrefixLength sets the maximum signature prefix length to parse during verification. Defaults to 20.

func Version

func Version(version uint32) Option

Version sets the library version for HMAC extensions.

Jump to

Keyboard shortcuts

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