The rules, collectively referred to as a transfer syntax in ASN.1 parlance, specify the exact octets (8-bit bytes) used to encode data.
X.680 defines a syntax for declaring data types, for example: booleans, numbers, strings, and compound structures.
Combined, the class and type form a tag, which therefore corresponds to a unique data definition.
This type of format would allow a receiver to decode the ASN.1 information from an incomplete stream, without requiring any pre-knowledge of the size, content, or semantic meaning of the data, though some specifics of the protocol would need to be provided or reverse-engineered from representative samples of traffic or software.
[1] Data encoding consists of three or four components, in the following order: Note that if a Length is zero, then there are no Contents octets, e.g. the NULL type.
The following values are possible: If the tag's type fits in the 5-bits (0-3010), then the Identifier spans just one byte: Short Form.
This encodes the number of content octets and is always used if the type is primitive or constructed and data are immediately available.
CER (Canonical Encoding Rules) is a restricted variant of BER for producing unequivocal transfer syntax for data structures described by ASN.1.
DER (Distinguished Encoding Rules) is a restricted variant of BER for producing unequivocal transfer syntax for data structures described by ASN.1.
BER, as explained above, is the basic set of encoding rules given by ITU-T X.690 for the transfer of ASN.1 data structures.
Receivers who claim conformance to the basic encoding rules shall support all alternatives".
[1] A receiver must be prepared to accept all legal encodings in order to legitimately claim BER-compliance.
By contrast, both CER and DER restrict the available length specifications to a single option.
Because of this, CER requires less metadata for large encoded values, while DER does it for small ones.
It has been argued by some that this perception is primarily due to poor implementations, not necessarily any inherent flaw in the encoding rules.
By comparison, the more definite DER encoding is widely used to transfer digital certificates such as X.509.