[英]Java Card JCA file to CAP file name
將 hello.jca 文件轉換為 hello.cap 文件使用
./capgen.bat ".\hello.jca" -o ".\hello.cap"
即使我指定了輸出文件名,輸出文件也始終是 a.jar。
有一種方法可以通過使用capgen.bat
工具的-config params.json
屬性來實現。
但是,您必須下載並使用至少3.1.0
版本的capgen.bat
文件,因為即使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
目錄中。 您可以使用json文件中的outputDir
選項來更改目標文件夾。
注意:通過這種方式獲得的上限文件比使用convert_applet.bat
文件使用“正常”方式時要輕。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.