ocmp

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package ocmp evaluates an Offline Capability Manifest against the profile's normative rules R2–R7 (docs/offline-capability-manifest-profile-v0.md §3).

The profile is a fail-closed wrapper around a CLC grant decision: every rule here denies with a stable code and never raises. It is deliberately separate from CLC core semantics (OCMP §8); the vectors in data/_vectors/clc-v1/offline-vectors.json exercise this layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	GrantCovers bool
	TrustAnchor bool
	LocalPolicy bool
	Status      Status

	CredentialExpired bool
	Revoked           bool

	ReplayEnabled bool
	Counter       int64
	LastConsumed  int64

	RequiredFact  bool
	FactAvailable bool

	TrustedTime    int64
	ClockOffset    int64
	ClockTolerance int64
}

Inputs are the local, offline inputs the profile evaluates. Nothing here is fetched: R1 requires evaluation to depend only on these and the request.

type Result

type Result struct {
	Verdict string
	Reason  string
}

Result is a deny with a stable reason, or allow.

func Evaluate

func Evaluate(in Inputs) Result

Evaluate applies R2–R7 in a fixed order (missing inputs before derived ones).

type Status

type Status struct {
	Present      bool
	Verified     bool
	AsOf         int64
	ValidUntil   int64
	Version      int64
	LastAccepted int64
}

Status is the revocation snapshot.

Jump to

Keyboard shortcuts

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