Skip to content

Commit

Permalink
CD4J-34 Update readme files with info about extra JVM arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoMattus committed Jun 5, 2024
1 parent 8d2b961 commit 1f20f44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ This project started with the help of European Regional Development Fund.
## How to use it
Take a look at the [examples](https://github.com/open-eid/cdoc4j/wiki/Examples-of-how-to-use-it)

## Decrypting a file using a smart card with Java version 17 or higher
Using a smart card to decrypt a file while using Java 17 or a later version, an extra JVM argument is required:
```bash
--add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED
```

## Maven Central
You can use the library as a dependency from [Maven Central](http://mvnrepository.com/artifact/org.open-eid.cdoc4j/cdoc4j)

Expand Down
5 changes: 5 additions & 0 deletions util/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ java -jar cdoc4j-util-1.5-SNAPSHOT.jar encrypt -f path/to/file path/to/another/f
java -jar cdoc4j-util-1.5-SNAPSHOT.jar pkcs11-decrypt -f /path/to/cdoc -d /path/to/pkcs11/driver -p [pin number] -s [slot] -o /path/to/output/directory/of/decrypted/file
```

* **NB**: when decrypting a file using PKCS#11 with Java 17 or higher, an extra Java argument `--add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED` is required:
```bash
java --add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED -jar cdoc4j-util-1.5-SNAPSHOT.jar pkcs11-decrypt -f /path/to/cdoc -d /path/to/pkcs11/driver -p [pin number] -s [slot] -o /path/to/output/directory/of/decrypted/file
```

* Example of decrypting a file with PKCS#12
```bash
java -jar cdoc4j-util-1.5-SNAPSHOT.jar pkcs12-decrypt -f path/to/cdoc -k /path/to/p12/keystore -p [keystore password] -o /path/to/output/directory/of/decrypted/file
Expand Down

0 comments on commit 1f20f44

Please sign in to comment.