SB nº AN-22 : Padding of BER-TLV Encoded Constructed Data Objects (Clarification)

v1.0 Specification Bulletins

Application Note No. 22 First Edition August 2004 NOTE: REPLACED BY SPECIFICATION UPDATE #69 (SU-69) Padding of BER-TLV Encoded Constructed Data Objects This Application Note clarifies the ISO rules for padding of BER-TLV encoded constructed data objects.

Applicability

This application note applies to:

  • EMV 2000 Integrated Circuit Card Specification for Payment Systems (All Books) Version 4.0 December 2000
  • EMV Integrated Circuit Card Specification for Payment Systems (All Books) Version 4.1 May 2004

Related Documents

  • ISO/IEC 8825

Description

A number of queries related to the padding of constructed data objects have been received by EMVCo via the query facility on the EMVCo website. This Application Notes clarifies the rules regarding where padding is allowed and how it may be implemented. Padding, using ‘00’ or ‘FF’ bytes, may occur before, between or after primitive BERTLV encoded data objects in the value field of constructed data objects (templates) only. This padding is subject to following rules:

  • Padding shall not be applied within primitive BER-TLV encoded data objects.
  • Padding shall not be applied outside templates.
  • Padding may occur within templates, but must be before, after, or between primitive BER-TLV encoded data objects.
  • The length indicated in length byte of a padded constructed data object shall include any padding bytes present, since the padding shall only occur within the value field. The padding bytes have no meaning and are discarded. Note that the data object having tag ‘80’ returned in the Format 1 response to the GENERATE APPLICATION CRYPTOGRAM, GET PROCESSING OPTIONS and INTERNAL AUTHENTICATE commands, and the data objects returned to the GET DATA command are primitive BER-TLV coded data objects and shall not be padded. The value field of the constructed data object having tag ‘70’ returned in response to the READ RECORD command may be padded according to the rules above. Tag values beginning with ‘00’ and ‘FF’ shall not be used in EMV. It is strongly recommended that only ‘00’ bytes are used for padding since ‘FF’ may be dropped from future versions of the Specifications. This is to facilitate the possible future use by ISO of private class constructed data objects having tags >‘31’.