Giter VIP home page Giter VIP logo

Comments (10)

rgex avatar rgex commented on August 11, 2024

As far as I know, the DSC is always present on the NFC chip. To verify the chain of trust you need to get the CSCA master list from the ICAO PKD or the BSI or the Schengen Masterlist and this will be enough.

Then you will need verify the chain: CSCA -> DSC -> LDS hash -> Data Group hashes -> Data Group contents and then you are good.

from nfcpassportreader.

puneetmahali avatar puneetmahali commented on August 11, 2024

Hi @rgex, Thanks for the quick reply.
Great. Is it possible to get the DSC(Document Signing Certificate) with passive authentication to validate the hashes? I already got the Data Groups Hashes and wants DSC without masterlist.

from nfcpassportreader.

puneetmahali avatar puneetmahali commented on August 11, 2024

I mean I will do the checks myself that means need to achieve the DSC's somehow.

from nfcpassportreader.

rgex avatar rgex commented on August 11, 2024

The SOD data group is a PKCS7 file. It contains the DSC. I don't know the current project but using openssl you can deserialize the PKCS7 File and then call p7->d.sign->cert which will return you a STACK_OF(X509) pointer https://github.com/UBIC-repo/core/blob/b83d31c932b40ee908d2f7059d72283d52fd7118/PassportReader/PKCS7/PKCS7Parser.cpp#L76

from nfcpassportreader.

rgex avatar rgex commented on August 11, 2024

Perhaps you can describe us what you want to achieve?
Where do you want to do the verification, on a remote server or on the phone?
For what you are describing you'll need to use either OpenSSL, no way around.

from nfcpassportreader.

puneetmahali avatar puneetmahali commented on August 11, 2024

Yes, I want to achieve the Datagroups data with their hashes and now I want to achieve the DSC certificate so I can validate with those on my own backend. I just need to popup the JSON and PUT into the database for validation checks.
So, In Andy's library how can I got the DSC certificates. I already make the JSON just need to add the DSC also on that JSON.

from nfcpassportreader.

puneetmahali avatar puneetmahali commented on August 11, 2024

Hi @AndyQ ,
`let sod = passport.getDataGroup(.SOD)

let sodData = Data(sod.body)`

In debugging mode I am getting: DataGroup & pkck7CertificateData = ([UInt8]) 48 values
But I am unable to get the pkck7CertificateData byte data. It comes NULL.

Because I think I am passing .body need to pass pkck7CertificateData but it's not accesible.

And my func look like:
//MARK: Fetch the Digital Signature Certificate(DSC) do { guard let sod = passport.getDataGroup(.SOD) else { throw PassiveAuthenticationError.SODMissing("No SOD found" ) } let sodData = Data(sod.body) let certificateData = try OpenSSLUtils.getX509CertificatesFromPKCS7( pkcs7Der: sodData).first! self.sodDataVal = ["certificateData" : certificateData] print(certificateData) }catch { print(error) }

So, I need to fetch the pkck7CertificateData UInt8 byte data then I will play around it.

from nfcpassportreader.

AndyQ avatar AndyQ commented on August 11, 2024

This page may give you some pointers:
http://wiki.yobi.be/wiki/EPassport - specifically the Verifying a passport section.

This is pretty much what I am doing.

You may want to look at the other method ensureReadDataNotBeenTamperedWith in NFCPassportModel - this also extracts the DSC from the SOD and verifies the SOD signed data section against it.

from nfcpassportreader.

AndyQ avatar AndyQ commented on August 11, 2024

Did that help?

from nfcpassportreader.

AndyQ avatar AndyQ commented on August 11, 2024

Closing as assuming all ok now.

from nfcpassportreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.