diff --git a/src/main/java/app/coronawarn/quicktest/service/DccService.java b/src/main/java/app/coronawarn/quicktest/service/DccService.java index 3d379bae..3c5f1916 100644 --- a/src/main/java/app/coronawarn/quicktest/service/DccService.java +++ b/src/main/java/app/coronawarn/quicktest/service/DccService.java @@ -78,7 +78,7 @@ public void collectPublicKeys() { log.debug("got public key for {} testid", dccPublicKey.getTestId()); DgcData dgcData = genDcc(quickTest, dccPublicKey.getPublicKey(), dccPublicKey.getDcci()); DccUploadData dccUploadData = new DccUploadData(); - dccUploadData.setDccHash(Base64.getEncoder().encodeToString(dgcData.getHash())); + dccUploadData.setDccHash(Hex.toHexString(dgcData.getHash())); dccUploadData.setDataEncryptionKey(Base64.getEncoder().encodeToString(dgcData.getDek())); dccUploadData.setEncryptedDcc(Base64.getEncoder().encodeToString(dgcData.getDataEncrypted())); try { diff --git a/src/test/java/app/coronawarn/quicktest/service/DccServiceTest.java b/src/test/java/app/coronawarn/quicktest/service/DccServiceTest.java index 1fd5093d..24fc6000 100644 --- a/src/test/java/app/coronawarn/quicktest/service/DccServiceTest.java +++ b/src/test/java/app/coronawarn/quicktest/service/DccServiceTest.java @@ -10,6 +10,7 @@ import app.coronawarn.quicktest.model.Sex; import app.coronawarn.quicktest.repository.QuickTestArchiveRepository; import app.coronawarn.quicktest.repository.QuickTestRepository; +import com.fasterxml.jackson.databind.ObjectMapper; import eu.europa.ec.dgc.DgciGenerator; import java.nio.charset.StandardCharsets; import java.security.KeyPair; @@ -113,6 +114,9 @@ void dccSignDcc() throws Exception { quickTest = quickTestRepository.findById(quickTest.getHashedGuid()).get(); assertNotNull(quickTest.getDccSignData()); assertEquals(DccStatus.pendingSignature, quickTest.getDccStatus()); + ObjectMapper objectMapper = new ObjectMapper(); + System.out.println("\n### upload data ###\n"+quickTest.getDccSignData()); + dccService.uploadDccData();