Create OCSP request (RFC 6960 DER, SHA-1 or SHA-256 CertID, nonce)
create_ocsp_requestBuilds a DER OCSP request to ask a responder for a certificate's revocation status, computing the CertID from the issuing CA and optionally adding a nonce.
Instructions
Build the DER OCSPRequest (RFC 6960 §4.1) asking a responder for the status of certificate, identified by the CertID computed from issuer (the CA that issued it — its name and key hashes) and the serial. hashAlgorithm 'SHA-1' (default, the engine default and what every responder answers) or 'SHA-256' (recommended where the responder supports it). nonce adds the RFC 8954 nonce extension: 'random' (16 bytes from node:crypto, summary.randomNonce:true) or your own hex (1–32 bytes); keep summary.nonceHex to demand it back with check_ocsp_status. certIdOnly:true returns the bare CertID (der / hex). This server never sends anything: POST the bytes yourself (Content-Type application/ocsp-request) to the URL in the certificate's authorityInfoAccess (inspect_certificate), then judge the answer with check_ocsp_status { response, certificate, issuer, nonce }. summary.certIdHex is the CertID to match in the response. Output DER (default, .orq), PEM or hex, inline or as a sandbox file (never overwritten).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | The PEM label for encoding:'pem' (default OCSP REQUEST; upper-case words and digits). A private-key label is refused. | |
| nonce | No | The RFC 8954 nonce extension: 'random', or hex of 1–32 bytes. Omitted: no nonce. Keep summary.nonceHex to match the response (check_ocsp_status nonce). | |
| issuer | Yes | The CA certificate that issued it (its name and key are hashed into the CertID): exactly one of pem / derBase64 / path. | |
| 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 |
| encoding | No | Artefact encoding: 'pem' (RFC 7468 text), 'der' (raw bytes), 'hex' (lowercase hex in structuredContent, inline only, ≤ 64 KiB). Default 'der'. | der |
| certIdOnly | No | Return the bare DER CertID (RFC 6960 §4.1.1) instead of the request (der or hex only — a CertID has no PEM label). | |
| outputMode | No | 'base64' (default) returns the artefact inline as an embedded resource (≤ 50 MiB). 'file' writes it inside PKINATIVE_MCP_OUTPUT_DIR (never overwrites; ≤ 1 GiB) and returns a resource_link. | base64 |
| outputPath | No | Relative path inside the sandbox (only when outputMode='file'); the extension must match the encoding (.orq .der .bin for der). Key-bearing extensions (.key .p8 .p12 .pfx) are refused: nothing here writes a private key. | |
| certificate | Yes | The certificate whose status to ask for: exactly one of pem / derBase64 / path. | |
| encodingRules | No | 'der' (strict X.690 DER, default) or 'ber' (indefinite / non-minimal lengths and constructed strings, as legacy CMS producers write). | der |
| hashAlgorithm | No | The CertID hash. 'SHA-1' (default — the engine default and what every responder answers; RFC 6960 §4.3) or 'SHA-256' (recommended, RFC 6960 §4.3 / RFC 5019 note: some responders still answer SHA-1 only). | SHA-1 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | No | The artefact as lowercase hex (when encoding='hex'). | |
| mode | Yes | ||
| sha256 | Yes | SHA-256 of the DER bytes (lowercase hex) — the reproducibility proof. | |
| summary | Yes | ||
| encoding | Yes | ||
| filePath | No | Sandboxed absolute path (when outputMode='file'). | |
| sizeBytes | Yes | Size of the DER artefact. | |
| diagnostics | Yes | Non-fatal concerns the engine raised (PKI_DIAG_*, de-duplicated, at most 200; explain_code explains one). | |
| diagnosticCounts | Yes | Occurrences per diagnostic code. | |
| diagnosticsTruncated | No | true when distinct diagnostics beyond the 200 listed were dropped. |