util

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package util provides shared JWE types and parsing functions used by both the crypto package (public API) and crypto/provider/std (implementations). This package has zero dependency on either, breaking what would otherwise be a circular import.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidJWECompact = errors.New("kexcore/crypto: invalid JWE compact serialization")
	ErrInvalidJWEParts   = errors.New("kexcore/crypto: JWE compact serialization must have exactly 5 parts")
	ErrJWEKeyDecrypt     = errors.New("kexcore/crypto: failed to decrypt JWE encrypted key")
	ErrJWEContentDecrypt = errors.New("kexcore/crypto: failed to decrypt JWE content")
	ErrJWEHeaderMismatch = errors.New("kexcore/crypto: JWE header algorithm mismatch")
	ErrJWEUnsupportedEnc = errors.New("kexcore/crypto: unsupported JWE content encryption algorithm")
)

JWE errors shared across crypto and provider/std.

Functions

This section is empty.

Types

type JWEHeader

type JWEHeader struct {
	Algorithm   string `json:"alg"`
	Encryption  string `json:"enc"`
	Type        string `json:"typ,omitempty"`
	ContentType string `json:"cty,omitempty"`
}

JWEHeader represents the JOSE header for JWE.

func ParseJWECompact

func ParseJWECompact(compact string) ([]string, *JWEHeader, error)

ParseJWECompact parses and validates a JWE compact serialization (5 dot-separated parts).

Jump to

Keyboard shortcuts

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