šŸ—’ļø
notes
  • Journal
  • URLs
  • Java Card
    • SCP02
    • Rapid Notes
    • _FIXVALS_
    • Mifare
    • Chain Of Trust
  • Encoding
    • CBEFF
    • Bytes
  • Snippets
    • JNI_OnLoad
  • float to byte[]
  • Protobuf
  • C/C++
    • Containers
    • Basics
    • JNI
    • gcov
    • Castings
  • chess
    • Untitled
  • Compression
    • Untitled
  • Snippets
    • Untitled
  • Build Systems
    • Maven
    • Windows
  • Gradle
  • CMake
  • Java
    • Untitled
    • Certificates
  • Android
    • Mifare
  • Python
    • ctypes
  • WebSub
    • References
  • Spring Boot
    • Form-based Authentication
    • Basic Access Authentication
    • JWT Authentication
  • QR Code
    • Denso QR Code
  • Philosophical Inquiry
    • First
  • XML
    • xmlstarlet
Powered by GitBook
On this page

Was this helpful?

  1. Java Card

Rapid Notes

Helps in remembering

The len of a Response APDU is not in the APDU. The last 2 bytes we know are sw1 and sw2. The len is specified by the Command APDU

  • scfs (did not fly)

  • pc/sc (windows-based)

  • opencard (suddenly went dead)

  • iso-7816

SCP02 options are meant to dis-ambiguate the protocol for example, the card challenge uses applet AID to generate challenge and offcard is aware so offcard can pre-compute the card challenge ahead of time.

When T=1 then block of characters are transmitted. But T=0 each character is transmitted separately. The ATR tells which.

Secure messaging only possible in T=1 protocol.

Access condition is a bits-field setting of a file. Every operations are listed out. Every required conditions are listed out. If a bit is set for this intersection, then this conditions must be satisfied to do that operation. Example bits-field:

  • always

  • protected (presence of MAC)

  • external-authenticate (satisfy challenge)

Two types of card:

  • memory card

  • microprocessor card

Bluetooth Data Element fuses the type and length field together whereas ASN.1 BER TLV have distinct type and field .

Smart card file system:

  • MF 3F 00

  • EF

  • DF

ISO 7816-4 specfies basic well-known commands to certain file types:

  • select file

  • read binary

  • write binary

  • update binary

  • append record

Some commands are for record only. SOme for binary only.

Access conditions not specified in ISO 7816-4

FCI = File Control Information

An FCI is the returned data in a SELECT command. An FCI may also be in file contents EF. Three templates to convey FCI:

  • 62 File Control Parameter FCP

  • 64 File Management Data FMD

  • 6F File Control Information FCI

The 4 structures of command APDUs:

  • In case 1, the length Lc is null; therefore the Lc field and the data field are empty. The length Le is also null; therefore the Le field is empty. Consequently, the body is empty.

  • In case 2, the length Lc is null; therefore the Lc field and the data field are empty. The length of Le is not null; therefore the Le field is present. Consequently, the body consists of the Le field.

  • In case 3, the length Lc is not null; therefore the Lc field is present and the data field consists of the Lc subsequent bytes. The length Le is null; therefore the Le field is empty. Consequently, the body consists of the Lc field followed by the data field.

  • In case 4, the length Lc is not null; therefore the Lc field is present and the data field consists of the Lc subsequent bytes. The length Le is also not null; therefore the Le field is also present. Consequently, the body consists of the Lc field followed by the data field and the Le field.

Short or Extended LC and LE. Short means 1 byte for LC and LE.

If a command is aborted with a response where SW1=’6C’, then SW2 indicates the value to be given to the short Le field (exact length of requested data) when re-issuing the same command before issuing any other command.

PreviousSCP02Next_FIXVALS_

Last updated 4 years ago

Was this helpful?

ISO7816 part 4 section 5 APDU level data structuresCardWerk software for smart cards
Logo