test eewayinfo.cap
来源:互联网 发布:steam上mac游戏推荐 编辑:程序博客网 时间:2024/05/01 19:42
cm> send 00a404000f4150504c45544545574159494e464f
=> 00 A4 04 00 0F 41 50 50 4C 45 54 45 45 57 41 59 .....APPLETEEWAY
49 4E 46 4F INFO
(230197 nsec)
<= 90 00 ..
Status: No Error
cm> send 00200000024142
=> 00 20 00 00 02 41 42 . ...AB
(282158 nsec)
<= 90 00 ..
Status: No Error
cm> send 0030000002
=> 00 30 00 00 02 .0...
(257575 nsec)
<= 41 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB..............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 90 00 ..........
Status: No Error
cm> send 0030000000
=> 00 30 00 00 00 .0...
(47645 usec)
<= 41 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB..............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 90 00 ..........
Status: No Error
/**
* File:AppletMain.java Package:com.pervcom.eeway.eewayinfo Project:EEWayInfo
* Date:2010-12-1 Author:Peter.Feng
* Copyright (c) 2010 Pervcom, Inc. All Rights Reserved.
*/
package com.pervcom.eeway.eewayinfo;
import javacard.framework.APDU;
import javacard.framework.Applet;
import javacard.framework.ISO7816;
import javacard.framework.ISOException;
import javacard.framework.Util;
/**
* <pre>
* Author: Peter.Feng
* Date&Time: 2010-12-1 下午02:16:07
* AppletMain
* 在易惠通手机客户端推荐优惠券给指定的好友之前,必须先确定自己的身份,也就是推荐人的在软件使用时对外的信息。
* </pre>
*/
public class AppletMain extends Applet {
private byte[] data = new byte[200];
private short length = 200;
final static short INS_WRITE = (byte)0x20;
final static short INS_READ = (byte)0x30;
final static short SW_WRONG_LC_LENGTH = 0x0011;
final static short SW_WRONG_LE_LENGTH = 0x0012;
private AppletMain(byte[] data, short offset, byte length)
{
super.register();
}
public static void install(byte[] data, short offset, byte length) {
new AppletMain(data, offset, length);
}
public void process(APDU apdu) {
byte[] buffer = apdu.getBuffer();
switch(buffer[ISO7816.OFFSET_INS])
{
case INS_WRITE:
writeData(apdu);
return;
case INS_READ:
readData(apdu);
return;
}
}
private void readData(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
Util.arrayCopy(data,(short)0,buffer,(short)0, length);
apdu.setOutgoingAndSend((short)0, length);
}
private void writeData(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
byte lc = buffer[ISO7816.OFFSET_LC];
byte lengthReceive = (byte)(apdu.setIncomingAndReceive());
if(lc!=lengthReceive)
ISOException.throwIt(SW_WRONG_LC_LENGTH);
Util.arrayCopy(buffer,(short)(ISO7816.OFFSET_LC+1),data,(short)0,(short)lengthReceive);
}
}
- test eewayinfo.cap
- test eewayinfo.cap
- run eewayinfo.cap
- cap
- CAP
- CAP
- CAP
- CAP
- CAP?
- CAP原理(CAP Theorem)
- CAP原理(CAP Theorem)
- CAP原理(CAP Theorem)
- CAP原理(CAP THEOREM)
- CAP原理(CAP Theorem)
- CAP原则(CAP定理)
- CAP理论
- cap原理
- CAP 理论
- 急求实例
- javascript实现改变图片指定区域的颜色
- endnote & word
- 我的人生之书
- c# 异常处理 经典代码实例
- test eewayinfo.cap
- VS2010帮助文档的下载和安装
- struct 字节对齐详解
- 【转载】源代码查看工具 Source Navigator 使用心得
- 中文字体在CSS中的表达方式
- 很高兴加入csdn
- 去客户那增加 Oracle tablespace
- 如何写作完美的商业计划书!
- 开源 IM 工具编译与环境搭建攻略