锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲视频在线观看,亚洲一区精品在线,久久久久999http://www.aygfsteel.com/ZouYonghui/category/54135.htmlzh-cnFri, 14 Mar 2014 19:48:53 GMTFri, 14 Mar 2014 19:48:53 GMT60 JAVA鍗′粙緇?/title><link>http://www.aygfsteel.com/ZouYonghui/archive/2014/03/14/411048.html</link><dc:creator>Terry Zou</dc:creator><author>Terry Zou</author><pubDate>Fri, 14 Mar 2014 09:48:00 GMT</pubDate><guid>http://www.aygfsteel.com/ZouYonghui/archive/2014/03/14/411048.html</guid><wfw:comment>http://www.aygfsteel.com/ZouYonghui/comments/411048.html</wfw:comment><comments>http://www.aygfsteel.com/ZouYonghui/archive/2014/03/14/411048.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ZouYonghui/comments/commentRss/411048.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ZouYonghui/services/trackbacks/411048.html</trackback:ping><description><![CDATA[     鎽樿: JAVA鍗′粙緇?  JAVA鍗′笌鏅鴻兘鍗?    浠涔堟槸 JAVA 鍗″憿錛烰AVA 鍗℃槸涓縐嶅彲浠ヨ繍琛?nbsp;JAVA 紼嬪簭鐨勬帴瑙﹀紡寰鐞嗗櫒鏅鴻兘鍗°?996 騫?nbsp;11 鏈堬紝JAVA 鍗?nbsp;1.0 鐗堟湰鐨勮鑼冩寮忓彂甯冧簡銆傚浠?nbsp;JAVA&n...  <a href='http://www.aygfsteel.com/ZouYonghui/archive/2014/03/14/411048.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/ZouYonghui/aggbug/411048.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ZouYonghui/" target="_blank">Terry Zou</a> 2014-03-14 17:48 <a href="http://www.aygfsteel.com/ZouYonghui/archive/2014/03/14/411048.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>綆鍗曠殑鍗″唴紼嬪簭http://www.aygfsteel.com/ZouYonghui/archive/2014/01/23/409264.htmlTerry ZouTerry ZouThu, 23 Jan 2014 03:38:00 GMThttp://www.aygfsteel.com/ZouYonghui/archive/2014/01/23/409264.htmlhttp://www.aygfsteel.com/ZouYonghui/comments/409264.htmlhttp://www.aygfsteel.com/ZouYonghui/archive/2014/01/23/409264.html#Feedback0http://www.aygfsteel.com/ZouYonghui/comments/commentRss/409264.htmlhttp://www.aygfsteel.com/ZouYonghui/services/trackbacks/409264.html2.new->Java Card Applet Class->AID Settings
緙栧啓鍗″唴紼嬪簭

public class HelloApplet extends Applet {

 public static void install(byte[] bArray, short bOffset, byte bLength) {
  // GP-compliant JavaCard applet registration
  new HelloApplet().register(bArray, (short) (bOffset + 1),
    bArray[bOffset]);
 }

 public void process(APDU apdu) {
  // Good practice: Return 9000 on SELECT
  if (selectingApplet()) {
   return;
  }
  
  byte[] buf = apdu.getBuffer();
  short offset = ISO7816.OFFSET_CDATA;
  switch (buf[ISO7816.OFFSET_INS]) {
  case (byte) 0xE2:
   buf[offset++] = 0x01;
   buf[offset++] = 0x02;
   buf[offset++] = 0x03;
   buf[offset++] = 0x04;
   buf[offset++] = 0x05;
   buf[offset++] = 0x06;
   
   apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA, (short)(offset-ISO7816.OFFSET_CDATA));
   break;
  case (byte) 0xE3:
   buf[offset++] = 0x11;
   buf[offset++] = 0x12;
   buf[offset++] = 0x13;
   buf[offset++] = 0x14;
   buf[offset++] = 0x15;
   buf[offset++] = 0x16; 
    
   apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA,(short) (offset-ISO7816.OFFSET_CDATA));
   break;
   default:
    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
  }
 }

}


3.鍙抽敭欏圭洰->Run Configurations...->Java Card Application鍙抽敭閫夋嫨new->閫夋嫨鏂板緩鐨凙pplet->package Upload->aid

4.鏂板緩鍗″欏圭洰java project
緙栧啓鍗″唴紼嬪簭濡備笅錛?br />

public class TestHelloWorld {
 
 protected static RFCSMXIO smxio = null;
 @Before
 public void setUp() throws Exception {
  smxio = SMXIOFactory.createJDKSMXIO();
 }
 
 @Test
 public void test() {
  try {
   byte[] aid = ByteUtil.hexToByteArray("5200413120");
   RFCIOResult result = smxio.selectApplet(aid);
   int offset = 0;
   byte[] apdu = new byte[5];
   apdu[offset] = (byte)0x80;
   apdu[offset+1] = (byte)0xE2;
   apdu[offset+2] = 0;
   apdu[offset+3] = 0;
   apdu[offset+4] = 0;
   result = smxio.exchange(apdu);
   
   System.out.println("result: "+ByteUtil.byteArrayToHex(result.getResult()));
   boolean res = RFCSMXIOHelper.processCardIOResult(result);
   byte[] b = result.getResult();
   if(res){
    System.out.println(ByteUtil.byteArrayToHex(b));
   }
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

}

6.瀹夎鍗″唴紼嬪簭
jcop debug->upload package->install applet
7.榪愯鍗″紼嬪簭

Terry Zou 2014-01-23 11:38 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 织金县| 项城市| 安多县| 龙里县| 闸北区| 廊坊市| 平邑县| 达拉特旗| 孟州市| 青冈县| 泾阳县| 公安县| 青海省| 北票市| 三门峡市| 错那县| 宣武区| 宁河县| 乌拉特中旗| 读书| 西青区| 林芝县| 凤冈县| 玉田县| 普兰县| 珠海市| 将乐县| 杭锦旗| 化隆| 娄底市| 肇源县| 神木县| 霍邱县| 宝鸡市| 西华县| 札达县| 交口县| 利津县| 华蓥市| 和龙市| 鄂托克前旗|