While walking a certification path, what does a verifier check in each CA certificate about its authority to issue the next one?
answer
- entitlement checked at every hop
- cA TRUE or the hop is rejected
- keyCertSign when keyUsage is present
- decrement, then clamp to the smaller
- zero with a CA still to come rejects
basics
~10 sThree things per hop: basicConstraints present with cA set to TRUE, keyCertSign asserted if a keyUsage extension is present at all, and pathLenConstraint, which caps how many non-self-issued certificates may still follow.
solid answer
~50 sEvery certificate above the end-entity has to be entitled to issue the one below it, and the walk enforces that hop by hop. For the version 3 certificates in play, `basicConstraints` must be present with `cA` set to TRUE, so a leaf certificate cannot be pressed into service as an issuer. If `keyUsage` is present, `keyCertSign` must be asserted, so a key certified only for signing data cannot sign certificates. `pathLenConstraint`, meaningful only alongside `cA` TRUE, caps the number of non-self-issued intermediates that may still follow: the algorithm carries a `max_path_length` counter, decrements it at each non-self-issued certificate and clamps it whenever a smaller `pathLenConstraint` appears. Reaching zero with another CA certificate still to process rejects the path. `nameConstraints` in a CA certificate separately limits, per name form, the names anything beneath it may carry.
code
pseudocode · 16 linesmax_path_length = length(path) -- certificates below the anchor
for each cert in path ordered anchor -> end_entity:
if cert is not the end-entity certificate:
if cert.basicConstraints is absent or cert.basicConstraints.cA != TRUE:
reject -- not entitled to issue below itself
if cert.keyUsage is present and keyCertSign not asserted:
reject -- key not certified for signing certificates
if cert is not self-issued: -- issuer and subject names differ
if max_path_length == 0: reject
max_path_length = max_path_length - 1
if cert.basicConstraints.pathLenConstraint is present
and cert.basicConstraints.pathLenConstraint < max_path_length:
max_path_length = cert.basicConstraints.pathLenConstraintgo deeper
Know that not every certificate is allowed to sign another one, and that the permission is written inside the certificate by the authority above it rather than decided by whoever is checking.
Explain the three per-hop checks - cA TRUE, keyCertSign when keyUsage is present, and the pathLenConstraint cap - and say which of them are meaningful only in a CA certificate.
Show that you read a rejection as evidence. A path that fails on depth points at an authority's delegation rather than at the client, and the repair sits upstream of the certificate you were handed.
Constraints are the only leverage you keep over an authority you delegate to. Decide the depth and the name space a subordinate gets before it exists, because tightening either later invalidates everything already issued beneath it.
## Entitlement is checked at every hop, not once A signature that verifies proves only that the holder of a key produced it. It says nothing about whether that party was *entitled* to sign a certificate. Path validation therefore checks authority separately, at each certificate above the end-entity, and it reads that authority out of the certificate itself - written there by the issuer above, not decided by the verifier. Three checks carry the weight. **`basicConstraints` with `cA` TRUE.** For version 3 certificates the extension must be present and the boolean set, otherwise the certificate may not issue the one below it. This is what stops an ordinary end-entity certificate from being used as an issuing authority - the single most consequential structural check in the whole algorithm. **`keyUsage` asserting `keyCertSign`.** The extension need not be present, but if it is, the algorithm requires `keyCertSign` to be asserted. A key marked for `digitalSignature` over data, or for `cRLSign` only, cannot sign certificates. The extension can therefore narrow authority but never widen it. **`pathLenConstraint`.** Carried inside `basicConstraints` and meaningful only when `cA` is TRUE, it states the maximum number of non-self-issued intermediate certificates that may follow that certificate on a valid path. ## How the depth counter actually moves The algorithm maintains a `max_path_length` counter, initialised to the path length, and for each certificate it processes: 1. if the certificate is **not self-issued**, the counter is decremented - and if it was already zero, the path is rejected; 2. if the certificate carries a `pathLenConstraint` **smaller** than the current counter, the counter is clamped down to it; 3. a larger `pathLenConstraint` lower down therefore cannot relax a tighter one set higher up. Two values are worth being exact about: | Value in a CA certificate | What it permits below that certificate | |---|---| | `pathLenConstraint` absent | unconstrained depth | | `pathLenConstraint` = 0 | end-entity certificates only, no further CA certificate | | `pathLenConstraint` = 1 | one more subordinate CA, and leaves beneath it | Note also that **self-issued** certificates - those whose `issuer` and `subject` are the same name - do not decrement the counter. That is what lets an authority certify its own new key without consuming depth, and it is distinct from *self-signed*, which is about the signature verifying under the certificate's own key. ## What a violation is evidence of This is the part that separates a candidate who has operated a hierarchy from one who has read about it. `pathLenConstraint` is set by an issuer **above**, and it binds everything beneath. A path rejected on depth is therefore not a client quirk and not a verifier bug: it is evidence that some authority issued a subordinate CA certificate deeper than its own certificate permitted. Every certificate on the path may be individually well formed, correctly signed and comfortably unexpired; the defect is in the *shape* of the hierarchy, and it sits upstream of whatever certificate was handed to you. The practical consequence is that the repair is never at the leaf. Reissuing the end-entity certificate changes nothing. Somebody above has to reissue with a constraint that accommodates the depth, or the delegation below has to be flattened. ## The other limit imposed downward `nameConstraints` restricts names rather than depth. Set in a CA certificate, it carries permitted and excluded subtrees limiting the `subject` and `subjectAltName` values that any certificate beneath it may carry. Three properties matter: - an excluded subtree wins over a permitted one - a name matching an exclusion is invalid regardless of what the permitted set says; - restrictions are stated **per name form**, so a limit written for `dNSName` does not by itself restrain a name of another form such as `iPAddress`; - the constraint binds the whole subtree beneath that certificate, not just the certificate directly below it. That combination is what makes name constraints the sharpest tool available for scoping a delegated authority - and the easiest to set in a way that binds less than the author intended, because the form nobody thought to constrain is the form nobody constrained. ## What to say in an interview Name the three per-hop checks, say which two live in `basicConstraints`, describe the counter's decrement-then-clamp behaviour, and finish with the diagnosis: a depth rejection points at the issuing hierarchy, not at the certificate in front of you.
- What does a path rejected on `pathLenConstraint` tell you about the authority that issued below it?That it issued a subordinate CA certificate it was not permitted to issue. The constraint is set by an issuer higher up and binds everything beneath it, so a violation is not a verifier quirk - it is evidence that a CA delegated deeper than its own certificate allows. The certificates may all be well formed and unexpired; the defect is in the hierarchy's shape, and the repair is upstream of the leaf.
- How do `nameConstraints` differ from `pathLenConstraint` as a limit imposed downward?`pathLenConstraint` limits the depth of delegation below a CA certificate; `nameConstraints` limits the names. A CA certificate carrying permitted or excluded subtrees restricts the `subject` and `subjectAltName` values any certificate beneath it may carry, and an excluded subtree wins over a permitted one. The restrictions are stated per name form, so a limit written for `dNSName` does not by itself restrain a name of another form.
- Does a self-issued intermediate count against the depth counter?No. The counter is decremented only for non-self-issued certificates, so a CA that certifies its own new key - `issuer` and `subject` identical - can appear on a path without consuming depth, which is what makes key rollover workable under a tight constraint. Self-issued is not the same as self-signed: it describes matching names, not a signature that verifies under the certificate's own key.
A delegated signing authority is like a power of attorney that states how far it may itself be sub-delegated: the holder may appoint someone, but the document says whether that someone may appoint anyone further.
saying these in an interview costs you the question
- Thinks any certificate may sign another as long as its key verifies.
- Reads pathLenConstraint as the total number of certificates in the path.
- Believes keyUsage is advisory and can never cause a path to be rejected.
- Treats a constraint violation as a client bug rather than a mis-issuance.
- Assumes basicConstraints only matters in the root certificate.