【问题标题】:Smart Cards Development智能卡开发
【发布时间】:2010-03-12 14:40:27
【问题描述】:

我需要一个“java”源代码,了解如何从计算机中提取 cap 文件并将其分成块,以便使用 APDU 将其发送到智能卡以安装或加载或删除应用程序。提前致谢。

【问题讨论】:

    标签: java smartcard apdu


    【解决方案1】:

    您说的是 GlobalPlatform,并且有一个合适的开源工具,称为 GPJ

    【讨论】:

    • 是的,你是对的,我之前检查过它,但我希望它的源代码占据处理 CAP 文件和应用程序管理的特定部分。谢谢
    • 自带源码!?这里有一个链接供你好好点击:gpj.svn.sourceforge.net/viewvc/gpj
    【解决方案2】:

    我认为你应该从http://java.sun.com/javacard/开始

    【讨论】:

      【解决方案3】:

      http://gpj.svn.sourceforge.net/viewvc/gpj/获取源代码

      你可能对CapFile.javagetEntries(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;
          }
      

      【讨论】:

        猜你喜欢
        • 2013-03-16
        • 1970-01-01
        • 1970-01-01
        • 2011-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多