316 def getDataResult(self, status, body):
317 ret = ''
318 if not len(body):
319 return ''
320 appTag = body[0]
321 appLen = body[1]
322
323 body = body[2:2+appLen]
324 while len(body) > 2:
325 tag = body[0]
326 tagLen = body[1]
327 tagBody = body[2:2+tagLen]
328
329 if self.lastGet in ('5fc102',):
330
331 if tag == 0x30:
332 ret += '\tFASC-N: %s\n' % tagBody.hex()
333 elif tag == 0x34:
334 ret += '\tGUID: %s\n' % tagBody.hex()
335 elif tag == 0x35:
336 ret += '\texpirationDate: %s\n' % tagBody.decode('utf8')
337 elif tag == 0x3e:
338 ret += '\tIssuer Asymmetric Signature: %s\n' % tagBody.hex()
339 else:
340 ret += "\tunknown tag=0x%x len=%d content=%s\n" % (tag, tagLen, tagBody.hex())
341
342 elif self.lastGet in ('5fc107',):
343
344 capas = {
345 0xf0: "Card Identifier",
346 0xf1: "Capability Container version number",
347 0xf2: "Capability Grammar version number",
348 0xf3: "Applications CardURL",
349 0xf4: "PKCS#15",
350 0xf5: "Registered Data Model number",
351 0xf6: "Access Control Rule Table",
352 0xf7: "Card APDUs",
353 0xfa: "Redirection Tag",
354 0xfb: "Capability Tuples (CTs)",
355 0xfc: "Status Tuples (STs)",
356 0xfd: "Next CCC",
357 0xe3: "Extended Application CardURL",
358 0xb4: "Security Object Buffer",
359 0xfe: "Error Detection Code"
360 }
361
362 if tag in capas.keys():
363 if tagLen:
364 ret += "\t%s: len=%d %s\n" % (capas[tag], tagLen, tagBody.hex())
365 else:
366 ret += "\tunknown capa tag 0x%x: %s\n" % (tag, tagBody.hex())
367
368 elif self.lastGet == '5fc105':
369
370 pass
371
372 else:
373 ret += "\t%s: unimplemented tag=0x%x len=%d content=%s\n" % (self.lastGet, tag, tagLen, tagBody.hex())
374
375 body = body[2+tagLen:]
376
377 return ret
378