Created
October 27, 2021 16:45
-
-
Save GaetanoPiazzolla/806f86586bd8e3b2c24eae9ac743ef4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void fetchCertificate(String resumeToken, List<String> possibleKids) throws CertificateException, IOException { | |
System.out.println("Fetching new certificate"); | |
// rest call | |
Response<String> resp = apiCertificate.getCertUpdate(resumeToken).execute(); | |
if (resp.isSuccessful()) { | |
var headers = resp.headers(); | |
var responseKid = headers.get(HEADER_KID); | |
var newResumeToken = headers.get(HEADER_RESUME_TOKEN); | |
String keyString = resp.body(); | |
if (keyString != null && !keyString.isBlank()) { | |
if (possibleKids.contains(responseKid)) { | |
PublicKey key = getPublicKey(keyString); | |
keyMap.put(responseKid, key); | |
} else { | |
System.out.println(".....mumble.... this should never happen"); | |
} | |
fetchCertificate(newResumeToken, possibleKids); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
related to medium article https://gae-piaz.medium.com/green-pass-qr-code-signature-verification-java-f742079cc88