{"id":"pem-envelope-validate","version":"1.0.0","description":"Check one RFC 7468 PEM envelope for labels, whitespace, and strict base64.","supported_operations":["validate pem envelope framing","check that pem begin and end labels match","is this pem message well formed","report why a pem block is rejected","check rfc 7468 base64 and whitespace","pem syntax check without trusting contents"],"unsupported_operations":["assert that the bytes are a real certificate or key","repair a mismatched end label","accept lax text that ignores non-base64 characters"],"semantics":["Well-typed text that fails Figure 1 returns {valid:false, reason}. Wrong types, unknown fields, lone surrogates, and declared limits throw. This is the opposite of pem-envelope-parse, which throws on the same syntax errors and returns the hex.","On success the result is the label, the decoded byte count, whether the text is the Figure 3 canonical rendering, and the newline class (lf, crlf, cr, or mixed). The hex payload is not returned.","Labels must match exactly, including case. \"X509 CERTIFICATE\" stays that label; it is not rewritten or accepted as \"CERTIFICATE\". Registered names in RFC 7468 section 4 are not required.","Whitespace is Figure 1: SP and HTAB are ignored throughout the encoded text, including between base64 characters; CR, LF, and CRLF delimit lines. VT, FF, and explanatory prose before BEGIN are reasons, not repaired input.","Strict base64 requires alphabet A-Za-z0-9+/, padding that completes a multiple of 4, and zero unused bits. A label above 64 bytes is limit_exceeded, checked before the body is decoded, so a too-long label is never copied into a successful result.","Text above 8192 UTF-8 bytes is limit_exceeded before the scan. A grammar failure inside that bound is valid:false, not an exception.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_text_bytes":8192,"max_label_bytes":64,"max_output_bytes":512},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":0,"maxLength":8192}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid"],"properties":{"valid":{"type":"boolean"},"label":{"type":"string","minLength":0,"maxLength":64,"pattern":"^(?:[\\x21-\\x2C\\x2E-\\x7E](?:[ \\x2D]?[\\x21-\\x2C\\x2E-\\x7E])*)?$"},"byte_length":{"type":"integer","minimum":0,"maximum":8192},"canonical":{"type":"boolean"},"eol":{"type":"string","enum":["lf","crlf","cr","mixed"]},"reason":{"type":"string","enum":["missing_begin","extraneous_text","bad_begin_line","label_grammar","bad_end_line","label_mismatch","missing_end","blank_in_base64","bad_whitespace","bad_base64","bad_padding","non_canonical_base64","non_ascii"]}},"oneOf":[{"type":"object","additionalProperties":false,"required":["valid","label","byte_length","canonical","eol"],"properties":{"valid":{"const":true},"label":{"type":"string","minLength":0,"maxLength":64,"pattern":"^(?:[\\x21-\\x2C\\x2E-\\x7E](?:[ \\x2D]?[\\x21-\\x2C\\x2E-\\x7E])*)?$"},"byte_length":{"type":"integer","minimum":0,"maximum":8192},"canonical":{"type":"boolean"},"eol":{"type":"string","enum":["lf","crlf","cr","mixed"]}}},{"type":"object","additionalProperties":false,"required":["valid","reason"],"properties":{"valid":{"const":false},"reason":{"type":"string","enum":["missing_begin","extraneous_text","bad_begin_line","label_grammar","bad_end_line","label_mismatch","missing_end","blank_in_base64","bad_whitespace","bad_base64","bad_padding","non_canonical_base64","non_ascii"]}}}]},"examples":[{"input":{"text":"-----BEGIN EXAMPLE-----\nAA==\n-----END EXAMPLE-----\n"},"output":{"valid":true,"label":"EXAMPLE","byte_length":1,"canonical":true,"eol":"lf"}},{"input":{"text":"-----BEGIN EXAMPLE-----\nAA==\n-----END OTHER-----\n"},"output":{"valid":false,"reason":"label_mismatch"}},{"input":{"text":"-----BEGIN EXAMPLE-----\nAA== \n-----END EXAMPLE-----\n"},"output":{"valid":true,"label":"EXAMPLE","byte_length":1,"canonical":false,"eol":"lf"}}],"execute_url":"/v1/tools/pem-envelope-validate/versions/1.0.0/execute"}