Skip to main content

Crate uselesskey_core_negative_der

Crate uselesskey_core_negative_der 

Source
Expand description

DER corruption helpers for negative test fixtures.

Provides deterministic truncation, byte-flipping, and combined corruption strategies for DER-encoded blobs. Used by higher-level negative fixture crates (uselesskey-core-negative) to generate invalid DER artifacts that exercise parser error paths in tests.

Functionsยง

corrupt_der_deterministic
Choose a corruption strategy deterministically from variant and apply it to der.
flip_byte
XOR the byte at offset with 0x01, returning the original if offset is out of range.
truncate_der
Truncate der to at most len bytes, returning the original if already shorter.