Description
Check BIT STRING unused-tail-bit consistency.
ASN.1 encodings separate identifiers, lengths and contents, with DER applying stricter canonical forms than BER. One leading octet or terminal-bit check covers only part of the complete value.
Check BIT STRING unused-tail-bit consistency.
When to use this tool
Use DER Bitstring Unused Bit Count when inspecting a stated ASN.1 field or canonical-content condition.
How to use the tool and how it works
- Enter unused, lastOctet, hasPayload. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read meaningfulBitsInLast. Use the output convention below.
Check BIT STRING unused-tail-bit consistency. Require unused in [0,7] and lastOctet in [0,255]; with payload require low unused bits zero, otherwise both inputs zero. meaningfulBitsInLast is 8-unused or zero without payload.1
DER constrains primitive encodings, including canonical value representation. Inspecting the supplied value octets does not establish a complete valid ASN.1 element.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| unused | Unused | Required. Safe integer; minimum 0; maximum 7. |
| lastOctet | Last Octet | Required. Safe integer; minimum 0; maximum 255. |
| hasPayload | Has Payload | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| meaningfulBitsInLast | Meaningful Bits In Last | Required. Safe integer. |
{
"input": {
"unused": 3,
"lastOctet": 168,
"hasPayload": true
},
"output": {
"meaningfulBitsInLast": 5
}
} Limitations and assumptions
- This checks supplied terminal metadata, not total bit length, tag or full DER canonicality.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an ASN.1 schema and complete BER/DER parser for nested values, canonicality and application meaning.
References
Similar or alternative tools
- DER Boolean Value Octet
Decode one canonical DER BOOLEAN content octet.
- DER Integer Leading Sign Octet
Inspect DER INTEGER content sign and redundant prefix.