You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2023. It is now read-only.
@@ -30,10 +30,20 @@ The service is now exposed on port 8080 (change the first number in the `-p` arg
30
30
31
31
Certificates can be verified by sending POST requests to `/v1/verify`, where the payload should be JSON with the following format:
32
32
```json
33
-
{
33
+
{
34
+
"mode": "The verification mode, e.g. THREE_G",
34
35
"hcert": "The raw payload of the certificate QR code beginning with 'HC1:'"
35
36
}
36
37
```
38
+
The `mode` field must be one of the currently valid verification modes. A list of modes can be obtained with a `GET` request to the `v1/modes` endpoint:
39
+
40
+
```json
41
+
[
42
+
"THREE_G",
43
+
"TWO_G"
44
+
]
45
+
```
46
+
37
47
38
48
The endpoint will respond with status code 400 if the certificate couldn't be decoded. Otherwise, it will respond with status code 200 and the following JSON:
39
49
```json
@@ -54,128 +64,156 @@ The endpoint will respond with status code 400 if the certificate couldn't be de
54
64
"invalidState": "..."
55
65
}
56
66
```
57
-
where only one of the three fields `successState`, `errorState`, `invalidState` is set to a non-null value, thereby indicating the corresponding verification-status.
67
+
where only one of the three fields `successState`, `errorState`, `invalidState` is set to a non-null value, thereby indicating the corresponding verification-status. Since the introduction of different verification modes, the presence of the `successState` object is no longer sufficient to indicate the validity of a certificate. You must also check the value of the `successState.successState.modeValidity.modeValidityState` field. It can currently take one of the following values:
Response for a certificate that is basically valid (i.e. recognized in Switzerland and within its validity period), but not sufficient for the current verification mode, e.g. a test certificate in 2G (vaccine/recovery only) mode:
182
+
183
+
```json
184
+
{
185
+
"certificate": {
186
+
"version": "1.0.0",
187
+
"person": {
188
+
"familyName": "Valid",
189
+
"standardizedFamilyName": "VALID",
190
+
"givenName": "Test",
191
+
"standardizedGivenName": "TEST"
192
+
},
193
+
"dateOfBirth": "14.06.2007",
194
+
"personName": {
195
+
"familyName": "Valid",
196
+
"standardizedFamilyName": "VALID",
197
+
"givenName": "Test",
198
+
"standardizedGivenName": "TEST"
199
+
},
200
+
"formattedDateOfBirth": "14.06.2007"
201
+
},
202
+
"successState": {
203
+
"successState": {
204
+
"modeValidity": {
205
+
"mode": "TWO_G",
206
+
"modeValidityState": "INVALID"
207
+
}
208
+
},
209
+
"isLightCertificate": false
210
+
},
211
+
"errorState": null,
212
+
"invalidState": null
213
+
}
214
+
```
215
+
Pay special attention to the `successState` object. It is present, indicating that the certificate itself is valid, but the `modeValidityState` indicates that it is invalid under the selected mode.
Copy file name to clipboardExpand all lines: ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/controller/SimpleController.java
Copy file name to clipboardExpand all lines: ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/controller/VerificationController.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ public VerificationController(VerificationService verificationService) {
0 commit comments