Check certificate name (RFC 6125 host / IP identity, or one name match)
check_certificate_nameChecks whether an X.509 certificate is valid for a hostname or IP under RFC 6125, or compares a presented DNS name against a reference name. Returns a match verdict with mismatch reasons.
Instructions
The RFC 6125 identity verdict, two forms. Certificate form: certificate + exactly one of host (DNS name as it appeared in the URL) / ip — is the certificate valid for that identity (subjectAltName dNSName / iPAddress; wildcards under allowWildcards, default true; allowCommonNameFallback, default false, reads a CN-only certificate's commonName and then needs chain — the issuing CAs, leaf's issuer first — so the CN is held to their dNSName name constraints as a SAN would be). Match form: presented (the certificate's dNSName, possibly a wildcard) + reference — one RFC 6125 §6.4 name comparison, no certificate. A negative verdict is valid:false + reasons[] (PKI_REASON_NAME_MISMATCH, …) in structuredContent — never isError. The name only: it is not trust (verify_certificate_chain with serverName is the full verdict), not validity, not revocation. Token-frugal: verbosity:'summary'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | The reference IPv4 or IPv6 address. Exclusive with host. | |
| host | No | The reference DNS name as it appeared in the URL (one trailing dot is ignored). Exclusive with ip. | |
| chain | No | The issuing certificates, leaf's issuer first (every PEM block of every item is taken). Optional; read only by the commonName fallback, which holds a CN read as a host name to the dNSName name constraints of these CAs (without it the fallback refuses). | |
| fields | No | Dot-paths to keep after verbosity (arrays map over elements); unmatched paths land in _meta.unmatchedFields. | |
| limits | No | Raise pkinative's 22 named security bounds for this call (trusted input only; absent keys keep the engine defaults). A value above an operator ceiling (PKINATIVE_MCP_MAX_INPUT_BYTES, PKINATIVE_MCP_MAX_KDF_ITERATIONS, PKINATIVE_MCP_MAX_PATHS_EXPLORED) is LIMIT_CEILING_EXCEEDED; describe_engine lists the defaults and the ceilings. | |
| strict | No | Escalate the first engine warning to a PKI_STRICT_DIAGNOSTIC error instead of listing it in diagnostics[]. | |
| pemMode | No | 'strict' (RFC 7468 exactly, default) or 'lax' (tolerates whitespace, line length and RFC 1421 headers). | strict |
| presented | No | Match form: the certificate's dNSName, possibly a wildcard. With reference; exclusive with certificate / host / ip / chain. | |
| reference | No | Match form: the reference host name. | |
| verbosity | No | 'summary' keeps the scalar fields only (token-frugal). | full |
| certificate | No | The certificate to judge (certificate form): exactly one of pem / derBase64 / path. With exactly one of host / ip. Exclusive with presented / reference. | |
| encodingRules | No | 'der' (strict X.690 DER, default) or 'ber' (indefinite / non-minimal lengths and constructed strings, as legacy CMS producers write). | der |
| allowWildcards | No | Accept a wildcard name (*.example.test) at all. Default true; false is right for an internal PKI that issues none. | |
| allowCommonNameFallback | No | Fall back to the subject commonName when the certificate carries no dNSName and no iPAddress (CA/Browser Forum forbids CN-only certificates since 2017; needs chain). Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form | No | ||
| match | No | Match form: whether presented matches reference. | |
| valid | No | The verdict (the match outcome in the match form). false is a negative verdict, never an error. | |
| reasons | No | Why the verdict is negative (empty when valid): the engine PKI_REASON_* codes, each with the standard it cites and the path of the offending element. A reason is returned, never thrown. | |
| subject | No | Certificate form: RFC 4514 subject of the certificate. | |
| presented | No | Match form: the presented name. | |
| reference | No | The reference identity judged. | |
| diagnostics | No | Non-fatal concerns the engine raised (PKI_DIAG_*, de-duplicated, at most 200; explain_code explains one). | |
| reasonCodes | No | ||
| diagnosticCount | No | ||
| diagnosticCounts | No | Occurrences per diagnostic code. | |
| diagnosticsTruncated | No | true when distinct diagnostics beyond the 200 listed were dropped. |