Skip to content

Commit

Permalink
Czech eID card support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmayer authored and mrts committed Sep 15, 2023
1 parent 4436cc9 commit 350c45e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/electronic-id/electronic-id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ElectronicID
HrvEID,
BelEIDV1_7,
BelEIDV1_8,
CzeEID,
#ifdef _WIN32
MsCryptoApiEID,
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/electronic-id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ const std::map<byte_vector, ElectronicIDConstructor> SUPPORTED_ATRS {
{{0x3b, 0x7f, 0x96, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xb0,
0x85, 0x04, 0x01, 0x20, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00},
constructor<Pkcs11ElectronicIDType::BelEIDV1_8>},
// CzeEID
{{0x3b, 0x7e, 0x94, 0x00, 0x00, 0x80, 0x25, 0xd2, 0x03, 0x10, 0x01, 0x00, 0x56, 0x00, 0x00,
0x00, 0x02, 0x02, 0x00},
constructor<Pkcs11ElectronicIDType::CzeEID>},
};

inline std::string byteVectorToHexString(const byte_vector& bytes)
Expand Down
23 changes: 23 additions & 0 deletions src/electronic-ids/pkcs11/Pkcs11ElectronicID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ inline fs::path belgianPkcs11ModulePath()
#endif
}

inline fs::path czechPkcs11ModulePath()

Check notice

Code scanning / CodeQL

Unused static function Note

Static function czechPkcs11ModulePath is unreachable
{
#ifdef _WIN32
return system32Path() / L"eopproxyp11.dll";
#elif defined __APPLE__
return "/usr/local/lib/eOPCZE/libeopproxyp11.dylib";
#else // Linux
return "/usr/lib/x86_64-linux-gnu/libeopproxyp11.so";
#endif
}

const std::map<Pkcs11ElectronicIDType, Pkcs11ElectronicIDModule> SUPPORTED_PKCS11_MODULES {
// EstEIDIDEMIAV1 configuration is here only for testing,
// it is not enabled in getElectronicID().
Expand Down Expand Up @@ -158,6 +169,18 @@ const std::map<Pkcs11ElectronicIDType, Pkcs11ElectronicIDModule> SUPPORTED_PKCS1
true,
true,
}},
{Pkcs11ElectronicIDType::CzeEID,
{
"Czech eID (PKCS#11)"s, // name
ElectronicID::Type::CzeEID, // type
czechPkcs11ModulePath().make_preferred(), // path

JsonWebSignatureAlgorithm::RS256, // authSignatureAlgorithm
RSA_SIGNATURE_ALGOS(), // supportedSigningAlgorithms
3,
true,
false,
}},
};

const Pkcs11ElectronicIDModule& getModule(Pkcs11ElectronicIDType eidType)
Expand Down
1 change: 1 addition & 0 deletions src/electronic-ids/pkcs11/Pkcs11ElectronicID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum class Pkcs11ElectronicIDType {
HrvEID,
BelEIDV1_7,
BelEIDV1_8,
CzeEID,
};

struct Pkcs11ElectronicIDModule
Expand Down

0 comments on commit 350c45e

Please sign in to comment.