-
Notifications
You must be signed in to change notification settings - Fork 6
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
Data access without PIN #34
Comments
Hello, This part for example is not explained anywhere, I think. I was wondering why we have to sign the card with a payload and what kind of payload actually needs to be sent. Because ABC seems more liike a debug string?
I was wondering if you could explain to me with a proper example how the sent commands and responses can be interpreted. In the beginning the following cmds are sent and responses are received.
I would like to know how to decode these strings. I tried to check the gem Spezifikation but didn't really know where to start |
Also at wich point, can I start sending commands? When I check the DemoApp
|
Hello @sigabrtz I think I got the correct data but I don't know how to decode the hexString. In the issues you tagged are some ideas and suggestions about decoding the data, but it doesn't seem clear to me. If you could provide proper documentation how to decode the hexValues that would be great. |
@sigabrtz Hello again. I am still struggeling to find the correct way of decoding the data read from the HCA.PD file. Any kind of help would be highly appreciated!
|
Hi @priska96, I don't know that neither off the top of my head. Have you gotten any further by now? I'll try to work it out and possibly extend the app. Reading the PD from card (or doing anything without entry of the PIN) is a common use case that should be showcased in the demo app/code for reference as well. I see that the signing/login part you asked about is a bit confusing... What actually is accomplished here is to transmit some data to the card so that the card can execute a signing operation on it and we receive it's result. In this demo code we transmit just static debug-string (as you correctly assumed). In real life (our E-Rezept app) we transmit a string we just requested from a identification server and use that result (the signed data) to eventually login to the data server. So that's the background on the sign/login confusion. I'll probably change a button label to mitigate that. |
@sigabrtz Hello again! However I realized, that the insurance number is not part of the data. It's not a big deal as the insurance number is already printed on the card. But I am wondering, if there is a file on the card that holds the insurance number. Do you know that by any chance? Here now is my extended code:
|
Thanks for sharing. This will help me figure out some stuff as well. According to the xsd schema definition
|
Oh, yes you are right! I simply just did not see that entry in the xml xD My bad!! Very welcome! I'm glad I could be of some help. Do you perhaps also know if some file on the eGK hold information about which insurance company the person is registered at? That's also of course visible by just looking at the card. If it's a DAK-Gesundheit, or AOK or Barma etc. But again, it would be nice to read that data automatically as well. I checked the file (schema_VSD.xsd) you posted earlier and there it says smth about "UC_AllgemeineVersicherungsdatenXML" element and "Versicherter.Versicherungsschutz.Kostentraeger" I just don't know which file on the card holds this "UC_AllgemeineVersicherungsdatenXML". Because on the PD file I can only find the personal data "UC_PersoenlicheVersichertendatenXML" of the card holder. |
UC_PersoenlicheVersichertendatenXML.xsd states that there is a child You'll need a up-to-date list of IK-to-insurance-mapping I guess. |
Okay thank you I will look into that. Another thing popped up.
That was due to the fact that your frameworks can only be added via SPM and there was no way to add an spm_dependency to a .podspec so far. I need the podspec since I am building a react native npm package. A week ago react native added spm_dependency for the podspec. Which is great because now I can reference your frameworks like so:
However, I run into this error with OpenSSL.framework. I am not very familiar with xcode and the build process.
It assumes that the framework should be found in the PackagesFrameworks folder of my module that I am building (the gk-nfc-reader). Which is not the case though. I am wondering if there might be some bug on your side when the HealthCardAccess and HealthCardControl frameworks are build ? |
Could you open a new issue for that problem? Seems interesting. |
Yes sure! EDIT: |
@sigabrtz Another thing I'm curios about. In all your additional documents and files about the eGK is there a section about how the response data of the specific files is decoded? I only figured it out, because some other guy in another issue posted this solution and I am really wonderin how he figured that out. |
The first two bytes indicate the length of the data. That is (possibly a bit arbitrarily but) it's specified here: https://gemspec.gematik.de/docs/gemSpec/gemSpec_eGK_Fach_VSDM/gemSpec_eGK_Fach_VSDM_V1.2.1/#2.4 So you actually have to read these two bytes (before "cut off") to know how much further to read your data input for the "real" information. In the smart card world such data+lentgth encoding is not uncommon, there is even a standard ASN.1 that is used by smart cards and in PKI that also employs this length-encoding. We (gematik) have our own implentation of this standard https://github.com/gematik/ASN1Kit for now. |
Ohhh I was looking for that file!! Thanks a lot!!
I didn't know about that. It's actually my first time working with Swift, SmartCards etc. Thanks for your help and this awesome repo! |
I extended the demo App target by the use case "read personal data" (still in PR phase). In hindsight this would have helped out quite a bit I suppose. I think this issue is resolved then? |
Great! Thanks a lot! I haven't checked it yet, but It would be great if you could also include proper decoding/unzipping of the data to get human readable data ^^ An yes, this issue is resolved now! Thanks a lot! |
Maybe I get something wrong, but it's included.
Check out the other use cases how the PIN is transmitted to card. After that the card is in an "opened up" state (during the session) and you have access to more data and applications (like signing). |
Oh yes you are absolutely right! I guess I misunderstood the code. Thanks again! |
Hello gematik,
Is it possible to also access the data that is not protected by the PIN? Based on the current documentation it's not clear for me.
Currently I am trying to implement reading the insurance number, Card holder name, card holder address via NFC for ios devices in React Native.
Any help would be great!
The text was updated successfully, but these errors were encountered: