Skip to content
Open
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
24 changes: 24 additions & 0 deletions certificate/certificate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"ct": {
"v": "1.0",
"t": {
"ts": 1586915413,
"mod": "Biopanda Reagents RAPG-COV-019",
"id": "123456789ABCDEF",
"res": {
"c": true,
"igg": true,
"igm": false
}
},
"id": {
"loc": "GB",
"type": "passport",
"id": "123456789"
},
"auth": {
"aki": "keyid:F8:EF:7F:F2:CD:78:67:A8:DE:6F:8F:24:8D:88:F1:87:03:02:B3:EB"
}
},
"sig": "MIGIAkIBlskn0ACL67/pD2aenrcKz7rt9RC0N1Tr+Q8BR2H3bswwAN9bDwyly978m3zSN+2fL284rcrbU2xp5eymMBPGhJcCQgCjhdwuMuWuiWF0eKPGK64T67OCkbrtwj+Eo0mn3sT+LbBhMl0ST9MyYy3G2QtoXR9GT9uCIWvGaWK5T5xb9l0emA=="
}
140 changes: 140 additions & 0 deletions certificate/certificate.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "https://cov-clear.com/certificate.schema.json",
"title": "Passport Document",
"description": "A cryptographically signed document containing details of an individual (the holder)'s medical test results.",
"type": "object",
"properties": {
"ct": {
"title": "Certificate Section",
"description": "Section containing all of the data relating to the medical test, the holder, and the authority that issued the certificate.",
"type": "object",
"properties": {
"v": {
"title": "Version",
"description": "Version of the cov-clear certificate schema to which this certificate conforms.",
"type": "string"
},
"t": {
"title": "Test",
"description": "Section containing medical information about the test performed and its result.",
"type": "object",
"properties": {
"ts": {
"title": "Timestamp",
"description": "Timestamp for when the test was taken.",
"$comment": "This should be in unix timestamp format (seconds since epoch)",
"type": "number"
},
"mod": {
"title": "Test model",
"description": "An identifier for a known model of medical test",
"$comment": "Whilst including a url here could be useful, a more compact value might be preferable.",
"type": "string",
"examples": [
"Biopanda Reagents RAPG-COV-019",
"Randox Health COVID-19 HOME TESTING KIT"
]
},
"sn": {
"title": "Test Serial Number",
"description": "Serial number of the specific test unit used.",
"type": "string"
},
"res": {
"title": "Test Results",
"description": "Detailed results of the mdeical test.",
"$comment": "Note that this schema only includes results for a standard lateral flow rapid diagnostic test (RDT). ",
"type": "object",
"properties": {
"c": {
"title": "Control Reading",
"description": "Output of the RDT's control line.",
"type": "boolean"
},
"igg": {
"title": "IgG Reading",
"description": "Output of the RDT's IgG antibody line.",
"type": "boolean"
},
"igm": {
"title": "IgM Reading",
"description": "Output of the RDT's IgM antibody line.",
"type": "boolean"
}
},
"required": [ "c", "igg", "igm" ]
}
},
"required": [ "ts", "mod", "res" ]
},
"id": {
"title": "Identification",
"description": "Section identifying the identity document to which this certificate relates.",
"$comment": "The certificate holder should present the id document in order to prove ownership of the certificate",
"type": "object",
"properties": {
"loc": {
"title": "Document Locale",
"description": "An ISO-3166 country code representing the locale for which this identity document is valid.",
"type": "string",
"examples": [
"GB",
"EE",
"US"
]
},
"type": {
"title": "Document Type",
"description": "Type of identity document.",
"type": "string",
"examples": [
"Passport",
"Driving License",
"National Identity Card"
]
},
"id": {
"title": "Document ID",
"description": "Identifier for the document.",
"type": "string"
}
},
"required": [ "loc", "type", "id" ]
},
"auth": {
"title": "Authority",
"description": "Section containing details of the testing authority that performed the test and thus issued the certificate.",
"type": "object",
"properties": {
"aki": {
"title": "Authority Key Identifier",
"description": "ID for the public key corresponding to the private key with which this document was signed.",
"$comment": "This identifies the performer of the test, and acts as a quick way for a verifying application to identify the public key with which the signature can be verified",
"type": "string"
},
"name": {
"title": "Name of the authority that performed the test",
"description": "Name of the authority that performed the test.",
"type": "string",
"examples": [
"UK, South London Covid mobile testing station",
"EE, Saaremaa Immunity Testing Laboratory"
]
}
},
"required": [ "aki" ]
}
},
"required": [ "v", "t", "id", "auth" ]
},
"sig": {
"title": "Signature",
"description": "A base64 encoded X-bit signature for the ct section created using the signing authority's private key.",
"$comment": "Whitespace should be removed from the ct section (e.g. using jq . -c) prior to generating the signature.",
"$comment": "TODO(explain in more detail how to create certs etc).",
"type": "string"
}
},
"required": [ "ct", "sig" ]
}
23 changes: 23 additions & 0 deletions certificate/out/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# README

## Top-level Schemas

- [Passport Document](./certificate.md "A cryptographically signed document containing details of an individual (the holder)'s medical test results") – `https://cov-clear.com/certificate.schema.json`

## Other Schemas

### Objects

- [Authority](./certificate-properties-certificate-section-properties-authority.md "Section containing details of the testing authority that performed the test and thus issued the certificate") – `https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth`
- [Certificate Section](./certificate-properties-certificate-section.md "Section containing all of the data relating to the medical test, the holder, and the authority that issued the certificate") – `https://cov-clear.com/certificate.schema.json#/properties/ct`
- [Identification](./certificate-properties-certificate-section-properties-identification.md "Section identifying the identity document to which this certificate relates") – `https://cov-clear.com/certificate.schema.json#/properties/ct/properties/id`
- [Test](./certificate-properties-certificate-section-properties-test.md "Section containing medical information about the test performed and its result") – `https://cov-clear.com/certificate.schema.json#/properties/ct/properties/t`
- [Test Results](./certificate-properties-certificate-section-properties-test-properties-test-results.md "Detailed results of the mdeical test") – `https://cov-clear.com/certificate.schema.json#/properties/ct/properties/t/properties/res`

### Arrays



## Version Note

The schemas linked above follow the JSON Schema Spec version: `http://json-schema.org/draft-04/schema#`
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Authority Key Identifier Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/aki
```

ID for the public key corresponding to the private key with which this document was signed.


> This identifies the performer of the test, and acts as a quick way for a verifying application to identify the public key with which the signature can be verified
>

| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## aki Type

`string` ([Authority Key Identifier](certificate-properties-certificate-section-properties-authority-properties-authority-key-identifier.md))
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Name of the authority that performed the test Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/name
```

Name of the authority that performed the test.


| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## name Type

`string` ([Name of the authority that performed the test](certificate-properties-certificate-section-properties-authority-properties-name-of-the-authority-that-performed-the-test.md))

## name Examples

```json
"UK, South London Covid mobile testing station"
```

```json
"EE, Saaremaa Immunity Testing Laboratory"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Untitled undefined type in Passport Document Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties
```




| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## properties Type

unknown
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Authority Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth
```

Section containing details of the testing authority that performed the test and thus issued the certificate.


| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ------------ | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | No | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## auth Type

`object` ([Authority](certificate-properties-certificate-section-properties-authority.md))

# Authority Properties

| Property | Type | Required | Nullable | Defined by |
| :------------ | -------- | -------- | -------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [aki](#aki) | `string` | Required | cannot be null | [Passport Document](certificate-properties-certificate-section-properties-authority-properties-authority-key-identifier.md "https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/aki") |
| [name](#name) | `string` | Optional | cannot be null | [Passport Document](certificate-properties-certificate-section-properties-authority-properties-name-of-the-authority-that-performed-the-test.md "https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/name") |

## aki

ID for the public key corresponding to the private key with which this document was signed.


> This identifies the performer of the test, and acts as a quick way for a verifying application to identify the public key with which the signature can be verified
>

`aki`

- is required
- Type: `string` ([Authority Key Identifier](certificate-properties-certificate-section-properties-authority-properties-authority-key-identifier.md))
- cannot be null
- defined in: [Passport Document](certificate-properties-certificate-section-properties-authority-properties-authority-key-identifier.md "https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/aki")

### aki Type

`string` ([Authority Key Identifier](certificate-properties-certificate-section-properties-authority-properties-authority-key-identifier.md))

## name

Name of the authority that performed the test.


`name`

- is optional
- Type: `string` ([Name of the authority that performed the test](certificate-properties-certificate-section-properties-authority-properties-name-of-the-authority-that-performed-the-test.md))
- cannot be null
- defined in: [Passport Document](certificate-properties-certificate-section-properties-authority-properties-name-of-the-authority-that-performed-the-test.md "https://cov-clear.com/certificate.schema.json#/properties/ct/properties/auth/properties/name")

### name Type

`string` ([Name of the authority that performed the test](certificate-properties-certificate-section-properties-authority-properties-name-of-the-authority-that-performed-the-test.md))

### name Examples

```json
"UK, South London Covid mobile testing station"
```

```json
"EE, Saaremaa Immunity Testing Laboratory"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Document ID Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/id/properties/id
```

Identifier for the document.


| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## id Type

`string` ([Document ID](certificate-properties-certificate-section-properties-identification-properties-document-id.md))
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Document Locale Schema

```txt
https://cov-clear.com/certificate.schema.json#/properties/ct/properties/id/properties/loc
```

An ISO-3166 country code representing the locale for which this identity document is valid.


| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
| :------------------ | ---------- | -------------- | ----------------------- | :---------------- | --------------------- | ------------------- | --------------------------------------------------------------------------- |
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [certificate.schema.json\*](certificate.schema.json "open original schema") |

## loc Type

`string` ([Document Locale](certificate-properties-certificate-section-properties-identification-properties-document-locale.md))

## loc Examples

```json
"GB"
```

```json
"EE"
```

```json
"US"
```
Loading