See https://hackmd.io/kvyVFD5cQK2Bg1_vnXSh_Q
Generate a QR Link. Data Sharer asks resource server to generate a QR Link for a Sharing Manifest or individual file. This is encoded as a shclink:/...
URI. The QR can be configured as limited-use (e.g., only redeemable once), and optionally bound to a PIN that the Data Receiver must present to the Resource Server in order to follow the QR Link.
url
: URL for the authorization server (https://
endpoint).exp
: Optional. Expiration time in Epoch seconds. Hint to help the Data Recipient determine if this QR is stale.flags
: Optional. String created by concatenating single-character flags in alphabetical order
L
for long-term useO
for one-time-useP
if a receiver-supplied PIN is required for redemptiondecrypt
: Conditional. Omitted if the target resource is not encrypted. Included otherwise. This key is used to encrypt/decrypt the target file. (Format: 43 character string consisting of 32 random bytes, base64urlencoded. This field is necessary if we want to support encrypting files so that the resource server and authorization sever can't read them.)shclink:/
#
if the resource server wishes to provide a landing page and/or a viewer for this contentShare the QR Link. Data Sharer allows a Data Recipient to scan the QR code.
Follow the QR Link to redeem it. Data Recipient "redeems" a link by submitting a POST
to the the .url
property from the shclink:/
JSON payload, appending the PIN to this URL if the QR's .flags
field indicates that a PIN is required. If the request is valid, the Resource Server returns a 301 Moved Permanently
status and a Location:
header redirecting the client to a high-entropy URL where the Sharing Manifest is exposed (or in the case of a single file: a direct link to that file). Data Recipient SHALL follow up to three redirects, dereferencing any redirect Locations via GET
to arrive at a Sharing Manifest with a MIME type of application/smart-health-links-manifest+json
or an individual data file with a MIME type of application/smart-health-links+jose
.
?PIN={bound PIN}
parameter on the initial POST
before responding with a redirect header. If an incorrect PIN is supplied, this increments the server's cumulative count of failed redemption attempts. When this count exceeds a server-defined threshold (say, ~5), the Resource Server SHALL inactive the QR Link and respond with a 410 Gone
status. (Note that a request with a missing or empty PIN does not contribute to the failed redeption count.)Decrypt Received Files. To decrypt files, the Data Recipient:
.decrypt
value (yielding a 32-byte random sequence)"alg": "dir", "enc": "A256GCM"
, where the header includes only the alg
and dir
claims and the payload is the full shared file.Optional: Update Shared Files. For some sharing scenarios, the Data Sharer MAY update the shared files from time to time (e.g., when new lab results arrive or new immunizations are performed). Updated verions SHALL be encrypted using the same key (if any) as the initial version.
Optional: Periodically Re-fetch Updated Files. When the original QR includes the L
flag for long-term use, the Data Recipient MAY re-fetch contents at any time. When re-fetching data, the Data Recipient SHALL begin from the final redirect URL it discovered when first following the QR Link, because the first-stage redirection may no longer be in place.