Skip to content

Commit c83333d

Browse files
committed
Merge branch 'master' of gitlab.ext.cyber.ee:cdoc2/cdoc2-java-ref-impl into open-eid/master
# Conflicts: # cdoc2-cli/src/main/java/ee/cyber/cdoc2/cli/commands/CDocCreateCmd.java # cdoc2-lib/src/main/java/ee/cyber/cdoc2/crypto/KekTools.java # cdoc2-lib/src/main/java/ee/cyber/cdoc2/crypto/SymmetricKeyTools.java # cdoc2-lib/src/main/java/ee/cyber/cdoc2/crypto/keymaterial/DecryptionKeyMaterial.java
2 parents e56017a + 30b6661 commit c83333d

File tree

66 files changed

+1050
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1050
-819
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.4.0] Key label formatting (2024-XX-XX)
4+
5+
### Internal
6+
7+
* Upgraded Spring 3.2.5 -> 3.3.3 + other third-party dependency updates
8+
39
## [1.3.0] '/key-capsules' OAS v2.1.0 support (2024-07-02)
410

511
### Features
@@ -9,7 +15,7 @@
915
Label is not required, when CDOC2 file contains single password recipient.
1016
* Add example project to demonstrate usage of cdoc2-java-ref-impl with cdoc4j (convert cdoc -> cdoc2)
1117

12-
## [1.2.0 ] Repository split and maintenance (2024-05-30)
18+
## [1.2.0] Repository split and maintenance (2024-05-30)
1319

1420
### Features
1521

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,16 @@ To run the tests using a physical PKCS11 device (smart card or usb token), execu
231231
mvn test -Dtests=pkcs11
232232
```
233233

234-
The pkcs11 device configuration (PKCS11 library, slot, pin, etc) can be specified using `cdoc2.pkcs11.conf-file` system property, for example:
234+
The pkcs11 device configuration (PKCS11 library, slot, pin, etc) can be specified using
235+
`cdoc2.pkcs11.conf-file` system property, for example run with configuration file from filesystem
236+
from the root of the project:
235237

236238
```
237-
mvn test -Dtests=pkcs11 -Dcdoc2.pkcs11.conf-file=pkcs11-test-safenet.properties
239+
mvn test -Dtests=pkcs11 -Dcdoc2.pkcs11.conf-file=src/test/resources/pkcs11-test-safenet.properties
240+
```
241+
or
242+
```
243+
mvn test -Dtests=pkcs11 -Dcdoc2.pkcs11.conf-file=src/test/resources/pkcs11-test-idcard.properties
238244
```
239245

240246
By default, the pkcs11 configuration is read from the file `pkcs11-test-idcard.properties`.

cdoc2-cli/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Optionally cdoc2-cli also supports encrypting with "soft" key or certificate
5050

5151
Public key (`-p`)
5252
```
53-
java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc -p keys/cdoc2client_pub.pem README.md
53+
java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc -p keys/cdoc2client_pub.key README.md
5454
```
5555

5656
Certificate (`-c` option):
@@ -143,7 +143,7 @@ It is also possible to decrypt documents created with "soft" keys, but configura
143143
key (read separately from a file) must match. Also, server must be configured to trust client certificate used for
144144
mutual TLS.
145145
```
146-
java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client.pem -o /tmp/
146+
java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client_priv.key -o /tmp/
147147
```
148148

149149

@@ -178,7 +178,7 @@ java -jar target/cdoc2-cli-*.jar list --file /tmp/mydoc.cdoc -k keys/bob.pem
178178
or with server scenario:
179179

180180
```
181-
java -jar target/cdoc2-cli-*.jar list --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client.pem
181+
java -jar target/cdoc2-cli-*.jar list --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client_priv.key
182182
```
183183

184184
or with password:
@@ -253,7 +253,7 @@ java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc -c keys/cdoc2clie
253253

254254
Decrypt created container with private key:
255255
```
256-
java -jar target/cdoc2-cli-*.jar decrypt -f /tmp/mydoc.cdoc -k keys/cdoc2client.pem --output /tmp
256+
java -jar target/cdoc2-cli-*.jar decrypt -f /tmp/mydoc.cdoc -k keys/cdoc2client_priv.key --output /tmp
257257
```
258258

259259
### Troubleshooting ID-card
704 Bytes
Binary file not shown.

cdoc2-cli/config/ria-dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Client certificate must be trusted by server
2626

2727
### Encrypt
2828
```
29-
java -jar target/cdoc2-cli-*.jar create --server=config/ria-dev/ria-dev_pkcs12.properties -f /tmp/ria_p12.cdoc -p keys/cdoc2client_pub.pem README.md
29+
java -jar target/cdoc2-cli-*.jar create --server=config/ria-dev/ria-dev_pkcs12.properties -f /tmp/ria_p12.cdoc -p keys/cdoc2client_pub.key README.md
3030
```
3131

3232
### Decrypt

cdoc2-cli/config/ria-test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Client certificate must be trusted by server
2626

2727
### Encrypt
2828
```
29-
java -jar target/cdoc2-cli-*.jar create --server=config/ria-test/ria-test_p12.properties -f /tmp/ria_p12.cdoc -p keys/cdoc2client_pub.pem README.md
29+
java -jar target/cdoc2-cli-*.jar create --server=config/ria-test/ria-test_p12.properties -f /tmp/ria_p12.cdoc -p keys/cdoc2client_pub.key README.md
3030
```
3131

3232
### Decrypt

cdoc2-cli/config/ria-test/ria-test_p12.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ cdoc2.client.ssl.trust-store-password=passwd
1919
cdoc2.client.ssl.client-store.type=PKCS12
2020
cdoc2.client.ssl.client-store=keys/cdoc2client.p12
2121
cdoc2.client.ssl.client-store-password=passwd
22-
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIEDjCCA2+gAwIBAgIQaLfRQQSV3nMFgzOBgc5eKjAKBggqhkjOPQQDBDBgMQsw
3+
CQYDVQQGEwJFRTEbMBkGA1UECgwSU0sgSUQgU29sdXRpb25zIEFTMRcwFQYDVQRh
4+
DA5OVFJFRS0xMDc0NzAxMzEbMBkGA1UEAwwSVEVTVCBvZiBFU1RFSUQyMDE4MB4X
5+
DTIzMTEyOTA3MTYwOVoXDTI4MTEyODIxNTk1OVowfzELMAkGA1UEBhMCRUUxKjAo
6+
BgNVBAMMIUrDlUVPUkcsSkFBSy1LUklTVEpBTiwzODAwMTA4NTcxODEQMA4GA1UE
7+
BAwHSsOVRU9SRzEWMBQGA1UEKgwNSkFBSy1LUklTVEpBTjEaMBgGA1UEBRMRUE5P
8+
RUUtMzgwMDEwODU3MTgwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASrgI6qFJh+LloJ
9+
pNRwTL+89OVYygtOHVFuKpAuf7ZcLPnsaAnynvUTn9I8AvSzLnR7pzRVPDir+tTe
10+
k2Hp9IzwF067hOf8NKp3WbkaGk74Gdcd9RGPLfzDi+YcTj9zniWjggHNMIIByTAJ
11+
BgNVHRMEAjAAMB8GA1UdIwQYMBaAFMCEmSnETp87AjT2meEKVgAIKT57MHMGCCsG
12+
AQUFBwEBBGcwZTA1BggrBgEFBQcwAoYpaHR0cDovL2Muc2suZWUvVGVzdF9vZl9F
13+
U1RFSUQyMDE4LmRlci5jcnQwLAYIKwYBBQUHMAGGIGh0dHA6Ly9haWEuZGVtby5z
14+
ay5lZS9lc3RlaWQyMDE4MB8GA1UdEQQYMBaBFDM4MDAxMDg1NzE4QGVlc3RpLmVl
15+
MEcGA1UdIARAMD4wMgYLKwYBBAGDkSEBAQEwIzAhBggrBgEFBQcCARYVaHR0cHM6
16+
Ly93d3cuc2suZWUvQ1BTMAgGBgQAj3oBAjAgBgNVHSUBAf8EFjAUBggrBgEFBQcD
17+
AgYIKwYBBQUHAwQwawYIKwYBBQUHAQMEXzBdMAgGBgQAjkYBATBRBgYEAI5GAQUw
18+
RzBFFj9odHRwczovL3NrLmVlL2VuL3JlcG9zaXRvcnkvY29uZGl0aW9ucy1mb3It
19+
dXNlLW9mLWNlcnRpZmljYXRlcy8TAmVuMB0GA1UdDgQWBBS4o0jDfX8kNdQdsOqq
20+
S3Yvx0vk2jAOBgNVHQ8BAf8EBAMCA4gwCgYIKoZIzj0EAwQDgYwAMIGIAkIA52jr
21+
H5u3U+KQ8gWuXFi+3hqsR6O0NG5hoFQN6Qk1P3xH1U9WEYrzBrfMTRAxAGHGh6JX
22+
jxjGyHAwiMVBnD4UBWUCQgFU4YC4yybxs6lsWp9h8pvLb72eqibkq50Jjb19bwhk
23+
mPaHamWsjrX1071PHqk7W4szaKrxy49qBuoiouLtjug9hQ==
24+
-----END CERTIFICATE-----

cdoc2-cli/keys/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
This directory contains pre-generate EC keys and downloaded id-card certificates.
22

3+
## Extract private and public keys from newly generated client certificate only if it was updated in capsule server
4+
Remote repository and branches must be set up manually in `remote_repository.sh` before running keys
5+
extracting script to copy updated client-certificate.pem and keystore cdoc2client.p12 from
6+
cdoc2-capsule-server/cdoc2-server/keys into cdoc2-cli/keys.
7+
Then run following script `extract_client_keys.sh` here for extracting keys from certificate:
8+
9+
```bash
10+
source remote_repository.sh
11+
sh extract_client_keys.sh
12+
```
13+
314
## Convert X509 Certificate DER to PEM
415
.der and .cer are the same binary format.
516
```
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
-----BEGIN CERTIFICATE-----
2-
MIICWTCCAd+gAwIBAgIJAIGzuV1v0kYtMAoGCCqGSM49BAMEMHQxCzAJBgNVBAYT
3-
AkVFMRAwDgYDVQQIEw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