{
  "slug": "pem-der-convert",
  "name": "gizza-ai/pem-der-convert",
  "version": "0.1.0",
  "title": "PEM to DER & DER to PEM Converter — gizza.ai",
  "description": "Convert keys, certificates and CSRs between PEM (base64 text) and DER (binary, shown as hex or base64) in either direction. Runs in your browser, nothing uploaded, free.",
  "tags": [
    "pem to der",
    "der to pem",
    "convert certificate",
    "pem decode",
    "der encode",
    "x509 converter",
    "csr converter"
  ],
  "category": "security",
  "urls": {
    "page": "https://gizza.ai/tools/pem-der-convert/",
    "markdown": "https://gizza.ai/tools/pem-der-convert/index.md",
    "descriptor": "https://gizza.ai/tools/pem-der-convert/tool.json",
    "deep_link_example": "https://gizza.ai/tools/pem-der-convert/?input=-----BEGIN%20CERTIFICATE-----...&direction=auto&der_format=hex&label=CERTIFICATE"
  },
  "cli": "gizza tool pem-der-convert \"-----BEGIN CERTIFICATE-----...\"",
  "tool": {
    "description": "Convert cryptographic objects (keys, certificates, CSRs, CRLs) between PEM and DER encodings in either direction. PEM is the base64 text format wrapped in -----BEGIN <label>----- armor; DER is the raw binary ASN.1 form, shown/accepted here as hex or base64. Direction defaults to auto (detects PEM vs DER from the input); set pem-to-der to parse a PEM block (or a multi-block chain) and output each block's DER bytes + detected label, or der-to-pem to wrap DER bytes — supplied via der_format as hex or base64 — into a PEM block with the given label. This is a generic re-encoder: it does not parse the inner ASN.1, so it works for any object type.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "der_format": {
          "default": "hex",
          "description": "How DER binary is represented as text — both for the DER output (pem-to-der) and the DER input (der-to-pem). hex (default) or base64.",
          "enum": [
            "hex",
            "base64"
          ],
          "type": "string"
        },
        "direction": {
          "default": "auto",
          "description": "Which way to convert: auto (default) detects PEM vs DER from the input; pem-to-der parses PEM and outputs DER; der-to-pem wraps DER bytes back into a PEM block.",
          "enum": [
            "auto",
            "pem-to-der",
            "der-to-pem"
          ],
          "type": "string"
        },
        "input": {
          "description": "The object to convert: a PEM block (-----BEGIN ...-----) for pem-to-der, or DER bytes as hex/base64 for der-to-pem.",
          "type": "string"
        },
        "label": {
          "default": "",
          "description": "PEM label to use when direction is der-to-pem (e.g. CERTIFICATE, PRIVATE KEY, EC PRIVATE KEY, CERTIFICATE REQUEST). Ignored for pem-to-der (the label is read from the input). Defaults to CERTIFICATE if blank.",
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}