Skip to content
CRDCA.CA for agents
ESEN

Verification codes

The verifier's fifteen codes, the step that emits them and what to do with each.

The verifier does not say "valid" or "invalid": it returns the list of reasons, and every reason carries a code, the step that emitted it, the concrete form of the failure and a readable detail. The caller decides from the code, not from the text. There are fourteen algoritmo-v1 codes (R01 to R14), plus R15 on the federated route.

Steps

The steps are the middleware's: one preparation step and the eight steps of the algorithm. Except for step 1, which is the preparation, step N equals step N-1 in the contract's eight-step numbering; on the federated route the anchor takes step 9 and the result becomes step 10.

StepWhat it doesCodes
1prepare the verification and read the status from the cacheR12
2take the signature with an allowed alg and the key inside x5cR01, R02, R03
3canonicalize with JCS and validate the JWSR04
4validate the x5c chain and the conformance of the leafR05, R06
5require SAN URI equal to the origin URL and a proven originR07, R08
6require validity and an inclusion proof bound to the cardR09, R10, R11
7query the status list by its three indicesR12
8validate the mandate and its issuer when the action asks for itR13, R14
9require a valid CRDCA anchor for the federated log the card declaresR15
10return agent_id, operador, nivel, motivos, limites_verificados and mandatonone

Step 9 only exists on the federated route, when the card declares a log that is not CRDCA's; without a foreign log the verification ends at step 8 and returns at step 9.

Output

A blocked result looks like this (excerpt):

{
  "aceptada": false,
  "bloqueada": true,
  "modo": "bloquear",
  "agent_id": "https://example.com/agents/invoices/agent-card.json",
  "operador": "example.com",
  "nivel": 0,
  "nivel_firma": "",
  "motivos": [
    {
      "id": "R08_ORIGIN_UNPROVEN",
      "codigo": "R08",
      "paso": 5,
      "detalle": "la URL de origen no está probada en esta verificación",
      "forma": null
    }
  ],
  "limites_verificados": "por-solicitud",
  "mandato": null,
  "codigos": ["R08"],
  "llamadas_en_linea": 0
}

codigos is the deduplicated list of emitted codes, in the order they appeared. pasos carries the trace of every executed step, with its decision and its result.

Modes

ModeContract aliasWhat it does with a reason
bloquearestrictothe first rejection stops the verification and the call does not pass
advertirtolerantecollects every reason, the call passes and the result is recorded

Both modes enumerate the fourteen v1 codes, so the library takes twenty-eight code decisions. R15 lives outside that frozen block: it belongs to federation.

Codes

CodeNameMeaningStepWhat to do
R01ALG_NOT_ALLOWEDthe signature alg is not in the list: EdDSA, ES256 and, from v2, ML-DSA-652Reject. The issuer must re-sign with an allowed algorithm
R02KEY_SOURCE_NOT_X5Cthe key does not come from x5c, or the header carries jku, jwk, x5u or crit2Reject. The key is not looked up anywhere else
R03KID_MISMATCHkid is not the SHA-256 thumbprint of the SPKI of x5c[0]2Reject. kid is recomputed, never trusted
R04SIGNATURE_INVALIDthe JWS is malformed, the payload is not the canonical JCS card, or the signature does not verify3Reject. If the detail is the missing signature tool, retry on a node with openssl and alert
R05CHAIN_UNTRUSTEDthe x5c chain does not end in a valid root of the trust package, or there is a broken link, a revocation or an invalid signature4Reject. Retry only when the package or the revocation was unavailable: reload and repeat
R06HOJA_NO_CONFORMEx5c[0] is a CA, lacks its profile EKU, leaves its issuer's namespace or outlives its issuer4Reject and alert the issuer: the defect is in the certificate, not in the call
R07SAN_MISMATCHthe certificate SAN URI is not equal to the origin URL, or the leaf does not carry exactly one https URI5Reject and alert the operator: the card must be issued with the right URL
R08ORIGIN_UNPROVENthe origin URL was not proven by fetching the card in this verification5Retry the fetch and verify again; if it repeats, reject
R09NOT_VALID_NOWthe leaf certificate is not valid at the verification instant6Reject. The issuer renews through ARI at half life
R10INCLUSION_MISSINGthere is no valid inclusion proof: it is missing, it belongs to another tree size, the checkpoint goes backwards or it is stale6Reject if missing or invalid; retry after reloading the checkpoint when the problem is its freshness or availability
R11INCLUSION_MISMATCHthe proof is valid against the log but comes from another leaf6Reject and alert: a proof from another card is a reuse attempt
R12STATUS_SUSPENDEDthe status list marks the class, the platform or the operator as suspended, or there is no usable copy1, 7Reject when suspended or when there is no row; if the copy is stale or the publisher does not respond, reload and retry
R13MANDATE_INVALIDthe action asks for a mandate and none was presented, or the mandate is not valid8Reject and ask the human for a new mandate
R14MANDATE_ISSUER_UNTRUSTEDthe mandate issuer is not in the verifier's admitted issuer list8Reject and escalate: the list belongs to the verifier, not to the mandate issuer
R15LOG_NO_ANCLADOthe foreign log the card declares has no valid CRDCA anchor binding its checkpoint9Reject. Retry only when the anchor was unavailable or expired; alert if it belongs to another operator or another checkpoint

Forms

The concrete form travels in forma and distinguishes cases of the same code. An empty or null form is the general case.

CodeFormsWhat it distinguishes
R01pqthe post-quantum complementary signature is superfluous or declares a disallowed alg
R02pqthe post-quantum key in crdca_pq is missing or unreadable
R04pqthe complementary signature does not verify; the signature level is left empty
R05x5c_vacio, cadena_incompleta, der_invalidothe header carries no x5c, fewer than two elements, or an unreadable certificate
R05paquete_vencido, paquete_no_disponible, revocacion_no_disponiblea verifier input is missing: retryable
R05revocado, eslabon_roto, firma_no_verificable, firma_invalida, raiz_no_confiada, fuera_de_vigenciathe chain is not trusted
R06ca, eku, name_constraints, vida, ilegiblethe leaf is a CA, lacks the profile EKU, leaves its issuer, outlives it, or cannot be read
R10ausente, sin_checkpoint, checkpoint, tamano, checkpoint_vencido, canonica, invalidathe proof is missing, the checkpoint is missing, it goes backwards, it belongs to another tree, it is stale, the card cannot be canonicalized, or the proof does not validate
R11otra_hojathe proof comes from another leaf
R12vencida, sin_respuesta, sin_fila, suspendidothe copy is outside the window, the publisher does not respond, there is no row for the index, or the row is suspended
R15sin_ancla, caducada, otro_operador, trasplantada, checkpoint_ajeno, ancla_invalidathere is no anchor, it is outside its window, it belongs to another operator, it does not bind the checkpoint, the card attaches no checkpoint, or the anchor is invalid

Levels

LevelMeaning
0chain and origin proven; inclusion or status is not proven
1plus a valid inclusion proof and fresh status in cache
2plus the action asks for a mandate and the mandate verifies

limites_verificados is always por-solicitud: the mandate limits are checked per request, with no shared state that could accumulate amounts across mandates.