@@ -33,7 +33,7 @@ To create:
3333- to encrypt file 'README.md'
3434
3535```
36- java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc -p keys/bob_pub.pem README.md
36+ java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc2 -p keys/bob_pub.pem README.md
3737```
3838
3939### Encryption with server scenario
@@ -43,19 +43,19 @@ To store keys in key server, specify addition `--server` option:
4343
4444When encrypting for est-eid card, ` -r ` <id-code > can be used
4545```
46- java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost_id-card.cdoc -r 38001085718 README.md
46+ java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost_id-card.cdoc2 -r 38001085718 README.md
4747```
4848
4949Optionally cdoc2-cli also supports encrypting with "soft" key or certificate
5050
5151Public key (` -p ` )
5252```
53- java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc -p keys/cdoc2client_pub.key README.md
53+ java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc2 -p keys/cdoc2client_pub.key README.md
5454```
5555
5656Certificate (` -c ` option):
5757```
58- java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc -c keys/cdoc2client-certificate.pem README.md
58+ java -jar target/cdoc2-cli-*.jar create --server=config/localhost/localhost.properties -f /tmp/localhost.cdoc2 -c keys/cdoc2client-certificate.pem README.md
5959```
6060
6161Key capsule expiration date can be requested when adding expiry duration:
@@ -78,12 +78,12 @@ Base64 encoded keys must be prefixed with 'base64,', so that key becomes "base64
7878
7979Encrypt with generated key and label 'label_b64secret':
8080```
81- java -jar target/cdoc2-cli-*.jar create --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0=" -f /tmp/symmetric.cdoc README.md
81+ java -jar target/cdoc2-cli-*.jar create --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0=" -f /tmp/symmetric.cdoc2 README.md
8282```
8383
8484Or secret read from file (so that secret is not exposed through process list)
8585```
86- java -jar target/cdoc2-cli-*.jar create @keys/b64secret.option -f /tmp/symmetric.cdoc README.md
86+ java -jar target/cdoc2-cli-*.jar create @keys/b64secret.option -f /tmp/symmetric.cdoc2 README.md
8787```
8888
8989```
@@ -92,28 +92,28 @@ cat keys/b64secret.option --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACf
9292
9393Or encrypt with password clear text (note, that password also can be encoded to base64 format, as secret):
9494```
95- java -jar target/cdoc2-cli-*.jar create --password "passwordlabel:myPlainTextPassword" -f /tmp/password.cdoc README.md
95+ java -jar target/cdoc2-cli-*.jar create --password "passwordlabel:myPlainTextPassword" -f /tmp/password.cdoc2 README.md
9696```
9797
9898Decryption is done with the same label and key used for encryption
9999```
100- java -jar target/cdoc2-cli-*.jar decrypt @keys/b64secret.option -f /tmp/symmetric.cdoc -o /tmp
100+ java -jar target/cdoc2-cli-*.jar decrypt @keys/b64secret.option -f /tmp/symmetric.cdoc2 -o /tmp
101101```
102102
103103Or with the same label and password used for encryption:
104104```
105- java -jar target/cdoc2-cli-*.jar decrypt --password "passwordlabel:myPlainTextPassword" -f /tmp/password.cdoc --output /tmp
105+ java -jar target/cdoc2-cli-*.jar decrypt --password "passwordlabel:myPlainTextPassword" -f /tmp/password.cdoc2 --output /tmp
106106```
107107
108108If cdoc2 file contains only one password, then specifying label is not required and label can be omitted:
109109```
110- java -jar target/cdoc2-cli-*.jar decrypt --password ":myPlainTextPassword" -f /tmp/password.cdoc --output /tmp
110+ java -jar target/cdoc2-cli-*.jar decrypt --password ":myPlainTextPassword" -f /tmp/password.cdoc2 --output /tmp
111111```
112112
113113
114114Or with the same label and secret used for encryption:
115115```
116- java -jar target/cdoc2-cli-*.jar decrypt --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0=" -f /tmp/symmetric.cdoc --output /tmp
116+ java -jar target/cdoc2-cli-*.jar decrypt --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0=" -f /tmp/symmetric.cdoc2 --output /tmp
117117```
118118
119119Key and label can be safely stored in a password manager.
@@ -125,14 +125,14 @@ Current encryption/decryption implementation of cdoc2 container with Smart ID su
125125personal ID codes.
126126
127127```
128- java -jar target/cdoc2-cli-*.jar create --smart-id=38001085718 -f /tmp/smartid.cdoc README.md
128+ java -jar target/cdoc2-cli-*.jar create --smart-id=38001085718 -f /tmp/smartid.cdoc2 README.md
129129```
130130
131131Multiple ID codes are allowed to be sent for encryption:
132132
133133```
134134java -jar target/cdoc2-cli-*.jar create -sid=38001085718 -sid=47101010033 \
135- -f /tmp/smartid.cdoc README.md
135+ -f /tmp/smartid.cdoc2 README.md
136136```
137137
138138Key shares or Smart-ID properties can be sent externally by adding following options (the same
@@ -151,14 +151,14 @@ Current encryption/decryption implementation of cdoc2 container with Mobile ID s
151151Estonian personal ID codes.
152152
153153```
154- java -jar target/cdoc2-cli-*.jar create --mobile-id=51307149560 -f /tmp/mobileid.cdoc README.md
154+ java -jar target/cdoc2-cli-*.jar create --mobile-id=51307149560 -f /tmp/mobileid.cdoc2 README.md
155155```
156156
157157Multiple ID codes are allowed to be sent for encryption:
158158
159159```
160160java -jar target/cdoc2-cli-*.jar create -mid=51307149560 -mid=60001017869 \
161- -f /tmp/mobileid.cdoc README.md
161+ -f /tmp/mobileid.cdoc2 README.md
162162```
163163
164164Key shares or Mobile-ID properties can be sent externally by adding following options (the same
@@ -173,50 +173,50 @@ and/or
173173
174174### Decryption
175175To decrypt:
176- - CDOC2 file ` /tmp/mydoc.cdoc `
176+ - CDOC2 file ` /tmp/mydoc.cdoc2 `
177177- with decryption private EC key ` keys/bob.pem `
178178- to output directory ` /tmp `
179179
180180```
181- java -jar target/cdoc2-cli-*.jar decrypt --file /tmp/mydoc.cdoc -k keys/bob.pem --output /tmp
181+ java -jar target/cdoc2-cli-*.jar decrypt --file /tmp/mydoc.cdoc2 -k keys/bob.pem --output /tmp
182182```
183183
184184or with Smart-ID for Estonian personal ID code:
185185
186186```
187- java -jar target/cdoc2-cli-*.jar decrypt -sid=38001085718 -f /tmp/smartid.cdoc --output /tmp
187+ java -jar target/cdoc2-cli-*.jar decrypt -sid=38001085718 -f /tmp/smartid.cdoc2 --output /tmp
188188```
189189
190190or with Mobile-ID for Estonian personal ID code and Estonian phone number with country code ` +372 ` :
191191
192192```
193193java -jar target/cdoc2-cli-*.jar decrypt -mid=51307149560 -mid-phone=+37269930366 \
194- -f /tmp/mobileid.cdoc --output /tmp
194+ -f /tmp/mobileid.cdoc2 --output /tmp
195195```
196196
197197### Decrypting with server scenario
198198Server must be running, see cdoc2-capsule-server/README.md for starting the server
199199
200- To decrypt CDOC document that has its keys distributed through key server, cdoc -cli must have ` --server ` option:
200+ To decrypt CDOC2 document that has its keys distributed through key server, cdoc2 -cli must have ` --server ` option:
201201
202202Configuration for id-card (certificate for mutual TLS and private key is read from smart-card)
203203```
204- java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost.properties -f /tmp/localhost_id-card.cdoc -o /tmp/
204+ java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost.properties -f /tmp/localhost_id-card.cdoc2 -o /tmp/
205205```
206206
207207It is also possible to decrypt documents created with "soft" keys, but configuration for mutual TLS (properties file) and
208208key (read separately from a file) must match. Also, server must be configured to trust client certificate used for
209209mutual TLS.
210210```
211- java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client_priv.key -o /tmp/
211+ java -jar target/cdoc2-cli-*.jar decrypt --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc2 -k keys/cdoc2client_priv.key -o /tmp/
212212```
213213
214214
215215### Re-encryption with password for long time storage
216216
217217First encrypt the document:
218218```
219- java -jar target/cdoc2-cli-*.jar create --secret "mylongpasswd:longstringthatIcanremember,butothersdon'tknow" -f /tmp/symmetric.cdoc README.md
219+ java -jar target/cdoc2-cli-*.jar create --secret "mylongpasswd:longstringthatIcanremember,butothersdon'tknow" -f /tmp/symmetric.cdoc2 README.md
220220```
221221
222222Create different directory for re-encrypted container:
@@ -226,42 +226,42 @@ mkdir -p /tmp/cdoc2
226226
227227Then re-encrypt it with password for long-term storage:
228228```
229- java -jar target/cdoc2-cli-*.jar re-encrypt --encpassword "passwordlabel:myPlainTextPassword" --secret "mylongpasswd:longstringthatIcanremember,butothersdon'tknow" -f /tmp/symmetric.cdoc --output /tmp/cdoc2
229+ java -jar target/cdoc2-cli-*.jar re-encrypt --encpassword "passwordlabel:myPlainTextPassword" --secret "mylongpasswd:longstringthatIcanremember,butothersdon'tknow" -f /tmp/symmetric.cdoc2 --output /tmp/cdoc2
230230```
231231
232232For testing decryption ensure the correct re-encrypted container location:
233233```
234- java -jar target/cdoc2-cli-*.jar decrypt --password "passwordlabel:myPlainTextPassword" -f /tmp/cdoc2/symmetric.cdoc --output /tmp/cdoc2
234+ java -jar target/cdoc2-cli-*.jar decrypt --password "passwordlabel:myPlainTextPassword" -f /tmp/cdoc2/symmetric.cdoc2 --output /tmp/cdoc2
235235```
236236
237237### List
238238
239239```
240- java -jar target/cdoc2-cli-*.jar list --file /tmp/mydoc.cdoc -k keys/bob.pem
240+ java -jar target/cdoc2-cli-*.jar list --file /tmp/mydoc.cdoc2 -k keys/bob.pem
241241```
242242
243243or with server scenario:
244244
245245```
246- java -jar target/cdoc2-cli-*.jar list --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc -k keys/cdoc2client_priv.key
246+ java -jar target/cdoc2-cli-*.jar list --server=config/localhost/localhost_pkcs12.properties -f /tmp/localhost.cdoc2 -k keys/cdoc2client_priv.key
247247```
248248
249249or with password:
250250```
251- java -jar target/cdoc2-cli-*.jar list --file /tmp/symmetric.cdoc --password "passwordlabel:myPlainTextPassword"
251+ java -jar target/cdoc2-cli-*.jar list --file /tmp/symmetric.cdoc2 --password "passwordlabel:myPlainTextPassword"
252252```
253253
254254or with secret:
255255```
256- java -jar target/cdoc2-cli-*.jar list --file /tmp/symmetric.cdoc --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0="
256+ java -jar target/cdoc2-cli-*.jar list --file /tmp/symmetric.cdoc2 --secret "label_b64secret:base64,aejUgxxSQXqiiyrxSGACfMiIRBZq5KjlCwr/xVNY/B0="
257257```
258258
259259### List recipients
260260
261- List recipients. Prints recipient types and key labels from CDOC header.
261+ List recipients. Prints recipient types and key labels from CDOC2 header.
262262
263263```
264- java -jar target/cdoc2-cli-*.jar info -f /tmp/id.cdoc
264+ java -jar target/cdoc2-cli-*.jar info -f /tmp/id.cdoc2
265265```
266266
267267
@@ -275,18 +275,18 @@ https://github.com/SK-EID/LDAP/wiki/Knowledge-Base
275275
276276To create cdoc for recipient with id code 37101010021 use:
277277```
278- java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc -r 37101010021 README.md
278+ java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc2 -r 37101010021 README.md
279279```
280280
281281
282282### Decrypting with ID-card
283283
284284To decrypt:
285- - CDOC file mydoc.cdoc
285+ - CDOC file mydoc.cdoc2
286286- use private key from ID-card slot 0 (Isikutuvastus PIN1)
287- - Decrypt files from cdoc file into current directory
287+ - Decrypt files from cdoc2 file into current directory
288288```
289- java -jar target/cdoc2-cli-*.jar decrypt -f mydoc.cdoc
289+ java -jar target/cdoc2-cli-*.jar decrypt -f mydoc.cdoc2
290290```
291291
292292### Certificate extraction
307307### Encrypting documents with certificate
308308
309309To create:
310- - Output file ` /tmp/mydoc.cdoc `
310+ - Output file ` /tmp/mydoc.cdoc2 `
311311- with generated private key
312312- to recipient with certificate ` keys/cdoc2client-certificate.pem ` (DER or PEM formats are supported)
313313- to encrypt file 'README.md'
314314
315315```
316- java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc -c keys/cdoc2client-certificate.pem README.md
316+ java -jar target/cdoc2-cli-*.jar create --file /tmp/mydoc.cdoc2 -c keys/cdoc2client-certificate.pem README.md
317317```
318318
319319Decrypt created container with private key:
320320```
321- java -jar target/cdoc2-cli-*.jar decrypt -f /tmp/mydoc.cdoc -k keys/cdoc2client_priv.key --output /tmp
321+ java -jar target/cdoc2-cli-*.jar decrypt -f /tmp/mydoc.cdoc2 -k keys/cdoc2client_priv.key --output /tmp
322322```
323323
324324### Troubleshooting ID-card
@@ -329,7 +329,7 @@ cdoc2-cli will try to configure itself automatically. If OpenSC library is insta
329329specify its location by setting 'pkcs11-library' property:
330330
331331```
332- java -jar target/cdoc2-cli-*.jar decrypt -Dpkcs11-library=/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -f mydoc.cdoc
332+ java -jar target/cdoc2-cli-*.jar decrypt -Dpkcs11-library=/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -f mydoc.cdoc2
333333```
334334
335335More tips for debugging ID-card related issues are provided in cdoc2-lib/pkcs11.README file
@@ -340,7 +340,7 @@ More tips for debugging ID-card related issues are provided in cdoc2-lib/pkcs11.
340340Set with -D option
341341
342342```
343- java -jar target/cdoc2-cli-*.jar decrypt -Dee.cyber.cdoc2.overwrite=false -f mydoc.cdoc
343+ java -jar target/cdoc2-cli-*.jar decrypt -Dee.cyber.cdoc2.overwrite=false -f mydoc.cdoc2
344344```
345345
346346#### pkcs11-library
@@ -389,13 +389,13 @@ Encrypt certificate as described in the "Encrypting documents with certificate"
389389List files encrypted for the eToken device by specifying pkcs11 library, slot and key alias:
390390
391391```
392- java -jar target/cdoc2-cli-*.jar list -f file-for-etoken.cdoc -Dpkcs11-library=/usr/lib/libeToken.so -s 2 -a cdoc2-test
392+ java -jar target/cdoc2-cli-*.jar list -f file-for-etoken.cdoc2 -Dpkcs11-library=/usr/lib/libeToken.so -s 2 -a cdoc2-test
393393```
394394
395395Decrypt files encrypted for the eToken device by specifying pkcs11 library, slot and key alias:
396396
397397```
398- java -jar target/cdoc2-cli-*.jar decrypt -f file-for-etoken.cdoc -Dpkcs11-library=/usr/lib/libeToken.so -s 2 -a cdoc2-test
398+ java -jar target/cdoc2-cli-*.jar decrypt -f file-for-etoken.cdoc2 -Dpkcs11-library=/usr/lib/libeToken.so -s 2 -a cdoc2-test
399399```
400400
401401#### ee.cyber.cdoc2.overwrite
0 commit comments