1 /**
  2  *  ---------
  3  * |.##> <##.|  Open Smart Card Development Platform (www.openscdp.org)
  4  * |#       #|  
  5  * |#       #|  Copyright (c) 1999-2013 CardContact Software & System Consulting
  6  * |'##> <##'|  Andreas Schwier, 32429 Minden, Germany (www.cardcontact.de)
  7  *  --------- 
  8  *
  9  *  This file is part of OpenSCDP.
 10  *
 11  *  OpenSCDP is free software; you can redistribute it and/or modify
 12  *  it under the terms of the GNU General Public License version 2 as
 13  *  published by the Free Software Foundation.
 14  *
 15  *  OpenSCDP is distributed in the hope that it will be useful,
 16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18  *  GNU General Public License for more details.
 19  *
 20  *  You should have received a copy of the GNU General Public License
 21  *  along with OpenSCDP; if not, write to the Free Software
 22  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 23  *
 24  * @fileoverview Example script for dumping the content of a credit card in human readable form
 25  */
 26 
 27 
 28 load("emv.js");
 29 load("emvView.js");
 30 
 31 // Example code
 32 var card = new Card(_scsh3.reader);
 33 card.reset(Card.RESET_COLD);
 34 
 35 var crypto = new Crypto();
 36 
 37 var e = new EMV(card, crypto);
 38 var v = new EMVView(e);
 39 
 40 e.selectPSE(false);
 41 
 42 var aid = e.getAID();
 43 
 44 if (aid != null) {
 45 	e.selectADF(aid);
 46 } else {
 47 	e.tryAID();
 48 }
 49 
 50 
 51 e.initApplProc();
 52 e.readApplData();
 53 
 54 v.displayDataElements();
 55 
 56 card.close();
 57