Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

fix dcc hash encoding base64 to hex #121

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down