security

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HMACSigner

type HMACSigner struct {
	// contains filtered or unexported fields
}

func NewHMACSigner

func NewHMACSigner(secret string) *HMACSigner

func (*HMACSigner) Generate

func (s *HMACSigner) Generate(ctx context.Context, subject string) (string, error)

Generate creates a cryptographically signed token.

func (*HMACSigner) Verify

func (s *HMACSigner) Verify(ctx context.Context, token string, payload []byte) (bool, error)

Verify verifies a token signature against a payload.

type TokenSigner

type TokenSigner interface {
	Generate(ctx context.Context, subject string) (string, error)
	Verify(ctx context.Context, token string, payload []byte) (bool, error)
}

TokenSigner signs and verifies cryptographically secure tokens.

Jump to

Keyboard shortcuts

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