Skip to content

Commit 4118078

Browse files
committed
Add support of Luxembourg cards
WE2-1032 Signed-off-by: Mart Somermaa <mrts@users.noreply.github.com>
1 parent 470d62e commit 4118078

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

include/electronic-id/electronic-id.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class ElectronicID
5050
HrvEID,
5151
BelEID,
5252
CzeEID,
53+
LuxtrustV2,
54+
LuxEID,
5355
#ifdef _WIN32
5456
MsCryptoApiEID,
5557
#endif

src/electronic-id.cpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,78 @@ const std::vector<MaskedATREntry> MASKED_ATRS = {
120120
{{0x3b, 0x98, 0x13, 0x40, 0x0a, 0xa5, 0x03, 0x01, 0x01, 0x01, 0xad, 0x13, 0x11},
121121
{0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
122122
constructor<ElectronicID::Type::BelEID>},
123+
// LuxtrustV2
124+
{{0x3B, 0x7D, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x83,
125+
0x00, 0x90, 0x00},
126+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF,
127+
0x00, 0xFF, 0xFF},
128+
constructor<ElectronicID::Type::LuxtrustV2>},
129+
// LuxEID
130+
{{0x3B, 0x7F, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xB0,
131+
0x00, 0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00},
132+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
133+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
134+
constructor<ElectronicID::Type::LuxEID>},
135+
// LuxEID
136+
{{0x3B, 0xFF, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
137+
0xB0, 0x00, 0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
138+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
139+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
140+
constructor<ElectronicID::Type::LuxEID>},
141+
// LuxEID
142+
{{0x3B, 0x8F, 0x00, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
143+
0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
144+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
145+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
146+
constructor<ElectronicID::Type::LuxEID>},
147+
// LuxEID
148+
{{0x3B, 0x88, 0x00, 0x01, 0xE1, 0xF3, 0x5E, 0x11, 0x00, 0x87, 0x95, 0x00, 0x00},
149+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00},
150+
constructor<ElectronicID::Type::LuxEID>},
151+
// LuxEID
152+
{{0x3b, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xb0,
153+
0x00, 0x04, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00},
154+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
155+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
156+
constructor<ElectronicID::Type::LuxEID>},
157+
// LuxEID
158+
{{0x3b, 0xff, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
159+
0xb0, 0x00, 0x04, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x00},
160+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
161+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
162+
constructor<ElectronicID::Type::LuxEID>},
163+
// LuxEID
164+
{{0x3B, 0x8F, 0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
165+
0x04, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
166+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
167+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
168+
constructor<ElectronicID::Type::LuxEID>},
169+
// LuxEID
170+
{{0x3b, 0x88, 0x80, 0x01, 0x00, 0x88, 0x3c, 0x1f, 0x77, 0x81, 0x95, 0x00, 0xc1},
171+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
172+
constructor<ElectronicID::Type::LuxEID>},
173+
// LuxEID
174+
{{0x3b, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xb0,
175+
0x00, 0x05, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00},
176+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
177+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
178+
constructor<ElectronicID::Type::LuxEID>},
179+
// LuxEID
180+
{{0x3b, 0xff, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
181+
0xb0, 0x00, 0x05, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x00},
182+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
183+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
184+
constructor<ElectronicID::Type::LuxEID>},
185+
// LuxEID
186+
{{0x3B, 0x8F, 0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
187+
0x05, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
188+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
189+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
190+
constructor<ElectronicID::Type::LuxEID>},
191+
// LuxEID
192+
{{0x3b, 0x88, 0x80, 0x01, 0xe1, 0xf3, 0x5e, 0x11, 0x77, 0xa1, 0x97, 0x00, 0x15},
193+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
194+
constructor<ElectronicID::Type::LuxEID>},
123195
};
124196

125197
std::string byteVectorToHexString(const byte_vector& bytes)

src/electronic-ids/pkcs11/Pkcs11ElectronicID.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ inline fs::path czechPkcs11ModulePath()
103103
#endif
104104
}
105105

106+
inline fs::path luxembourgPkcs11ModulePath()
107+
{
108+
#ifdef _WIN32
109+
return programFilesPath() / L"Gemalto/Classic Client/BIN/gclib.dll";
110+
#elif defined __APPLE__
111+
return "/Library/Frameworks/Pkcs11ClassicClient.framework/Versions/A/Pkcs11ClassicClient/"
112+
"libgclib.dylib";
113+
#else // Linux
114+
return "/usr/lib/pkcs11/libgclib.so";
115+
#endif
116+
}
117+
106118
const std::map<ElectronicID::Type, Pkcs11ElectronicIDModule> SUPPORTED_PKCS11_MODULES {
107119
// EstEID configuration is here only for testing,
108120
// it is not enabled in getElectronicID().
@@ -156,6 +168,26 @@ const std::map<ElectronicID::Type, Pkcs11ElectronicIDModule> SUPPORTED_PKCS11_MO
156168
true,
157169
false,
158170
}},
171+
{ElectronicID::Type::LuxtrustV2,
172+
{
173+
"LuxtrustV2 eID (PKCS#11)"s, // name
174+
ElectronicID::Type::LuxtrustV2, // type
175+
luxembourgPkcs11ModulePath().make_preferred(), // path
176+
177+
3,
178+
true,
179+
false,
180+
}},
181+
{ElectronicID::Type::LuxEID,
182+
{
183+
"Luxembourg eID (PKCS#11)"s, // name
184+
ElectronicID::Type::LuxEID, // type
185+
luxembourgPkcs11ModulePath().make_preferred(), // path
186+
187+
3,
188+
true,
189+
true,
190+
}},
159191
};
160192

161193
const Pkcs11ElectronicIDModule& getModule(ElectronicID::Type eidType)

0 commit comments

Comments
 (0)