Skip to main content

validate_der

Function validate_der 

Source
pub fn validate_der(raw: &[u8]) -> Result<(), ShapeViolation>
Expand description

Validate that raw is a single well-formed DER value per X.690 §§ 8 / 10 / 11 (not merely valid BER — long-form lengths below the short-form threshold and indefinite lengths are rejected).

§Errors

  • [INVALID_DER_VIOLATION] (validDer) — malformed or non-canonical DER, or trailing bytes after the top-level value.
  • [DEPTH_BOUND_VIOLATION] (depthBound) — nesting exceeds the MAX_ASN1_DEPTH native-stack-safety bound.