Home arrow Practices arrow Page 6 - Smart Cards: An Introduction

APDU - Practices

In this article Iím going to present you with a quick overview of the Smart Cards and then move on to exploring the ways they can be integrated to existing services in order to provide value added services or a new range of secure application.

TABLE OF CONTENTS:
  1. Smart Cards: An Introduction
  2. Use and Types of Smart Cards
  3. The ICC and Harvard Architecture
  4. Memory in Smart Cards
  5. Communicating with the Outside World
  6. APDU
  7. TPDU and ATR
  8. Operating System and File System
  9. Standards Governing Smart Cards
By: Digvijay Chauhan
Rating: starstarstarstarstar / 63
October 11, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The APDU is an application level protocol as specified in the ISO 7816-4, which takes place between a smart card and a host application for the communication purpose.

APDU consist of two structures, as defined below:

  1. Command APDU (C-APDU: this command is used by the host application to send command to the card.
    1. Header: it consist of 4 bytes:-
      1. Class of instruction (CLA)
      2. Instruction code (INS)
      3. Parameters: P1 and 2

    2. Optional body: varies in length.
      1. Lc = specifies the length of the optional body or the data field (Bytes).
      2. Le = specifies the length of the data or the number of bytes that the host is expecting in response to the command sent.
      3. Data field contains the data that are sent to the card for executing the instruction specified in the header.

  2. Response APDU (R-APDU): this command is used by the card in order to respond to the command send by the host application.
    1. Optional body: it consist of data field whose length is specified by the Le
    2. Trailer: it consist of two words SW1 and SW2 called as status word, which denotes the processing state in the card after the execution of the command APDU.

Structure of the APDU is given below:

1. Command APDU

Mandatory HeaderOptional body
CLAINSP1P2LcData FieldLe

2. Response APDU

Optional bodyMandatory Trailer
Data FieldSW1SW1

Note:

  • A command is always paired with response APDU
  • The data field is optional in both command APDU and response APDU.

The second case further divides the command and response APDU in four categories.

  1. There is no transfer of data to or from the card
    1. C- APDU: contains header only.
    2. R- APDU: contains only the trailer status word.

  2. There is no transfer of data to the card but data are returned from the card
    1. C- APDU: contains Le only, which specifies the number of data bytes in the corresponding response APDU.

  3. There is transfer of data to the card but no data is returned from the card
    1. C- APDU: contains Lc and data field, Lc which specifies the length of the data field.
    2. R-APDU: contains the trailer status word SW1 and SW2.

  4. There is transfer of data to the card and data is returned from the card
    1. C- APDU: contains Lc and data field and Le.
    2. R-APDU: contains both the optional body and the trailer status word SW1 and SW2.



 
 
>>> More Practices Articles          >>> More By Digvijay Chauhan
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PRACTICES ARTICLES

- Calculating Development Project Costs
- More Techniques for Finding Things
- Finding Things
- Finishing the System`s Outlines
- The System in So Many Words
- Basic Data Types and Calculations
- What`s the Address? Pointers
- Design with ArgoUML
- Pragmatic Guidelines: Diagrams That Work
- Five-Step UML: OOAD for Short Attention Span...
- Five-Step UML: OOAD for Short Attention Span...
- Introducing UML: Object-Oriented Analysis an...
- Class and Object Diagrams
- Class Relationships
- Classes

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: