I need a 'java' source code on how to extract a cap file from the computer and divide it into blocks in order to send it using APDUs to the smart card to install or load or delete an application. Thanks in advance.
+3
A:
You're talking about GlobalPlatform and there's a right open source tool out there for this, called GPJ
martin
2010-03-15 19:47:50
yes you are right and I checked it before but I want the source code for it to take a specific part which deals with the CAP file and application management. Thanks
2010-03-16 10:46:14
It comes with source code!?Here's a link for you to click well: http://gpj.svn.sourceforge.net/viewvc/gpj/
martin
2010-03-17 22:05:10
A:
Get the source code from http://gpj.svn.sourceforge.net/viewvc/gpj/
You may get some idea about dealing with CAP file in the method getEntries(ZipInputStream in)
of CapFile.java
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;
}
qichuan
2010-05-12 02:04:42