Skip to content

sylvain-prevost/ePassportLibrary

Repository files navigation

ePassport Library

C# library leveraging BinaryNotes.NET to enable parsing/manipulation/encoding of MRTD security features (Passport certificates, picture/fingerprints Datagroups, etc).

Nuget

Example of use:


using (FileStream fs = File.Open(filename, FileMode.Open))
{
    byte[] data = new byte[fs.Length];
    fs.Read(data, 0, data.Length);

    ContentInfo contentInfo = Utils.DerDecode<ContentInfo>(data);

    KnownOids oid = Oids.ParseKnown(contentInfo.ContentType.Value.Value);
    if (oid == KnownOids.signedData)
    {
        SignedData signedData = Utils.DerDecode<SignedData>(contentInfo.Content);

        // check if SignedData contains a cscaMasterList object
        if (Oids.ParseKnown(signedData.EncapContentInfo.EContentType.Value.Value) == KnownOids.cscaMasterList)
        {
            // check the masterlist digest signature here
            // ....

            // now obtain the master list content
            CscaMasterList cscaMasterList = Utils.DerDecode<CscaMasterList>(signedData.EncapContentInfo.EContent);

            Console.WriteLine("number of certs present in cscaMasterList : " + cscaMasterList.CertList.Count);

            foreach (Certificate certificate in cscaMasterList.CertList)
            {
                // .. do stuff ..
            }
        }
    }

}

see examples folder for additional examples, including parsing and visualization of face & fingerprints.


Output from examples.


Alt text



About

C# library to ease decoding/encoding/validation of ePassport data (certificates, face, fingerprint, etc..).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages