我需要一个'java‘关于如何从计算机提取cap文件并将其分成块的源代码,以便使用APDU将其发送到智能卡,以安装或加载或删除应用程序。提前谢谢。
发布于 2010-03-16 03:47:50
您正在谈论GlobalPlatform,有一个名为GPJ的开源工具可以解决这个问题
发布于 2010-03-12 22:48:44
我认为你应该从http://java.sun.com/javacard/开始
发布于 2010-05-12 10:04:43
从http://gpj.svn.sourceforge.net/viewvc/gpj/获取源代码
在CapFile.java的getEntries(ZipInputStream in)方法中,您可能会对CAP文件的处理有所了解
private Map<String, byte[]> getEntries(ZipInputStream in)
throws IOException {
Map<String, byte[]> result = new HashMap<String, byte[]>();
while (true) {
ZipEntry entry = in.getNextEntry();
if (entry == null) {
break;
}
if (entry.getName().indexOf("MANIFEST.MF") != -1) {
continue;
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int c;
while ((c = in.read(buf)) > 0)
bos.write(buf, 0, c);
result.put(entry.getName(), bos.toByteArray());
}
return result;
}https://stackoverflow.com/questions/2433430
复制相似问题