Documentation
¶
Overview ¶
Package conformance is the single public source of truth for the qURL cross-language conformance vectors. It embeds the JSON artifacts under vectors/ and exposes strict, typed loaders so any consumer — in any language that can call this Go module, or that copies the JSON directly — can re-run the same wire-truth against its own implementation.
Seven families live here, each under its own artifact id so they stay decoupled by layer:
- The qURL v2 verify-path vectors (qv2_conformance_vectors.json composing issuer_signature_vectors.json): the claims/secret/base64/fragment/relay/ server-id classes and the issuer-signature golden bytes.
- The relay/NHP-handshake golden packets (relay_knock_golden.json): the deterministic relay-knock packet plus a frozen, server-sealed ack reply for the Noise handshake layer, which the qURL verify path does not import.
- The NHP agent-registration golden packets (agent_registration_golden.json): deterministic OTP/REG requests plus frozen RAK replies.
- The NHP agent-assignment golden packets (agent_assignment_golden.json): deterministic LST/LRT assignment and completion, account-only assigned-cell OTP, REG/RAK activation, and strict request/binding/size/error cases.
- The registered-agent knock application contract (agent_knock_application_vectors.json): exact KNK JSON, RunID request policy, and already-decrypted ACK/COK disposition vectors, with no duplicate packet bytes.
- The agent API-key ID contract (agent_api_key_id_vectors.json): issuer construction and strict consumer cases for registration-info key_id and completion device_api_key_id.
- The assignment-ticket v1 artifact (assignment_ticket_v1_vectors.json): exact qat1 claims/signature bytes, optimistic fences, and reject suites.
The verify-path artifact is BEHAVIORAL: a consumer feeds each class's input through its real parser/validator and asserts the declared accept/reject outcome (and, where the class is about the distinction, the reject_class), rather than trusting a stored boolean. A verifier that drifts from the contract fails its own run.
This module is stdlib-only and has no build-time dependencies; the generator that produces the vectors is intentionally not part of it.
Index ¶
- Constants
- func AgentAPIKeyIDVectors() []byte
- func AgentAssignmentVectors() []byte
- func AgentKnockApplicationVectors() []byte
- func AgentRegistrationVectors() []byte
- func AssignmentTicketVectors() []byte
- func IssuerSignatureVectors() []byte
- func Open(name string) ([]byte, error)
- func QV2Vectors() []byte
- func RelayKnockVectors() []byte
- type AgentAPIKeyIDContract
- type AgentAPIKeyIDFile
- type AgentAPIKeyIDProducerCase
- type AgentAPIKeyIDResponseCase
- type AgentAPIKeyIDSurface
- type AgentAPIKeyIDValueCase
- type AgentAssignmentCase
- type AgentAssignmentErrorCase
- type AgentAssignmentErrorContract
- type AgentAssignmentErrorRules
- type AgentAssignmentExchange
- type AgentAssignmentFile
- type AgentAssignmentKey
- type AgentAssignmentKeys
- type AgentAssignmentMalformedCase
- type AgentAssignmentOTPBindingCase
- type AgentAssignmentOTPChallengeBinding
- type AgentAssignmentOTPContract
- type AgentAssignmentOTPEnrollmentBinding
- type AgentAssignmentOTPPacketSizeCase
- type AgentAssignmentOTPPacketSizeContract
- type AgentAssignmentPacket
- type AgentAssignmentRequestCase
- type AgentAssignmentResultCase
- type AgentKnockApplicationFile
- type AgentKnockApplicationRequest
- type AgentKnockApplicationRequestFields
- type AgentKnockReplyCase
- type AgentKnockRequestCase
- type AgentKnockRequestExpectation
- type AgentRegistrationCase
- type AgentRegistrationFile
- type AssignmentTicketClaimsReject
- type AssignmentTicketContract
- type AssignmentTicketDERCase
- type AssignmentTicketFencePart
- type AssignmentTicketFenceReject
- type AssignmentTicketFenceVector
- type AssignmentTicketFile
- type AssignmentTicketGolden
- type AssignmentTicketJWK
- type AssignmentTicketRepeatDerivation
- type AssignmentTicketSyntheticKey
- type AssignmentTicketTrustReject
- type AssignmentTicketVerifyReject
- type ConformanceClass
- type ConformanceFile
- type ConformanceSignatureClass
- type ConformanceTamperDerivation
- type ConformanceVector
- type ECPublicJWK
- type IssuerKeyMaterial
- type RelayKnockCase
- type RelayKnockFile
- type SignatureVector
- type VectorFile
Constants ¶
const ( // AgentAPIKeyIDArtifactID identifies the control-plane API-key ID artifact. AgentAPIKeyIDArtifactID = "qurl-agent-api-key-id-vectors" // AgentAPIKeyIDSchemaVersion is the only schema accepted by this release. AgentAPIKeyIDSchemaVersion = 1 AgentAPIKeyIDPrefix = "key_" AgentAPIKeyIDSuffixLength = 12 AgentAPIKeyIDTotalLength = len(AgentAPIKeyIDPrefix) + AgentAPIKeyIDSuffixLength AgentAPIKeyIDSuffixAlphabet = "ASCII_ALPHANUMERIC" AgentAPIKeyIDPattern = "^key_[A-Za-z0-9]{12}$" AgentAPIKeyIDSurfaceRegistrationInfo = "registration_info" AgentAPIKeyIDSurfaceCompletion = "completion" AgentAPIKeyIDRejectInvalidID = "invalid_id" AgentAPIKeyIDRejectBodyParse = "body_parse" )
const ( // AssignmentTicketArtifactID identifies the standalone qat1 artifact. AssignmentTicketArtifactID = "qurl-assignment-ticket-v1-vectors" // AssignmentTicketSchemaVersion is the only schema accepted by this release. AssignmentTicketSchemaVersion = 1 AssignmentTicketPrefix = "qat1" AssignmentTicketSigningDomain = "qurl-agent-assignment-ticket-v1" // AssignmentTicketSyntheticCredentialBytes is the byte length of the fixed // ASCII test credential committed in the golden artifact. AssignmentTicketSyntheticCredentialBytes = 51 )
const ( ExpectAccept = "accept" ExpectReject = "reject" )
Expectation constants for accept/reject vector fields across artifacts.
const ( // RejectClassParse is the coarse class for a JSON-schema violation (duplicate // key, unknown field, null, wrong type, missing required, out-of-range/ordering). RejectClassParse = "parse" // RejectClassEncoding is a base64url encoding-layer rejection. RejectClassEncoding = "encoding" // RejectClassKeyLength is a decoded-key wrong-length rejection. RejectClassKeyLength = "key_length" // RejectClassFragment is a fragment wire-shape rejection. RejectClassFragment = "fragment" // RejectClassRelayURL is a relay_url HTTPS/allowlist rejection. RejectClassRelayURL = "relay_url" // RejectClassTamper is the signature-class payload-tamper rejection: a valid // signature verified against a flipped claims input (derived, not stored). RejectClassTamper = "tamper" // RejectClassHighS is a signature that is not low-S normalized. RejectClassHighS = "high_s" // RejectClassWrongLength is a signature that is not exactly 64 bytes (raw r||s). RejectClassWrongLength = "wrong_length" )
reject_class vocabulary. These constants are the fixed cross-language vocabulary the README pins, so every consumer can switch on a closed, known set. They are pinned precisely only where the class is about the distinction (signature high_s vs wrong_length; encoding; key_length); JSON-schema faults use the coarse "parse" because a conformant verifier may surface any of several internal sentinels for them.
const ( // TamperDeriveFromAccept is the only supported derive_from: start from the // composed file's accept vector. TamperDeriveFromAccept = "accept_vector" // TamperTransformFlipFirstB64 flips the FIRST base64url character of the accept // vector's claims_b64 between 'A' and 'B' ('A'->'B', any other char->'A'). The // first symbol encodes the top 6 bits of decoded byte 0, so this changes the // DECODED claims (not just don't-care tail bits) AND keeps the string canonical // base64url. That makes the derived tamper identical for every consumer // regardless of whether it hashes the base64 string, decodes-then-hashes, or // strict-decodes before verifying. TamperTransformFlipFirstB64 = "flip_first_base64url_char_A_B" )
Signature-class tamper derivation identifiers. These pin the artifact's language-agnostic derivation so a consumer applies exactly what the JSON specifies rather than a hardcoded rule.
const ( AgentAssignmentRequestHeaderName = "NHP_LST" AgentAssignmentRequestHeaderType = 5 AgentAssignmentResultHeaderName = "NHP_LRT" AgentAssignmentResultHeaderType = 6 // REG/RAK are shared NHP wire identities; these constants describe the // assigned-cell activation step, not a second registration wire format. AgentAssignmentRegistrationRequestHeaderName = "NHP_REG" AgentAssignmentRegistrationRequestHeaderType = 13 AgentAssignmentRegistrationResultHeaderName = "NHP_RAK" AgentAssignmentRegistrationResultHeaderType = 14 // OTP is the one-way, account-credential-only assigned-cell step. It has no // result header: the operator receives the code out of band and presents it // in the subsequent REG request. AgentAssignmentOTPRequestHeaderName = "NHP_OTP" AgentAssignmentOTPRequestHeaderType = 12 )
The exact NHP header values used for list request/result exchanges. Results echo their request's counter and never use the overload-cookie reply type.
const ( AgentAssignmentErrorOutcomeReject = "reject" AgentAssignmentRejectBodyParse = "body_parse" AgentAssignmentRejectUnknownField = "unknown_field" AgentAssignmentRejectMissingField = "missing_field" AgentAssignmentRejectWrongType = "wrong_type" AgentAssignmentRejectListOnError = "list_on_error" AgentAssignmentRejectRetryAfterMissing = "retry_after_missing" AgentAssignmentRejectRetryAfterInvalid = "retry_after_invalid" AgentAssignmentRejectRetryAfterUnexpected = "retry_after_unexpected" AgentAssignmentRejectSemantic = "semantic" AgentAssignmentRejectUnknownErrorCode = "unknown_error_code" AgentAssignmentRejectWrongPhase = "wrong_phase" AgentAssignmentRejectTicketBinding = "ticket_binding" AgentAssignmentRejectTicketExpired = "ticket_expired" AgentAssignmentRejectTicketLifetime = "ticket_lifetime" AgentAssignmentRejectPeerBinding = "peer_binding" AgentAssignmentRejectAgentBinding = "agent_binding" AgentAssignmentRejectCredentialBinding = "credential_binding" AgentAssignmentRejectEnvironmentBinding = "environment_binding" AgentAssignmentRejectCellBinding = "cell_binding" AgentAssignmentRejectChallengeBinding = "challenge_binding" AgentAssignmentRejectPacketSize = "packet_size" )
Agent-assignment reject outcome and class vocabulary.
const ( // AgentAssignmentQURLGoProducerRevision is the merged qurl-go revision // used to build and authenticate-open every assignment lifecycle packet. AgentAssignmentQURLGoProducerRevision = "8a69642957030b9ce0a1b8b356246d265a9f577d" // AgentAssignmentNHPProducerRevision is the merged NHP revision that owns // the closed assignment and registration error-code taxonomy. AgentAssignmentNHPProducerRevision = "9653fcb185c77629b787ad046c13c760baba88f4" // AgentAssignmentOTPProducerRevision is the merged NHP revision that // preserves the exact decrypted OTP RawBody alongside the independently // authenticated initiator public key at the plugin boundary. AgentAssignmentOTPProducerRevision = "2072546e1fc76eb76bd7e5c22d37856019ba33e7" )
Producer revisions for the deterministic wire and error contracts.
const ( // AgentAssignmentBootstrapCredentialFixture is the exact synthetic, // production-shaped credential fixture. Secret scanners must allow only // this value, never an lv_live_conformance_* wildcard. AgentAssignmentBootstrapCredentialFixture = "lv_live_conformance_bootstrap_secret_0001" // AgentAssignmentDeviceAPIKeyFixture is the exact synthetic, // production-shaped device-key fixture. Its body is canonical unpadded // base64url for the deterministic 32-byte sequence 0x00..0x1f. Secret // scanners must allow only this exact value, never an lv_live_* wildcard. AgentAssignmentDeviceAPIKeyFixture = "lv_live_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8" // AgentAssignmentAccountCredentialFixture is the exact synthetic account // credential carried only by the optional account OTP packet. AgentAssignmentAccountCredentialFixture = "lv_live_conformance_account_secret_0001" )
Exact synthetic production-shaped fixture values.
const ( AgentKnockOutcomeSuccess = "success" AgentKnockOutcomeDeny = "deny" AgentKnockOutcomeRetry = "retry" AgentKnockOutcomeReject = "reject" )
Agent-knock application outcomes. A consumer drives each reply through its real reply interpreter and derives one of these outcomes; it must not trust the stored label without exercising the application parser and correlation gates.
const ( AgentKnockRejectServerDeny = "server_deny" AgentKnockRejectServerBusy = "server_busy" AgentKnockRejectWrongResource = "wrong_resource" AgentKnockRejectMissingToken = "missing_token" AgentKnockRejectMissingHost = "missing_host" AgentKnockRejectBodyParse = "body_parse" AgentKnockRejectUnsupportedPreAccess = "unsupported_pre_access" AgentKnockRejectCounter = "counter" AgentKnockRejectReplyType = "reply_type" )
Agent-knock application reject classes form a closed, consumer-neutral vocabulary. ServerDeny and ServerBusy are authenticated platform outcomes; the other classes are fail-closed client dispositions: validation failures plus the unsupported pre-access feature gate.
const ( AgentKnockRejectMissingRunID = "missing_run_id" AgentKnockRejectInvalidRunID = "invalid_run_id" )
Agent-knock request reject classes distinguish strict JSON-shape failures from RunID policy failures. MissingRunID is specific to the native Connector entry point; the generic protocol parser intentionally accepts an omitted or empty RunID while rejecting every malformed non-empty value.
const AgentAssignmentArtifactID = "qurl-agent-assignment-golden-vectors"
AgentAssignmentArtifactID is the fixed identity of the NHP assignment, assigned-cell activation, and registration-completion golden artifact.
const AgentKnockApplicationArtifactID = "qurl-agent-knock-application-vectors"
AgentKnockApplicationArtifactID is the fixed identity of the registered-agent knock application-body artifact. It is deliberately separate from RelayKnockArtifactID: this document starts after Noise decryption and carries no packet bytes, private keys, nonces, or ciphertext.
const AgentKnockRunIDLength = 16
AgentKnockRunIDLength is the exact lowercase-hex length of a canonical native-UDP-SDK-generated knock cycle identifier (8 random bytes).
const AgentRegistrationArtifactID = "qurl-agent-registration-golden-vectors"
AgentRegistrationArtifactID is the fixed identity string the agent-registration artifact's top-level "artifact" field must carry. The loader enforces it so a consumer that relies on "the loader rejects malformed files" cannot silently load a DIFFERENT document into these structs. A consumer in another language should assert the same id.
const ConformanceArtifactID = "qurl-v2-conformance-vectors"
ConformanceArtifactID is the fixed identity string the top-level "artifact" field must carry. The loader enforces it so a consumer that relies on "the loader rejects malformed files" cannot silently load a DIFFERENT document into these structs. A consumer in another language should assert the same id.
const RelayKnockArtifactID = "qurl-relay-knock-golden-vectors"
RelayKnockArtifactID is the fixed identity string the relay-knock artifact's top-level "artifact" field must carry. The loader enforces it so a consumer that relies on "the loader rejects malformed files" cannot silently load a DIFFERENT document into these structs. A consumer in another language should assert the same id.
Variables ¶
This section is empty.
Functions ¶
func AgentAPIKeyIDVectors ¶ added in v0.3.0
func AgentAPIKeyIDVectors() []byte
AgentAPIKeyIDVectors returns the raw bytes of the control-plane API-key ID producer and consumer vectors used by agent registration.
func AgentAssignmentVectors ¶ added in v0.3.0
func AgentAssignmentVectors() []byte
AgentAssignmentVectors returns the raw bytes of the deterministic NHP LST/LRT assignment and registration-completion packets plus the account-only OTP request contract.
func AgentKnockApplicationVectors ¶ added in v0.1.3
func AgentKnockApplicationVectors() []byte
AgentKnockApplicationVectors returns the raw bytes of the registered-agent knock application-body vectors. Unlike RelayKnockVectors, this artifact starts after Noise decryption and contains no packet bytes.
func AgentRegistrationVectors ¶ added in v0.1.3
func AgentRegistrationVectors() []byte
AgentRegistrationVectors returns the raw bytes of the embedded NHP agent-registration golden packets (agent_registration_golden.json): the OTP/REG requests and the RAK replies. The bytes are the canonical wire-truth; a consumer that prefers to drive its own strict parser can feed these directly.
func AssignmentTicketVectors ¶ added in v0.3.0
func AssignmentTicketVectors() []byte
AssignmentTicketVectors returns the raw bytes of the standalone qat1 cryptographic and fence artifact.
func IssuerSignatureVectors ¶
func IssuerSignatureVectors() []byte
IssuerSignatureVectors returns the raw bytes of the embedded issuer-signature golden vectors (issuer_signature_vectors.json), which the signature class composes by reference.
func Open ¶
Open returns the raw bytes of an embedded vectors file by its base name (for example "qv2_conformance_vectors.json" or "issuer_signature_vectors.json"), or by its full "vectors/..." path. It returns an error for any other name.
func QV2Vectors ¶
func QV2Vectors() []byte
QV2Vectors returns the raw bytes of the embedded qURL v2 conformance vectors (qv2_conformance_vectors.json). The bytes are the canonical wire-truth; a consumer that prefers to drive its own strict parser can feed these directly.
func RelayKnockVectors ¶ added in v0.1.1
func RelayKnockVectors() []byte
RelayKnockVectors returns the raw bytes of the embedded relay/NHP-handshake golden packets (relay_knock_golden.json). The bytes are the canonical wire-truth; a consumer that prefers to drive its own strict parser can feed these directly.
Types ¶
type AgentAPIKeyIDContract ¶ added in v0.3.0
type AgentAPIKeyIDContract struct {
Prefix string `json:"prefix"`
SuffixLength int `json:"suffix_length"`
TotalLength int `json:"total_length"`
SuffixAlphabet string `json:"suffix_alphabet"`
Pattern string `json:"pattern"`
}
AgentAPIKeyIDContract is the language-neutral public grammar.
type AgentAPIKeyIDFile ¶ added in v0.3.0
type AgentAPIKeyIDFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
Contract AgentAPIKeyIDContract `json:"contract"`
Surfaces []AgentAPIKeyIDSurface `json:"surfaces"`
ProducerCases []AgentAPIKeyIDProducerCase `json:"producer_cases"`
ConsumerValueCases []AgentAPIKeyIDValueCase `json:"consumer_value_cases"`
ConsumerResponseCases []AgentAPIKeyIDResponseCase `json:"consumer_response_cases"`
}
AgentAPIKeyIDFile freezes producer construction and consumer parsing for the two control-plane fields that carry an API-key identifier during enrollment.
func AgentAPIKeyIDs ¶ added in v0.3.0
func AgentAPIKeyIDs() (*AgentAPIKeyIDFile, error)
AgentAPIKeyIDs strictly parses the embedded agent API-key ID artifact.
func ParseAgentAPIKeyIDFile ¶ added in v0.3.0
func ParseAgentAPIKeyIDFile(data []byte) (*AgentAPIKeyIDFile, error)
ParseAgentAPIKeyIDFile strictly parses the API-key identifier artifact and independently derives every declared producer and consumer expectation.
type AgentAPIKeyIDProducerCase ¶ added in v0.3.0
type AgentAPIKeyIDProducerCase struct {
Name string `json:"name"`
Suffix string `json:"suffix"`
ExpectedID string `json:"expected_id"`
}
AgentAPIKeyIDProducerCase lets an issuer drive its production constructor with a deterministic suffix and compare the exact public ID.
type AgentAPIKeyIDResponseCase ¶ added in v0.3.0
type AgentAPIKeyIDResponseCase struct {
Name string `json:"name"`
Surface string `json:"surface"`
BodyJSON string `json:"body_json"`
Outcome string `json:"outcome"`
ExpectedID string `json:"expected_id,omitempty"`
RejectClass string `json:"reject_class,omitempty"`
}
AgentAPIKeyIDResponseCase preserves raw JSON so companion fields, duplicate keys, wrong scalar types, and trailing values reach a consumer's response parser without lossy re-serialization.
type AgentAPIKeyIDSurface ¶ added in v0.3.0
AgentAPIKeyIDSurface names one public response field that carries the ID.
type AgentAPIKeyIDValueCase ¶ added in v0.3.0
type AgentAPIKeyIDValueCase struct {
Name string `json:"name"`
Value string `json:"value"`
Outcome string `json:"outcome"`
RejectClass string `json:"reject_class,omitempty"`
}
AgentAPIKeyIDValueCase is one direct validator input.
type AgentAssignmentCase ¶ added in v0.3.0
type AgentAssignmentCase struct {
Name string `json:"name"`
Phase string `json:"phase"`
HeaderName string `json:"header_name"`
HeaderType int `json:"header_type"`
BodyJSON string `json:"body_json"`
Outcome string `json:"outcome"`
RejectClass string `json:"reject_class"`
}
AgentAssignmentCase is an authenticated application request or result that a producer/consumer must reject. BodyJSON stays raw so duplicate keys and trailing JSON survive artifact parsing.
type AgentAssignmentErrorCase ¶ added in v0.3.0
type AgentAssignmentErrorCase struct {
Name string `json:"name"`
Phase string `json:"phase"`
HeaderName string `json:"header_name"`
HeaderType int `json:"header_type"`
BodyJSON string `json:"body_json"`
ErrCode string `json:"err_code"`
Outcome string `json:"outcome"`
RetryAfterSeconds *int `json:"retry_after_seconds,omitempty"`
}
type AgentAssignmentErrorContract ¶ added in v0.3.0
type AgentAssignmentErrorContract struct {
Status string `json:"status"`
ProducerRevision string `json:"producer_revision"`
Rules AgentAssignmentErrorRules `json:"rules"`
AssignmentCases []AgentAssignmentErrorCase `json:"assignment_cases"`
InitialCredentialCases []AgentAssignmentErrorCase `json:"initial_credential_cases"`
CompletionCases []AgentAssignmentErrorCase `json:"completion_cases"`
RegistrationCases []AgentAssignmentErrorCase `json:"registration_cases"`
MalformedCases []AgentAssignmentMalformedCase `json:"malformed_cases"`
}
AgentAssignmentErrorContract is the closed v1 authenticated error taxonomy. Valid cases drive production parsers/classifiers; malformed cases drive their strict reject paths. Error bodies are strings so duplicate keys and trailing JSON reach the consumer unchanged.
type AgentAssignmentErrorRules ¶ added in v0.3.0
type AgentAssignmentErrorRules struct {
ListErrorHeaderName string `json:"list_error_header_name"`
ListErrorHeaderType int `json:"list_error_header_type"`
RegistrationErrorHeaderName string `json:"registration_error_header_name"`
RegistrationErrorHeaderType int `json:"registration_error_header_type"`
ListOmittedOnError bool `json:"list_omitted_on_error"`
CookieChallengeAllowed bool `json:"cookie_challenge_allowed"`
RetryAfterSecondsPermittedCodes []string `json:"retry_after_seconds_permitted_codes"`
RetryAfterSecondsRequiredCodes []string `json:"retry_after_seconds_required_codes"`
RetryAfterSecondsPositiveInteger bool `json:"retry_after_seconds_positive_integer"`
ErrMsgControlsPolicy bool `json:"err_msg_controls_policy"`
}
type AgentAssignmentExchange ¶ added in v0.3.0
type AgentAssignmentExchange struct {
Request AgentAssignmentPacket `json:"request"`
Result AgentAssignmentPacket `json:"result"`
}
type AgentAssignmentFile ¶ added in v0.3.0
type AgentAssignmentFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
SourceOfTruth string `json:"source_of_truth"`
Notes []string `json:"notes"`
PublicRegistrationKeyKinds []string `json:"public_registration_key_kinds"`
Keys AgentAssignmentKeys `json:"keys"`
InitialAssignment AgentAssignmentExchange `json:"initial_assignment"`
RefreshAssignment AgentAssignmentExchange `json:"refresh_assignment"`
AssignedCellRegistration AgentAssignmentExchange `json:"assigned_cell_registration"`
RegistrationCompletion AgentAssignmentExchange `json:"registration_completion"`
AccountCredentialOTP AgentAssignmentOTPContract `json:"account_credential_otp"`
RequestCases []AgentAssignmentRequestCase `json:"request_cases"`
SuccessResultCases []AgentAssignmentResultCase `json:"success_result_cases"`
ErrorContract AgentAssignmentErrorContract `json:"error_contract"`
}
AgentAssignmentFile pins four complete deterministic NHP exchanges plus the one-way account-only OTP packet: initial assignment and refresh against the bootstrap hub, optional assigned-cell OTP, assigned-cell registration with the assignment ticket, and registration completion against that cell. ErrorContract is application-layer behavioral data for the same lifecycle.
func AgentAssignmentGolden ¶ added in v0.3.0
func AgentAssignmentGolden() (*AgentAssignmentFile, error)
AgentAssignmentGolden strictly parses the embedded deterministic NHP LST/LRT assignment and registration-completion artifact plus account-only OTP.
func ParseAgentAssignmentFile ¶ added in v0.3.0
func ParseAgentAssignmentFile(data []byte) (*AgentAssignmentFile, error)
ParseAgentAssignmentFile strictly parses and validates the deterministic assignment artifact. It fails closed on schema drift, missing crypto inputs, body byte drift, semantic envelope drift, type/role mix-ups, unmatched counters, or an incomplete/malformed error taxonomy.
type AgentAssignmentKey ¶ added in v0.3.0
type AgentAssignmentKeys ¶ added in v0.3.0
type AgentAssignmentKeys struct {
Hub AgentAssignmentKey `json:"hub"`
AssignedCell AgentAssignmentKey `json:"assigned_cell"`
Agent AgentAssignmentKey `json:"agent"`
}
AgentAssignmentKeys names the three synthetic static X25519 identities used by the exchanges. Keeping keys at the top level makes the hub/cell trust boundary explicit without repeating private material in every packet case.
type AgentAssignmentMalformedCase ¶ added in v0.3.0
type AgentAssignmentOTPBindingCase ¶ added in v0.4.0
type AgentAssignmentOTPBindingCase struct {
Name string `json:"name"`
MutationField string `json:"mutation_field"`
MutationValue string `json:"mutation_value"`
Outcome string `json:"outcome"`
RejectClass string `json:"reject_class,omitempty"`
}
AgentAssignmentOTPBindingCase applies one typed mutation to the exact enrollment baseline. "none" is the positive boundary case; all other mutations isolate one trust fence without duplicating the credential-bearing baseline across the artifact.
type AgentAssignmentOTPChallengeBinding ¶ added in v0.4.0
type AgentAssignmentOTPChallengeBinding struct {
LookupKeyField string `json:"lookup_key_field"`
RequiredMatchFields []string `json:"required_match_fields"`
TicketJTI string `json:"ticket_jti"`
AuthenticatedPeerPublicKeyB64 string `json:"authenticated_peer_public_key_b64"`
DevID string `json:"dev_id"`
CredentialKeyID string `json:"credential_key_id"`
EnvironmentID string `json:"environment_id"`
CellID string `json:"cell_id"`
}
AgentAssignmentOTPChallengeBinding freezes the exact challenge-store tuple. TicketJTI is both the lookup key and a required stored value; every other field must match the authenticated OTP request and verified ticket before a later REG code can be accepted. This is metadata, not a storage implementation.
type AgentAssignmentOTPContract ¶ added in v0.4.0
type AgentAssignmentOTPContract struct {
ProducerRevision string `json:"producer_revision"`
RawBodyRequired bool `json:"raw_body_required"`
AuthenticatedPeerPublicKeyRequired bool `json:"authenticated_peer_public_key_required"`
OTPRegistrationKeyKinds []string `json:"otp_registration_key_kinds"`
OTPFreeRegistrationKeyKinds []string `json:"otp_free_registration_key_kinds"`
EnrollmentBinding AgentAssignmentOTPEnrollmentBinding `json:"enrollment_binding"`
ChallengeBinding AgentAssignmentOTPChallengeBinding `json:"challenge_binding"`
Request AgentAssignmentPacket `json:"request"`
RequestCases []AgentAssignmentRequestCase `json:"request_cases"`
BindingCases []AgentAssignmentOTPBindingCase `json:"binding_cases"`
ChallengeBindingCases []AgentAssignmentOTPBindingCase `json:"challenge_binding_cases"`
PacketSizeContract AgentAssignmentOTPPacketSizeContract `json:"packet_size_contract"`
}
AgentAssignmentOTPContract is the optional assigned-cell OTP request for an account credential. It is deliberately a contract artifact, not an SDK or authority implementation: the deterministic packet freezes the authenticated wire bytes, request cases freeze strict RawBody parsing, binding cases freeze the inputs an authority must compare, and packet-size cases drive the real producer codec from the verifier module.
type AgentAssignmentOTPEnrollmentBinding ¶ added in v0.4.0
type AgentAssignmentOTPEnrollmentBinding struct {
RequestAssignmentTicket string `json:"request_assignment_ticket"`
VerifiedAssignmentTicket string `json:"verified_assignment_ticket"`
RequestAgentID string `json:"request_agent_id"`
TicketAgentID string `json:"ticket_agent_id"`
AuthenticatedPeerPublicKeyB64 string `json:"authenticated_peer_public_key_b64"`
TicketAgentPublicKeyB64 string `json:"ticket_agent_public_key_b64"`
RequestRegistrationKeyID string `json:"request_registration_key_id"`
TicketCredentialKeyID string `json:"ticket_credential_key_id"`
TicketCredentialKind string `json:"ticket_credential_kind"`
RequestCredential string `json:"request_credential"`
RequestCredentialHashB64 string `json:"request_credential_hash_b64"`
TicketCredentialKeyHashB64 string `json:"ticket_credential_key_hash_b64"`
RecomputedCredentialFenceB64 string `json:"recomputed_credential_fence_b64"`
TicketCredentialFenceB64 string `json:"ticket_credential_fence_b64"`
TicketJTI string `json:"ticket_jti"`
LocalEnvironmentID string `json:"local_environment_id"`
TicketEnvironmentID string `json:"ticket_environment_id"`
LocalCellID string `json:"local_cell_id"`
TicketCellID string `json:"ticket_cell_id"`
EvaluatedAtUnix int64 `json:"evaluated_at_unix"`
TicketExpiresAtUnix int64 `json:"ticket_expires_at_unix"`
MinimumTicketRemainingSeconds int64 `json:"minimum_ticket_remaining_seconds"`
}
AgentAssignmentOTPEnrollmentBinding is the trusted baseline from which each binding case starts. Request* values come from the authenticated RawBody; Ticket* values come from verified ticket claims; AuthenticatedPeerPublicKeyB64 comes from the Noise transaction; Local* values come from server configuration.
type AgentAssignmentOTPPacketSizeCase ¶ added in v0.4.0
type AgentAssignmentOTPPacketSizeContract ¶ added in v0.4.0
type AgentAssignmentOTPPacketSizeContract struct {
HeaderBytes int `json:"header_bytes"`
BodyAEADTagBytes int `json:"body_aead_tag_bytes"`
MaxPlaintextBodyBytes int `json:"max_plaintext_body_bytes"`
MaxPacketBytes int `json:"max_packet_bytes"`
BodyFillByteHex string `json:"body_fill_byte_hex"`
Cases []AgentAssignmentOTPPacketSizeCase `json:"cases"`
}
type AgentAssignmentPacket ¶ added in v0.3.0
type AgentAssignmentPacket struct {
HeaderName string `json:"header_name"`
HeaderType int `json:"header_type"`
SenderKey string `json:"sender_key"`
ReceiverKey string `json:"receiver_key"`
EphemeralPrivHex string `json:"ephemeral_priv_hex"`
TimestampNanos string `json:"timestamp_nanos"`
Counter string `json:"counter"`
PreambleHex string `json:"preamble_hex"`
BodyJSON string `json:"body_json"`
BodyHex string `json:"body_hex"`
PacketHex string `json:"packet_hex"`
}
AgentAssignmentPacket is one deterministic LST, LRT, REG, or RAK packet. body_json is a string, rather than an embedded object, because its exact UTF-8 bytes and field order are cryptographic input; body_hex must encode those same bytes.
type AgentAssignmentRequestCase ¶ added in v0.3.0
type AgentAssignmentRequestCase AgentAssignmentCase
AgentAssignmentRequestCase is an authenticated application request reject. It is intentionally distinct from AgentAssignmentResultCase so callers cannot interchange request and result cases at compile time.
type AgentAssignmentResultCase ¶ added in v0.3.0
type AgentAssignmentResultCase AgentAssignmentCase
AgentAssignmentResultCase is an authenticated success-envelope reject. It is intentionally distinct from AgentAssignmentRequestCase so callers cannot interchange request and result cases at compile time.
type AgentKnockApplicationFile ¶ added in v0.1.3
type AgentKnockApplicationFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
SourceOfTruth string `json:"source_of_truth"`
Notes []string `json:"notes"`
Request AgentKnockApplicationRequest `json:"request"`
RequestCases []AgentKnockRequestCase `json:"request_cases"`
ReplyCases []AgentKnockReplyCase `json:"reply_cases"`
}
AgentKnockApplicationFile is the versioned application-layer contract for a registered-agent NHP knock. Request carries one deterministic body golden; RequestCases pin generic-parser versus native-Connector RunID policy; and ReplyCases cover the complete current ACK producer envelope, success result values, authenticated deny, overload, unsupported pre-access, and fail-closed application/correlation negatives without duplicating Noise packet vectors.
func AgentKnockApplication ¶ added in v0.1.3
func AgentKnockApplication() (*AgentKnockApplicationFile, error)
AgentKnockApplication strictly parses the embedded registered-agent knock application-body artifact into a typed document.
func ParseAgentKnockApplicationFile ¶ added in v0.1.3
func ParseAgentKnockApplicationFile(data []byte) (*AgentKnockApplicationFile, error)
ParseAgentKnockApplicationFile strictly parses and validates the application-body artifact. It rejects duplicate/unknown/trailing outer fields, stale schema versions, missing or unknown cases, invalid enums/counters, duplicate case names, and a request golden that does not exactly match its semantic fields. It independently derives both declared request-parser outcomes and cross-checks success result labels against the requested resource's raw body maps so labels cannot drift, and rejects a declared success that carries any non-null preActions value. Remaining reply semantics stay the consumer's job: those bodies include intentional wrong-map shapes and trailing data that must reach the production parser. Invalid raw JSON is allowed only for an explicit body_parse reject.
type AgentKnockApplicationRequest ¶ added in v0.1.3
type AgentKnockApplicationRequest struct {
WireType int `json:"wire_type"`
Fields AgentKnockApplicationRequestFields `json:"fields"`
BodyJSON string `json:"body_json"`
}
AgentKnockApplicationRequest pins the outer NHP type, semantic synthetic inputs, and exact compact JSON body. Keeping the semantic inputs beside the golden prevents a consumer from merely copying BodyJSON: it must construct the body through its production serializer and compare the resulting bytes.
type AgentKnockApplicationRequestFields ¶ added in v0.1.3
type AgentKnockApplicationRequestFields struct {
HeaderType int `json:"header_type"`
UserID string `json:"user_id"`
DeviceID string `json:"device_id"`
AuthServiceID string `json:"auth_service_id"`
KnockResourceID string `json:"knock_resource_id"`
RunID string `json:"run_id"`
}
AgentKnockApplicationRequestFields names the six load-bearing registered- agent fields without importing any producer implementation type.
type AgentKnockReplyCase ¶ added in v0.1.3
type AgentKnockReplyCase struct {
Name string `json:"name"`
ReplyType int `json:"reply_type"`
RequestCounter string `json:"request_counter"`
ReplyCounter string `json:"reply_counter"`
BodyJSON string `json:"body_json"`
Outcome string `json:"outcome"`
RejectClass string `json:"reject_class,omitempty"`
ExpectedACToken string `json:"expected_ac_token,omitempty"`
ExpectedResourceHost string `json:"expected_resource_host,omitempty"`
}
AgentKnockReplyCase is one already-decrypted reply disposition. Counter values are decimal strings so JavaScript consumers never lose uint64 precision. BodyJSON stays raw so malformed application shapes, including deliberate trailing data, survive the artifact and reach the consumer's real parser. ExpectedACToken and ExpectedResourceHost are present only on success and pin the exact requested-resource map values a conforming interpreter must return; optional ACK metadata cannot substitute for either.
type AgentKnockRequestCase ¶ added in v0.2.0
type AgentKnockRequestCase struct {
Name string `json:"name"`
BodyJSON string `json:"body_json"`
GenericParser AgentKnockRequestExpectation `json:"generic_parser"`
NativeConnector AgentKnockRequestExpectation `json:"native_connector"`
}
AgentKnockRequestCase is one authenticated KNK JSON-body input evaluated at both protocol entry points. BodyJSON remains raw so duplicate keys and alias spellings reach each consumer's real strict parser.
type AgentKnockRequestExpectation ¶ added in v0.2.0
type AgentKnockRequestExpectation struct {
Outcome string `json:"outcome"`
ParsedRunID *string `json:"parsed_run_id,omitempty"`
RejectClass string `json:"reject_class,omitempty"`
}
AgentKnockRequestExpectation is the declared result at one request parser. ParsedRunID is required on accept (including the accepted empty generic value) and absent on reject; RejectClass follows the inverse rule.
type AgentRegistrationCase ¶ added in v0.1.3
type AgentRegistrationCase struct {
// ServerStaticPrivHex / ServerStaticPubHex are the server static X25519 key.
// Deterministic cases carry both; frozen (RAK) cases carry only the public half.
ServerStaticPrivHex string `json:"server_static_priv_hex,omitempty"`
ServerStaticPubHex string `json:"server_static_pub_hex"`
// DeviceStaticPrivHex / DeviceStaticPubHex are the initiator (agent/device)
// static X25519 key, used by the deterministic OTP/REG cases.
DeviceStaticPrivHex string `json:"device_static_priv_hex,omitempty"`
DeviceStaticPubHex string `json:"device_static_pub_hex,omitempty"`
// AgentStaticPrivHex is the agent (responder-side decryptor) static private
// X25519 key, used by the frozen RAK cases to open the reply. It is the same
// key as the deterministic cases' device_static_priv_hex.
AgentStaticPrivHex string `json:"agent_static_priv_hex,omitempty"`
// EphemeralPrivHex is the fixed initiator ephemeral private key the
// deterministic cases seal under (so the packet is reproducible).
EphemeralPrivHex string `json:"ephemeral_priv_hex,omitempty"`
// TimestampNanos is the handshake timestamp, decimal string (exceeds 2^53).
TimestampNanos string `json:"timestamp_nanos"`
// Counter is the deterministic-case counter as a decimal string.
Counter string `json:"counter,omitempty"`
// CounterHex is the frozen RAK counter as a hex string (no 0x prefix, no
// padding). It echoes reg_emailed's counter for the matched pair.
CounterHex string `json:"counter_hex,omitempty"`
// PreambleHex is the 32-bit HeaderCommon preamble as a hex string
// (deterministic cases).
PreambleHex string `json:"preamble_hex,omitempty"`
// BodyHex is the plaintext registration body the case carries, hex-encoded
// (AgentOTPMsg / AgentRegisterMsg / ServerRegisterAckMsg JSON).
BodyHex string `json:"body_hex"`
// PacketHex is the full wire packet, hex-encoded: for a deterministic case,
// the value a conformant builder must reproduce; for a frozen RAK case, the
// value a conformant decryptor must open.
PacketHex string `json:"packet_hex"`
}
AgentRegistrationCase is one golden packet: an OTP/REG initiator request or a RAK reply. Every value is the exact hex (or, for the numeric fields, the stringified value) the case uses; only the fields relevant to a given case are populated. All fields are strings — including timestamp_nanos, which exceeds 2^53 and so is carried as a decimal string rather than a JSON number.
Deterministic cases (otp, reg_emailed, reg_preissued) carry the same fields as relay_knock's knock: the server/device static keypairs, the fixed initiator ephemeral, the timestamp/counter/preamble, the plaintext body, and the full packet a conformant builder must reproduce. Frozen cases (rak_success, rak_error) carry the ack-style fields: the server static PUBLIC key, the agent (responder-side decryptor) static PRIVATE key, the counter as hex, the body, and the frozen packet a conformant decryptor must open.
type AgentRegistrationFile ¶ added in v0.1.3
type AgentRegistrationFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
SourceOfTruth string `json:"source_of_truth"`
Notes []string `json:"notes"`
OTP AgentRegistrationCase `json:"otp"`
RegEmailed AgentRegistrationCase `json:"reg_emailed"`
RegPreissued AgentRegistrationCase `json:"reg_preissued"`
RakSuccess AgentRegistrationCase `json:"rak_success"`
RakError AgentRegistrationCase `json:"rak_error"`
}
AgentRegistrationFile is the top-level NHP agent-registration golden artifact: the OTP request, the emailed-code and pre-issued-key REG requests (all three DETERMINISTIC — a conformant initiator must reproduce packet_hex byte-for-byte), and the server register-ack (RAK) success/error replies (FROZEN, sealed at origin with a random server ephemeral, so NOT reproducible by a client — only decryptable). Every case decodes into the same AgentRegistrationCase, which carries the UNION of the fields the deterministic and frozen cases use.
The reg_emailed → rak pair is counter-matched (rak_success/rak_error echo reg_emailed's counter), so a consumer can validate the RAK-must-echo-its-REG counter contract (conformance#19) against a positive fixture.
func AgentRegistrationGolden ¶ added in v0.1.3
func AgentRegistrationGolden() (*AgentRegistrationFile, error)
AgentRegistrationGolden strictly parses the embedded NHP agent-registration golden artifact into a typed document, returning an error if it is malformed or is not the expected artifact.
func ParseAgentRegistrationFile ¶ added in v0.1.3
func ParseAgentRegistrationFile(data []byte) (*AgentRegistrationFile, error)
ParseAgentRegistrationFile strictly parses the agent-registration golden artifact from raw bytes. It returns an error (never an empty/zero document) when the bytes are malformed or are not the agent-registration artifact, so a consumer test FAILS rather than silently skipping or misreading the contract. DisallowUnknownFields keeps a typo'd or stale schema field from being ignored.
type AssignmentTicketClaimsReject ¶ added in v0.3.0
type AssignmentTicketClaimsReject struct {
Name string `json:"name"`
RejectClass string `json:"reject_class"`
Reason string `json:"reason"`
ClaimsJSON string `json:"claims_json,omitempty"`
Derivation *AssignmentTicketRepeatDerivation `json:"derivation,omitempty"`
}
AssignmentTicketClaimsReject drives strict parsing before signing/verification.
func (AssignmentTicketClaimsReject) ResolveClaims ¶ added in v0.3.0
func (c AssignmentTicketClaimsReject) ResolveClaims() (string, error)
ResolveClaims returns the exact strict-parser input for a claims reject.
type AssignmentTicketContract ¶ added in v0.3.0
type AssignmentTicketContract struct {
TokenPrefix string `json:"token_prefix"`
SigningAlgorithm string `json:"signing_algorithm"`
SigningDomain string `json:"signing_domain"`
SigningSeparatorHex string `json:"signing_separator_hex"`
SignatureEncoding string `json:"signature_encoding"`
KMSMessageType string `json:"kms_message_type"`
KMSOutputEncoding string `json:"kms_output_encoding"`
MaxTicketASCIIBytes int `json:"max_ticket_ascii_bytes"`
MaxClaimsPartCharacters int `json:"max_claims_part_characters"`
MaxClaimsJSONBytes int `json:"max_claims_json_bytes"`
RawSignatureBytes int `json:"raw_signature_bytes"`
SignaturePartCharacters int `json:"signature_part_characters"`
MaxKIDCharacters int `json:"max_kid_characters"`
DigestCharacters int `json:"digest_characters"`
AgentPublicKeyCharacters int `json:"agent_public_key_characters"`
MaxLifetimeSeconds int `json:"max_lifetime_seconds"`
NotBeforeOffsetSeconds int `json:"not_before_offset_seconds"`
NHPBodyMaxBytes int `json:"nhp_body_max_bytes"`
NHPPacketMaxBytes int `json:"nhp_packet_max_bytes"`
ClaimOrder []string `json:"claim_order"`
CredentialKinds []string `json:"credential_kinds"`
PlacementModes []string `json:"placement_modes"`
}
AssignmentTicketContract is the closed wire and size profile.
type AssignmentTicketDERCase ¶ added in v0.3.0
type AssignmentTicketDERCase struct {
Name string `json:"name"`
Outcome string `json:"outcome"`
RejectClass string `json:"reject_class,omitempty"`
Reason string `json:"reason"`
DERHex string `json:"der_hex"`
ExpectedRawHex string `json:"expected_raw_low_s_hex,omitempty"`
}
AssignmentTicketDERCase drives KMS DER-to-raw-low-S normalization.
type AssignmentTicketFencePart ¶ added in v0.3.0
type AssignmentTicketFencePart struct {
Name string `json:"name"`
Encoding string `json:"encoding"`
Value string `json:"value"`
BytesHex string `json:"bytes_hex"`
}
AssignmentTicketFencePart exposes both the semantic input and its exact bytes. Value is always a string; Encoding determines how to interpret it.
type AssignmentTicketFenceReject ¶ added in v0.3.0
type AssignmentTicketFenceReject struct {
Name string `json:"name"`
FenceKind string `json:"fence_kind"`
RejectClass string `json:"reject_class"`
Reason string `json:"reason"`
Mutation string `json:"mutation"`
}
AssignmentTicketFenceReject freezes invalid typed fence input classes.
type AssignmentTicketFenceVector ¶ added in v0.3.0
type AssignmentTicketFenceVector struct {
Name string `json:"name"`
Kind string `json:"kind"`
Domain string `json:"domain"`
Parts []AssignmentTicketFencePart `json:"parts"`
PreimageHex string `json:"preimage_hex"`
DigestHex string `json:"digest_hex"`
DigestB64URL string `json:"digest_b64url"`
}
AssignmentTicketFenceVector freezes one exact length-framed fence preimage.
type AssignmentTicketFile ¶ added in v0.3.0
type AssignmentTicketFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
Contract AssignmentTicketContract `json:"contract"`
SyntheticSigningKey AssignmentTicketSyntheticKey `json:"synthetic_signing_key"`
FenceVectors []AssignmentTicketFenceVector `json:"fence_vectors"`
Golden AssignmentTicketGolden `json:"golden"`
VerifyRejects []AssignmentTicketVerifyReject `json:"verify_rejects"`
ClaimsRejects []AssignmentTicketClaimsReject `json:"claims_rejects"`
KMSDERCases []AssignmentTicketDERCase `json:"kms_der_cases"`
FenceRejects []AssignmentTicketFenceReject `json:"fence_rejects"`
TrustKeyRejects []AssignmentTicketTrustReject `json:"trust_key_rejects"`
}
AssignmentTicketFile freezes the byte-level qat1 signing profile, the three optimistic fences, and negative inputs for strict producer/verifier tests.
func AssignmentTicket ¶ added in v0.3.0
func AssignmentTicket() (*AssignmentTicketFile, error)
AssignmentTicket strictly parses the embedded standalone qat1 artifact.
func ParseAssignmentTicketFile ¶ added in v0.3.0
func ParseAssignmentTicketFile(data []byte) (*AssignmentTicketFile, error)
ParseAssignmentTicketFile strictly parses and structurally validates the qat1 artifact. Cryptographic byte identity is checked independently by tools/verify-assignment-ticket.
type AssignmentTicketGolden ¶ added in v0.3.0
type AssignmentTicketGolden struct {
EnvironmentID string `json:"environment_id"`
VerifyAtUnix int64 `json:"verify_at_unix"`
ClockUnix int64 `json:"clock_unix"`
JTIRandomHex string `json:"jti_random_hex"`
SyntheticECDSANonceHex string `json:"synthetic_ecdsa_nonce_hex"`
SyntheticCredential string `json:"synthetic_presented_credential"`
ClaimsJSON string `json:"claims_json"`
ClaimsUTF8Hex string `json:"claims_utf8_hex"`
ClaimsB64URL string `json:"claims_b64url"`
SigningPreimageHex string `json:"signing_preimage_hex"`
SigningDigestHex string `json:"signing_digest_hex"`
KMSSignatureDERHex string `json:"kms_signature_der_hex"`
KMSSignatureDERB64 string `json:"kms_signature_der_b64"`
RawLowSSignatureHex string `json:"raw_low_s_signature_hex"`
SignatureB64URL string `json:"signature_b64url"`
Token string `json:"token"`
LRTBodyTemplate string `json:"lrt_body_template"`
TicketMarker string `json:"ticket_marker"`
NHPPacketOverheadBytes int `json:"nhp_packet_overhead_bytes"`
LRTBodyBytes int `json:"lrt_body_bytes"`
CompleteNHPPacketBytes int `json:"complete_nhp_packet_bytes"`
}
AssignmentTicketGolden is the single complete positive cryptographic vector.
type AssignmentTicketJWK ¶ added in v0.3.0
type AssignmentTicketJWK struct {
Kty string `json:"kty"`
Crv string `json:"crv"`
X string `json:"x"`
Y string `json:"y"`
}
AssignmentTicketJWK is the public half of the synthetic P-256 key.
type AssignmentTicketRepeatDerivation ¶ added in v0.3.0
type AssignmentTicketRepeatDerivation struct {
Target string `json:"target"`
ASCIIChar string `json:"ascii_char"`
Count int `json:"count"`
}
AssignmentTicketRepeatDerivation specifies an exact large ASCII input without inflating all three published package copies.
type AssignmentTicketSyntheticKey ¶ added in v0.3.0
type AssignmentTicketSyntheticKey struct {
KID string `json:"kid"`
Curve string `json:"curve"`
PrivateScalarHex string `json:"private_scalar_hex"`
PublicKeySPKIDERB64 string `json:"public_key_spki_der_b64url"`
JWK AssignmentTicketJWK `json:"jwk"`
}
AssignmentTicketSyntheticKey is public test-only signing material. It must never be used outside conformance tests.
type AssignmentTicketTrustReject ¶ added in v0.3.0
type AssignmentTicketTrustReject struct {
Name string `json:"name"`
RejectClass string `json:"reject_class"`
Reason string `json:"reason"`
PublicKeySPKIDERB64 string `json:"public_key_spki_der_b64url"`
}
AssignmentTicketTrustReject freezes invalid verifier-key inputs.
type AssignmentTicketVerifyReject ¶ added in v0.3.0
type AssignmentTicketVerifyReject struct {
Name string `json:"name"`
RejectClass string `json:"reject_class"`
Reason string `json:"reason"`
ClaimsB64URL string `json:"claims_b64url,omitempty"`
SignatureB64URL string `json:"signature_b64url,omitempty"`
Token string `json:"token,omitempty"`
ExpectedEnvironmentID string `json:"expected_environment_id"`
TrustedKID string `json:"trusted_kid"`
VerifyAtUnix int64 `json:"verify_at_unix"`
Derivation *AssignmentTicketRepeatDerivation `json:"derivation,omitempty"`
}
AssignmentTicketVerifyReject drives the complete verifier. Empty source fields inherit the golden claims/signature; explicit fields are used verbatim.
func (AssignmentTicketVerifyReject) ResolveToken ¶ added in v0.3.0
func (c AssignmentTicketVerifyReject) ResolveToken(g AssignmentTicketGolden) (string, error)
ResolveToken returns the exact verifier input for a reject vector.
type ConformanceClass ¶
type ConformanceClass struct {
EntryPoint string `json:"entry_point"`
Input string `json:"input"`
Comment string `json:"comment"`
Vectors []ConformanceVector `json:"vectors"`
}
ConformanceClass is one named class: an entry-point label, the input field name, an optional human comment, and the ordered vectors.
type ConformanceFile ¶
type ConformanceFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
SourceOfTruth string `json:"source_of_truth"`
Notes []string `json:"notes"`
SignatureClass ConformanceSignatureClass `json:"signature_class"`
Classes map[string]ConformanceClass `json:"classes"`
}
ConformanceFile is the top-level conformance artifact document.
func ConformanceVectors ¶
func ConformanceVectors() (*ConformanceFile, error)
ConformanceVectors strictly parses the embedded qURL v2 conformance artifact into a typed document, returning an error if it is malformed or is not the expected artifact.
func ParseConformanceFile ¶
func ParseConformanceFile(data []byte) (*ConformanceFile, error)
ParseConformanceFile strictly parses the conformance artifact from raw bytes. It returns an error (never an empty/zero document) when the bytes are malformed or are not the qURL v2 conformance artifact, so a consumer test FAILS rather than silently skipping or misreading the contract. DisallowUnknownFields keeps a typo'd or stale schema field from being ignored.
type ConformanceSignatureClass ¶
type ConformanceSignatureClass struct {
EntryPoint string `json:"entry_point"`
Composes string `json:"composes"`
Comment string `json:"comment"`
// TamperDerivation specifies the derived payload-tamper reject. It is optional
// in the schema's struct but consumers assert it is present and well-formed.
TamperDerivation *ConformanceTamperDerivation `json:"tamper_derivation,omitempty"`
}
ConformanceSignatureClass records that the signature class is composed from a separate file rather than carrying its own bytes, plus the language-agnostic payload-tamper derivation every consumer synthesizes from the composed file's accept vector (so the tamper negative is portable without a second copy of signature bytes).
type ConformanceTamperDerivation ¶
type ConformanceTamperDerivation struct {
RejectClass string `json:"reject_class"`
Comment string `json:"comment"`
DeriveFrom string `json:"derive_from"`
ClaimsTransform string `json:"claims_transform"`
}
ConformanceTamperDerivation specifies how a consumer derives the payload-tamper reject from the composed signature file's accept vector. It is a derivation, not stored bytes, so every consumer synthesizes the SAME negative.
- RejectClass: the reject_class label for the derived case ("tamper").
- DeriveFrom: which composed vector to start from ("accept_vector").
- ClaimsTransform: the transform applied to that vector's claims_b64 to make the signature no longer valid over it ("flip_first_base64url_char_A_B": flip the FIRST base64url character between 'A' and 'B'). The signature bytes are reused UNCHANGED, so the case fails only at the curve check.
type ConformanceVector ¶
type ConformanceVector struct {
Name string `json:"name"`
Expect string `json:"expect"`
RejectClass string `json:"reject_class"`
Reason string `json:"reason"`
// claims_parse / secret_parse: raw JSON text fed directly to the parser.
ClaimsJSON string `json:"claims_json"`
SecretJSON string `json:"secret_json"`
// strict_base64: the base64url string verbatim.
ValueB64 string `json:"value_b64"`
// fragment: a full fragment body.
Fragment string `json:"fragment"`
// relay_allowlist: the allowlist entries and the URL to validate.
Entries []string `json:"entries"`
URL string `json:"url"`
// server_id: the cell public key (base64url) and its expected routing id.
CellPublicKeyB64 string `json:"cell_public_key_b64"`
ServerID string `json:"server_id"`
}
ConformanceVector is one case. Only the fields relevant to a vector's class are populated; the loader does not interpret them — the consumer routes each class to the matching entry point and reads the fields that class uses.
type ECPublicJWK ¶
type ECPublicJWK struct {
Kty string `json:"kty"`
Crv string `json:"crv"`
X string `json:"x"`
Y string `json:"y"`
}
ECPublicJWK is a minimal P-256 public-key JWK. x and y are fixed-width 32-byte base64url (leading zeros preserved) so a strict importer accepts them.
type IssuerKeyMaterial ¶
type IssuerKeyMaterial struct {
KID string `json:"kid"`
// SPKIDERB64 is the DER SPKI public key, base64url.
SPKIDERB64 string `json:"spki_der_b64"`
// JWK is the same public key as a P-256 JWK (crv/x/y), for WebCrypto "jwk".
JWK ECPublicJWK `json:"jwk"`
}
IssuerKeyMaterial is the issuer public key in both import forms.
type RelayKnockCase ¶ added in v0.1.1
type RelayKnockCase struct {
// ServerStaticPrivHex / ServerStaticPubHex are the server static X25519 key.
// The knock case carries both; the ack case carries only the public half.
ServerStaticPrivHex string `json:"server_static_priv_hex,omitempty"`
ServerStaticPubHex string `json:"server_static_pub_hex"`
// DeviceStaticPrivHex / DeviceStaticPubHex are the initiator (device) static
// X25519 key, used by the knock case.
DeviceStaticPrivHex string `json:"device_static_priv_hex,omitempty"`
DeviceStaticPubHex string `json:"device_static_pub_hex,omitempty"`
// AgentStaticPrivHex is the agent (responder-side decryptor) static private
// X25519 key, used by the ack case to open the reply. It is the same key as the
// knock case's device_static_priv_hex.
AgentStaticPrivHex string `json:"agent_static_priv_hex,omitempty"`
// EphemeralPrivHex is the fixed initiator ephemeral private key the knock case
// seals under (so the knock packet is deterministic).
EphemeralPrivHex string `json:"ephemeral_priv_hex,omitempty"`
// TimestampNanos is the handshake timestamp, decimal string (exceeds 2^53).
TimestampNanos string `json:"timestamp_nanos"`
// Counter is the knock counter as a decimal string.
Counter string `json:"counter,omitempty"`
// CounterHex is the ack counter as a hex string (no 0x prefix, no padding).
CounterHex string `json:"counter_hex,omitempty"`
// PreambleHex is the 32-bit knock preamble as a hex string.
PreambleHex string `json:"preamble_hex,omitempty"`
// BodyHex is the plaintext body the case carries, hex-encoded.
BodyHex string `json:"body_hex"`
// PacketHex is the full wire packet, hex-encoded: for knock, the value a
// conformant BuildKnock must reproduce; for ack, the frozen value a conformant
// DecryptReply must open.
PacketHex string `json:"packet_hex"`
}
RelayKnockCase is one golden packet (knock or ack). Every value is the exact hex (or, for the numeric fields, the stringified value) the case uses; only the fields relevant to a given case are populated. All fields are strings — including timestamp_nanos, which exceeds 2^53 and so is carried as a decimal string rather than a JSON number.
type RelayKnockFile ¶ added in v0.1.1
type RelayKnockFile struct {
Artifact string `json:"artifact"`
SchemaVersion int `json:"schema_version"`
Description string `json:"description"`
SourceOfTruth string `json:"source_of_truth"`
Notes []string `json:"notes"`
Knock RelayKnockCase `json:"knock"`
Ack RelayKnockCase `json:"ack"`
}
RelayKnockFile is the top-level relay/NHP-handshake golden artifact: a deterministic knock packet a conformant initiator must reproduce byte-for-byte, plus a frozen ack reply (sealed at origin with a random server ephemeral, so it is NOT reproducible by a client — only decryptable). Both cases decode into the same RelayKnockCase, which carries the UNION of the fields either case uses.
func ParseRelayKnockFile ¶ added in v0.1.1
func ParseRelayKnockFile(data []byte) (*RelayKnockFile, error)
ParseRelayKnockFile strictly parses the relay-knock golden artifact from raw bytes. It returns an error (never an empty/zero document) when the bytes are malformed or are not the relay-knock artifact, so a consumer test FAILS rather than silently skipping or misreading the contract. DisallowUnknownFields keeps a typo'd or stale schema field from being ignored.
func RelayKnockGolden ¶ added in v0.1.1
func RelayKnockGolden() (*RelayKnockFile, error)
RelayKnockGolden strictly parses the embedded relay/NHP-handshake golden artifact into a typed document, returning an error if it is malformed or is not the expected artifact.
type SignatureVector ¶
type SignatureVector struct {
Name string `json:"name"`
// Expect is "accept" or "reject".
Expect string `json:"expect"`
// RejectClass is the machine-readable rejection class. It is present on reject
// vectors and absent on accept vectors.
RejectClass string `json:"reject_class,omitempty"`
// Reason documents why in human-readable prose.
Reason string `json:"reason"`
// ClaimsB64 is the exact base64url claims string (primary verify input).
ClaimsB64 string `json:"claims_b64"`
// SigB64Raw is the signature as base64url. For accept/high-S it is 64-byte
// raw r||s; for the wrong-length case it is the DER form (the realistic
// "passed signer output straight through" mistake).
SigB64Raw string `json:"sig_b64"`
// SigEncoding documents the signature's byte form ("raw_r_s" or "der").
SigEncoding string `json:"sig_encoding"`
// SigningInputB64 is a cross-check value a verifier reconstructs itself as
// prefix + 0x00 + claims_b64; it is not the data fed to the verifier.
SigningInputB64 string `json:"signing_input_b64"`
}
SignatureVector is one accept-or-reject case.
type VectorFile ¶
type VectorFile struct {
// Description documents the contract for a human reader of the JSON.
Description string `json:"description"`
// Algorithm pins the signing profile (informational; verifiers do not
// negotiate).
Algorithm string `json:"algorithm"`
// DomainSeparationPrefix is the ASCII prefix; the 0x00 separator follows it.
DomainSeparationPrefix string `json:"domain_separation_prefix"`
// Issuer is the shared issuer key all vectors are signed/verified under.
Issuer IssuerKeyMaterial `json:"issuer"`
// Vectors is the ordered list of accept/reject cases.
Vectors []SignatureVector `json:"vectors"`
}
VectorFile is the top-level committed issuer-signature fixture document. The signature class of the conformance artifact composes this file by reference.
func ParseVectorFile ¶
func ParseVectorFile(data []byte) (*VectorFile, error)
ParseVectorFile strictly parses an issuer-signature vector file from raw bytes. It returns an error (never an empty/zero document) if the bytes are malformed, so a consumer test FAILS rather than silently skipping the contract.
func SignatureVectors ¶
func SignatureVectors() (*VectorFile, error)
SignatureVectors strictly parses the embedded issuer-signature vector file into a typed document, returning an error if it is malformed.
Directories
¶
| Path | Synopsis |
|---|---|
|
tools
|
|
|
verify-assignment-ticket
command
Command verify-assignment-ticket independently checks the committed qat1 cryptographic bytes using only the Go standard library.
|
Command verify-assignment-ticket independently checks the committed qat1 cryptographic bytes using only the Go standard library. |