{"id":"pem-label-validate","version":"1.0.0","description":"Check a PEM label against the RFC 7468 label grammar, without reading a payload.","supported_operations":["validate a pem label","check rfc 7468 label grammar","is this begin-end label well formed","pem label character rules","allow a space inside a pem label","reject consecutive hyphens in a pem label"],"unsupported_operations":["decide whether the label matches the payload type","case-fold a label to an uppercase registered name","map a label onto an asn.1 module"],"semantics":["The label matches RFC 7468 section 3: empty, or one labelchar followed by groups of an optional single SP or hyphen and another labelchar. labelchar is printable US-ASCII except SP (0x20) and hyphen (0x2D). Case is significant and is not folded.","The first failing position wins: a separator at either end is edge_separator, two separators in a row are consecutive_separator, and any other rejected character is bad_character. A grammar failure of a label within the byte bound returns {valid:false, reason} and does not throw.","Registered labels in section 4 (CERTIFICATE, X509 CRL, ENCRYPTED PRIVATE KEY, and the rest) are ordinary strings under this grammar. \"X.509 CERTIFICATE\" is grammatical and is not equated with \"CERTIFICATE\".","The byte limit of 64 is checked before the grammar. A label of 65 bytes is limit_exceeded, not a false result, including when the extra characters would also fail the grammar. RFC 7468 does not define this bound; the output schema uses the same 64.","A lone surrogate throws invalid_input. Ordinary non-ASCII inside the byte bound is bad_character. This tool does not look at a PEM body and makes no certificate or key claim.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_label_bytes":64,"max_output_bytes":160},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":0,"maxLength":64}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid"],"properties":{"valid":{"type":"boolean"},"length":{"type":"integer","minimum":0,"maximum":64},"reason":{"type":"string","enum":["bad_character","consecutive_separator","edge_separator"]}},"oneOf":[{"type":"object","additionalProperties":false,"required":["valid","length"],"properties":{"valid":{"const":true},"length":{"type":"integer","minimum":0,"maximum":64}}},{"type":"object","additionalProperties":false,"required":["valid","reason"],"properties":{"valid":{"const":false},"reason":{"type":"string","enum":["bad_character","consecutive_separator","edge_separator"]}}}]},"examples":[{"input":{"label":"CERTIFICATE"},"output":{"valid":true,"length":11}},{"input":{"label":"A--B"},"output":{"valid":false,"reason":"consecutive_separator"}},{"input":{"label":"X509 CRL"},"output":{"valid":true,"length":8}}],"execute_url":"/v1/tools/pem-label-validate/versions/1.0.0/execute"}