Skip to content
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

Add support for Slovenian eID #90

Open
craftbyte opened this issue Oct 21, 2024 · 3 comments
Open

Add support for Slovenian eID #90

craftbyte opened this issue Oct 21, 2024 · 3 comments

Comments

@craftbyte
Copy link

Would it be possible to support (either on APDU or PKCS#11 level) Slovenian eIDs? You can find documentation here and here. The official library is available here. If you need any extra documentation/support, I can also provide a contact at the government department that oversees eIDs.

@mrts
Copy link
Member

mrts commented Oct 30, 2024

Yes, we can add Slovenian eID support. We need your help with testing, we'll get back to this as time allows.

@mrts
Copy link
Member

mrts commented Dec 6, 2024

Can you perhaps provide at least the initial version yourself? It should be relatively easy to start with PKCS#11 level, see e.g. Czech eID support PR.

@mrts
Copy link
Member

mrts commented Dec 13, 2024

Here are step-by-step instructions for adding Slovenian eID support at the PKCS#11 level:


1. Modify electronic-id.hpp

  • Locate the ElectronicID class and add an entry for Slovenian eID.
    SloEID, // Add this line below the last eID type

2. Modify electronic-id.cpp

  • Extend the SUPPORTED_ATRS map with the Slovenian eID ATR and its corresponding constructor. Replace <ATR_VALUES> with the Slovenian eID ATR values.
    // SloEID
    {{<ATR_VALUES>},
     constructor<Pkcs11ElectronicIDType::SloEID>},

3. Modify Pkcs11ElectronicID.cpp

  • Add a helper function to define the PKCS#11 module path for Slovenian eID.

    inline fs::path slovenianPkcs11ModulePath()
    {
    #ifdef _WIN32
        return system32Path() / L"sloveniankp11.dll";
    #elif defined __APPLE__
        return "/path/to/SLOEID/libsloveniankp11.dylib";
    #else // Linux
        return "/path/to/libsloveniankp11.so";
    #endif
    }
  • Add the Slovenian eID configuration to the SUPPORTED_PKCS11_MODULES map.

    {Pkcs11ElectronicIDType::SloEID,
     {
         "Slovenian eID (PKCS#11)"s,  // name
         ElectronicID::Type::SloEID,  // type
         slovenianPkcs11ModulePath().make_preferred(), // path
         
         JsonWebSignatureAlgorithm::RS256, // authSignatureAlgorithm
         RSA_SIGNATURE_ALGOS(),            // supportedSigningAlgorithms
         3,     // retryMax
         true,  // allowsUsingLettersAndSpecialCharactersInPin
         false, // providesExternalPinDialog
     }},

4. Modify Pkcs11ElectronicID.hpp

  • Add SloEID to the Pkcs11ElectronicIDType enum.
    SloEID, // Add this below the last entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants