-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification re multiple QR codes #178
Comments
Commenting on this as I have also ran into this issue. According to the SMART Health card specs - it says that Any JWS longer than 1195 characters SHALL be split into "chunks" of length 1191 or smaller; To implement this logic, I followed the code in the repo at index.ts L179. The result I get is an array of 2 qr code segments that look like this:
However, when using the verifier portal to try to validate the qr code data, the the qr numeric data produces an invalid JWS string. This is shown in the screenshot below. (Using mock data of course) I fear that this error is the reason why the validator apps are failing when there are multiple qr codes, because the qr codes that have the numeric data embedded in them don't produce a valid JWS string, making it hard for a node library like node-jose to correctly decode the data and verify. I would love some guidance on how we should go about fixing this. Perhaps there was a different logic to take for chunking the JWS string once it's longer than 1195 characters in the JWS string. Appreciate the time, thank you. |
@jasonxylee Are you encoding the array of 2 parts into a single part instead of encoding each part individually? The invalid JWS error is the result of the jws missing the signature segment at the end. |
@ljoy913 Thank you for your response, the verifier portal does not accept Can you please clarify what you mean when you say "Are you encoding the array of 2 parts into a single part instead of encoding each part individually?" |
@jasonxylee It appears that you're missing a Example from the docs:
Note the |
@dleve123 - Thank you, I made sure that I included a trailing |
@jasonxylee |
@ljoy913 Yes, i am including both 1/2, and 2/2 for the numeric qr code: qrCodeSegments: [
[
{ data: 'shc:/1/2/', mode: 'byte' },
{
data: '5676290952432060346029243740446031222959532654603460292540772804336028702864716745222809286367633725110556251231413959243862294052654537416441393864407554645528456145365265417239235971386441573762257534412460573601104558125312707424285350387022726060772960720466520834633633704038336663112421394132762263203838547232245072111238626453286311101077744462274111765372275850275432004054681261420012084170086559776272530473346353414506696338101173557176620573415335655745003077692224714572264157636065595669085229546732717664532255443340121150715670726909530928770635687108336773401125711039083223115759205229566904352623300509070408041045722566717267346112630907362930057345567043040853230829444035370568057673094004664254606741676372523625061012333138046368272638715433417060691157617007404376032007396555523633670324336921100921263821090450422003256100726923206656270407285058107174356674360510622532303303672327316606764206597766064438396568123562212726744355656532572559554563591265084324754507552311723105377654655375505811501239335531774034426226307776400471722310572035316242770544005874652352712741440053273106635270703509622323657237505434233007335531312027652759412271352173311011327604550711',
mode: 'numeric'
}
],
[
{ data: 'shc:/2/2/', mode: 'byte' },
{
data: '0674670505726763057164534252207754096856605506717307053053234371036100325456767362415205665564652530226624122339002269321003684530522907652227243833710304625810656640310612623642387343527509364331385642124063370556110839422770363238065763735812642441387623390826250005370734773636324158085968617528614568566568063977350572563309223057115665243456100334723839281140345624003907283754243443102834402634275028105050742854583836760434222723506225402634275030382832543556402636070755327558702145232956222222391140282064447443207059627321212029723241350036082638112462326307284421327558702145232956222222391140282064447443207059627321212029723425202328453174383676436125231062580707402032596273212923295622262039324431204236764358585862502522202964322574312845317436362253615936207626525007285655627321212029723425202328453174383676435859582477262274256232630728282935753658224561215422762638112424206407754050452129561139326406754050441229551139326405754050440829551139326404754050440429551139326403754050447529552439255659091150014063427539570650587730582869717262213564666245422208330539403008035034115671414177034264052142643057335362276074390063735711763426034230306650253161085600571152200033534374',
mode: 'numeric'
}
]
] |
Your shc header for part one should be shc:/1/2/<data> for part 1-of-2 The verifier cannot validate a single part of a multi-part QR code. |
@jasonxylee |
@ljoy913 Thank you for the explanation, i see now that we weren't supposed to separate them out.. We are using the 2 numeric qr codes right now to generate 2 separate QR codes. But I guess it cannot be done that way if it cannot be verified separately. So then my question now is, once the JWS string is over 1195 characters, and we chunk it into multiple chunks, do we merge all the chunks together to create one QR code? My understanding from reading the SMART Health card documentation was that each chunk represented one QR code, however I guess that could have been a mistake. |
@jasonxylee You just cannot verify them one at a time in the verifier portal. There is a limitation with the UI that you can only manually enter a single set of numeric data if you are not using the scanner. Did you try scanning both of your resulting QR codes in the verifier? |
@ljoy913 could you please comment on how these separate QR codes should be read in the SMART Health Card apps? As I noted in the original question, I have run the 2 QR codes through the SMART Health Cards Dev Tools validator like so:
and received a successful validation message (other than the warning that I didn't need to split into 2, which I just did for testing): Validation results
But I get errors when scanning the QR codes with the app readers. |
@littleforest |
My 2 QR codes worked fine in the verifier portal. I'm guessing the issue must be that the current app readers out there do not have the capability to read multiple QR codes? I can close this ticket if that is likely the case. Thanks! |
I have followed the spec for how to handle the case when the JWS needs to be split up into multiple chunks to create multiple QR codes, and have run the resulting numeric and QR code PNGs through the SMART Health Cards Dev Tools validator successfully. However, when I try to read any of these QR codes with the SMART Health Card Verifier iOS app, I just get an error that it is an unsupported QR code. Are multiple QR codes not yet supported on these apps, or is there some way that they need to be displayed so that they get picked up correctly by the reader? I am having no trouble with single QR codes getting read correctly by the app.
The text was updated successfully, but these errors were encountered: