Hi,
2013/5/30 Hruday Ma***ck <hruday.ma***ck@ant***gt.com>
Dear,I am Hruday Ma***ck,wnat to know more about smart card. I have doubt on file creation in smart card.Kindly explain following code:
The Following code is a part of data used to prepare smart card commands in C/C++
UCHAR ucDataCreateMF[]={0x62,0x07,0x82,0x01,0x38,0x83,0x02,0x3F, 0x00};
--- Cheef's YAML
BER: # ASN.1 Basic Encoding Rules (BER)
# 620782013883023F00
- tag: "62"
- len: "07"
- val: # 82013883023F00
- x82: # File descriptor
# 820138
- tag: "82"
- len: "01"
- val: # 38
- B1: "38" # File descriptor byte
# 0____000 - bits 3 to 1, EF structure, No information given
# 00______ - bits 8 to 7, File accessibility, Not shareable file
# 0_111000 - bits 6 to 1, DF
- x83: # File identifier
# 83023F00
- tag: "83"
- len: "02"
- val: "3F00" # // MF - Master File
UCHAR ucDataSelectMF[]={0x3F,0x00};
"3F00" # // MF - Master File
UCHAR ucDataSelectEF[]={0x36,0x19};
"3619" Some EF Identifier
UCHAR ucDataCreateEF[]={0x62,0x11,0x82,0x05,0x04,0x01,0x00,0x25, 0x15,0x83,0x02,0x36,0x19,0x88, 0x01,0x90,0x8A,0x01,0x01};
--- Cheef's YAML
BER: # ASN.1 Basic Encoding Rules (BER)
# 621182050401002515830236198801908A0101
- tag: "62"
- len: "11"
- val: # 82050401002515830236198801908A0101
- x82: # File descriptor
# 82050401002515
- tag: "82"
- len: "05"
- val: # 0401002515
- B1: "04" # File descriptor byte
# 0_000___ - bits 6 to 4, EF category, Working EF
# 00______ - bits 8 to 7, File accessibility, Not shareable file
# 0____100 - bits 3 to 1, EF structure, Linear structure, variable size, no further information - Record handling
- B2: "01" # Data coding byte
- B34: "0025" # Maximum record size (on one or two bytes) // 37
- B56: "15" # Number of records (on one or two bytes) // 21
- x83: # File identifier
# 83023619
- tag: "83"
- len: "02"
- val: "3619"
- x88: # Short EF identifier
# 880190
- tag: "88"
- len: "01"
- val: "90"
- x8A: # Life cycle status byte (LCS)
# 8A0101
- tag: "8A"
- len: "01"
- val: "01"
# 00000001 - Creation state
UCHAR ucDataWrite[]={0x31,0x32,0x33,0x34,0x35,0x36};
data to Write, string: "123456"
UCHAR ucDataUpdate[]={0x33,0x34,0x35,0x36,0x37,0x38,0x39}, ucResData[50]={0};
Data to Update, string: "3456789"
UCHAR ucDataAppend[]={0x4D,0x41,0x4C,0x41};
Data to Append, string: "MALA"
UINT iDataLen=0,ucRecordNum,Le,P1=0x00,P2=0x04,uiResDataLen=0, uiResLen,i=0,uiStatus=0;
Initial parameters for Smartcard APDU Command
Thanks,Hruday
Welcome,
Cheef
Cheef
No comments:
Post a Comment