Canonical Encoding Rules (CER) is a message transfer syntax specified by the ITU in X.690. It is a restricted variant of Basic Encoding Rules for producing unequivocal transfer syntax for data structures described by ASN.1.
Whereas BER gives choices as to how data values may be encoded, CER and DER select just one encoding from those allowed by the basic encoding rules, eliminating all of the options. They are useful when the encodings must be preserved, e.g. in security exchanges.
CER and DER differ in the set of restrictions that they place on the encoder. The basic difference between CER and DER is that DER uses definitive length form and CER uses indefinite length form in some precisely defined cases. That is, DER always has leading length information, while CER uses the end-of-contents octet instead of providing the length of the encoded data. Because of this, CER requires less metadata for large encoded values, while DER does it for small ones.
Documents: ITU-T X.690, ISO 8825-1.
This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.
Full article ▸