java - Java Card JCA 文件到 CAP 文件名
问题描述
使用将 hello.jca 文件转换为 hello.cap 文件
./capgen.bat ".\hello.jca" -o ".\hello.cap"
即使我指定了输出文件名,输出文件也始终是 a.jar。
解决方案
有一种方法可以通过使用工具的-config params.json
属性来做到这一点capgen.bat
。
但是,您必须下载和使用capgen.bat
至少3.1.0
版本的文件,因为甚至3.0.5
没有提到的属性(见下文)。这可以通过下载3.1.0 版本的 JavaCard Development Kit Tools即java_card_tools-win-bin-b_17-06_jul_2021.zip
文件来实现。
证明(3.0.5
版)
PS C:\Users\pc> capgen.bat -version
CapGen [v3.0.5]
Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
PS C:\Users\pc> capgen.bat -help
usage: capgen [-options] filename
where options include:
-help Print this message and exit.
-nobanner Do not display informational messages.
-o <filename> Output filename. default: a.jar
-version Print version number and exit.
证明(3.1.0
版)
PS C:\Users\pc> C:\development\code\java_card_tools-win-bin-b_17-06_jul_2021\bin\capgen.bat -version
CapGen [v3.1.0]
Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
PS C:\Users\pc> C:\development\code\java_card_tools-win-bin-b_17-06_jul_2021\bin\capgen.bat -help
usage: capgen [-options] filename
where options include:
-help Print this message and exit.
-nobanner Do not display informational messages.
-o <filename> Output filename. default: a.jar
-version Print version number and exit.
-config Run capgen in extended mode. In this case the filename must have .json extension.
现在,这是我设置json
文件的方式:
{
"inputConfig": {
"CAP_AID": "01:02:03:04:05:10",
"CAP_name": "helloworld",
"CAP_version": "1.0",
"outputDir": "output",
"debug": true,
"inputPackages": [{
"jcainputfile": "helloworld.jca"
}]
}
}
这是我调用命令的方式:
C:\development\code\java_card_tools-win-bin-b_17-06_jul_2021\bin\capgen.bat -config .\jca-to-cap.json
该helloworld.cap
文件出现在.\output\helloworld\javacard
目录中。您可以使用jsonoutputDir
文件中的选项来更改目标文件夹。
注意:通过这种方式获得的cap文件的重量比使用convert_applet.bat
文件的“正常”方式要轻。
推荐阅读
- clojure - 是否可以将两个函数应用于 Clojure 中的列表?
- javascript - Angular FormControl 模式验证器不适用于正则表达式
- java - 如何获取输入元素的文本属性?- 网络驱动程序
- amazon-web-services - 命令“维护:安装”未定义
- node.js - 如果存在,则在 mongodb 中增加嵌套字段值或创建嵌套字段
- php - 带有laravel的网址中的问号
- imagemagick - 使用 imagemagick 在图像前添加文本
- c++ - C++ promise.set_value 在 linux 下因未知错误而失败
- ios - Safari IOS 在屏幕顶部有可点击的元素对 iPhone 上的横向效果不太好
- c++ - 半精度数的数学库