Skip to content

Commit efeeb04

Browse files
committed
Add support of Luxembourg cards
WE2-1032 Signed-off-by: Mart Somermaa <[email protected]>
1 parent 64cc5a7 commit efeeb04

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

include/electronic-id/electronic-id.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class ElectronicID
4747
HrvEID,
4848
BelEID,
4949
CzeEID,
50+
LuxtrustV2,
51+
LuxEID,
5052
#ifdef _WIN32
5153
MsCryptoApiEID,
5254
#endif

src/electronic-id.cpp

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

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

src/electronic-ids/pkcs11/Pkcs11ElectronicID.cpp

Lines changed: 36 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,30 @@ 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+
// turn off extKeyUsage check
181+
false,
182+
}},
183+
{ElectronicID::Type::LuxEID,
184+
{
185+
"Luxembourg eID (PKCS#11)"s, // name
186+
ElectronicID::Type::LuxEID, // type
187+
luxembourgPkcs11ModulePath().make_preferred(), // path
188+
189+
3,
190+
true,
191+
true,
192+
// turn off extKeyUsage check
193+
false,
194+
}},
159195
};
160196

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

0 commit comments

Comments
 (0)