Closed yzhang666 closed 3 years ago
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) {
val headers = response.headers()
val responseKid = headers[HEADER_KID]
val newResumeToken = headers[HEADER_RESUME_TOKEN]
val responseStr =
response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false
if (validCertList.contains(responseKid)) {
Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified")
val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!)
db.keyDao().insert(key)
preferences.resumeToken = resumeToken
newResumeToken?.let {
val newToken = it.toLong()
fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) { val headers = response.headers() val responseKid = headers[HEADER_KID] val newResumeToken = headers[HEADER_RESUME_TOKEN] val responseStr = response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false if (validCertList.contains(responseKid)) { Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified") val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!) db.keyDao().insert(key) preferences.resumeToken = resumeToken newResumeToken?.let { val newToken = it.toLong() fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
Hi, many thanks for your help.
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) { val headers = response.headers() val responseKid = headers[HEADER_KID] val newResumeToken = headers[HEADER_RESUME_TOKEN] val responseStr = response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false if (validCertList.contains(responseKid)) { Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified") val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!) db.keyDao().insert(key) preferences.resumeToken = resumeToken newResumeToken?.let { val newToken = it.toLong() fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
And may I ask, how to solve the duplicate results issue? Because if I just fetch the response headers, I still get a lot of duplicate results.
Hello @yzhang666
many thanks for your help.
You're welcome.
And may I ask, how to solve the duplicate results issue? Because if I just fetch the response headers, I still get a lot of duplicate results.
Just read&use the officially provided code for SDK = VerifierRepositoryImpl.kt includes the related checks/actions too in order to right arrange KID DB with the signer updates.
I am currently working with the Italian APIs v1/dgc/signercertificate/update and v1/dgc/signercertificate/status. Recently, I found that the data in the two APIs are unable to align. Here is the example:
For the kid "zrMytIH40Rk=", the order of kid in the API v1/dgc/signercertificate/status is 233
However, when you call the API v1/dgc/signercertificate/update by using the order 233,234 or 232 as the x-resume-token, none of the returned response header data is correct: Test1:
Test2:
It seems that the Italian APIs put the necessary verify information in two separate URLs, but now the two URLs cannot be aligned.
P.S. I found another interesting point, if you set the x-resume-token between 85-165, you will get the same returned data with token ID 166: Test1:
Test 2:
I want to ask, who should I report to about the API issue?