@@ -230,8 +230,9 @@ When certificate has expired there is needed to replace it with new certificate
230230
231231 CDocBuilder builder = new CDocBuilder ()
232232 .withPayloadFiles(Arrays . asList(payloadFiles))
233- .withRecipients(List . of(km))
234- .buildToFile(cdoc2FileToCreate);
233+ .withRecipients(List . of(km));
234+
235+ builder. buildToFile(cdoc2FileToCreate);
235236```
236237
237238### To decrypt with password:
@@ -257,10 +258,12 @@ When certificate has expired there is needed to replace it with new certificate
257258
258259 List<EncryptionKeyMaterial > recipients =
259260 EncryptionKeyMaterial . collectionBuilder(). fromEId(new String []{identificationCode});
261+
260262 CDocBuilder builder = new CDocBuilder ()
261263 .withPayloadFiles(Arrays . asList(payloadFiles))
262- .withRecipients(recipients)
263- .buildToFile(cdoc2FileToCreate);
264+ .withRecipients(recipients);
265+
266+ builder. buildToFile(cdoc2FileToCreate);
264267```
265268
266269** Note** : this works only for end user id-cards. It doesn't work for test id-cards as test-id card
@@ -332,11 +335,13 @@ directory and `.withServerProperties` method:
332335
333336 List<EncryptionKeyMaterial > recipients =
334337 EncryptionKeyMaterial . collectionBuilder(). fromEId(new String []{identificationCode});
338+
335339 CDocBuilder builder = new CDocBuilder ()
336340 .withServerProperties(p)
337341 .withPayloadFiles(Arrays . asList(payloadFiles))
338- .withRecipients(recipients)
339- .buildToFile(cdoc2FileToCreate);
342+ .withRecipients(recipients);
343+
344+ builder. buildToFile(cdoc2FileToCreate);
340345```
341346** Note** : ` cdoc2-cli/config ` contains usually several properties files. For id-card usage, use one with
342347the shortest name (without ` _pkcs12 ` or ` _p12 ` in name).
@@ -376,13 +381,12 @@ key parts
376381 .forAuthMeans(new String []{identificationCode}) // will create authentication based recipient, that can be decrypted with SID/MID
377382 .build();
378383
379-
380- CDocBuilder builder = new CDocBuilder ()
384+ CDocBuilder builder = new CDocBuilder ()
381385 .withPayloadFiles(files)
382386 .withRecipients(encKeyMaterial)
383387 .withServices(services);
384388
385- builder. buildToFile(cdoc2FileToCreate);
389+ builder. buildToFile(cdoc2FileToCreate);
386390```
387391
388392### Decrypting with key material from the server
0 commit comments