https://github.com/martinpaljak/capfile
Small library for JavaCard CAP file parsing and verification - MOVED to https://github.com/martinpaljak/ant-javacard
https://github.com/martinpaljak/capfile
capfile java javacard
Last synced: 6 months ago
JSON representation
Small library for JavaCard CAP file parsing and verification - MOVED to https://github.com/martinpaljak/ant-javacard
- Host: GitHub
- URL: https://github.com/martinpaljak/capfile
- Owner: martinpaljak
- License: mit
- Archived: true
- Created: 2018-06-26T12:51:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T08:10:33.000Z (over 2 years ago)
- Last Synced: 2025-07-19T21:58:41.049Z (12 months ago)
- Topics: capfile, java, javacard
- Language: Java
- Homepage: https://github.com/martinpaljak/GlobalPlatformPro
- Size: 112 KB
- Stars: 17
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# capfile · [](https://github.com/martinpaljak/capfile/actions) [](https://github.com/martinpaljak/capfile/blob/master/LICENSE)
[](https://github.com/martinpaljak/capfile/releases) [](https://gist.github.com/martinpaljak/c77d11d671260e24eef6c39123345cae) [](https://mvnrepository.com/artifact/com.github.martinpaljak/capfile)
> Handle JavaCard CAP files, from command line or Java project
java -jar capfile.jar
## Off-card verification
java -jar capfile.jar -v [] []
(SDK-s usable on Unix machines are conveniently available from https://github.com/martinpaljak/oracle_javacard_sdks/). EXP files can be plain EXP files or JAR files containing EXP files. Please use JavaCard 3.0.5u3 as the SDK and verify target SDK.
## DAP signing
Usable with [GlobalPlatformPro](https://github.com/martinpaljak/GlobalPlatformPro). At the moment, only PKCS#1 v1.5 SHA1 signature with 1024 bit RSA key is supported.
java -jar capfile.jar -s
A sample flow would look along the lines of:
```shell
openssl genrsa 1024 > dap.pem # generate DAP key
capfile -s dap.pem applet.cap # sign CAP with DAP key
gp -domain $SSD_AID -privs DAPVerification --allow-to # create SSD with DAP
gp -sdaid $SSD_AID -put-key dap.pem -key $SSD_SCP_KEY # add DAP key to SSD
gp -load applet.cap -to $SSD_AID # load signed CAP file to SSD
```