|
|
@ -1061,17 +1061,19 @@ namespace cryptoki { |
|
|
|
bool inittoken(std::string pin, FixString<32> label) { |
|
|
|
bool inittoken(std::string pin, FixString<32> label) { |
|
|
|
CRYPTOLOG("log"); |
|
|
|
CRYPTOLOG("log"); |
|
|
|
//! calls @c C_InitToken
|
|
|
|
//! calls @c C_InitToken
|
|
|
|
|
|
|
|
std::string in(label); |
|
|
|
|
|
|
|
in.resize(32, ' '); |
|
|
|
if (pin.size()) |
|
|
|
if (pin.size()) |
|
|
|
return check(_library->C_InitToken |
|
|
|
return check(_library->C_InitToken |
|
|
|
(_slot, |
|
|
|
(_slot, |
|
|
|
(unsigned char*)&pin[0], pin.size(), |
|
|
|
(unsigned char*)&pin[0], pin.size(), |
|
|
|
(unsigned char*)&label.fix()[0]), |
|
|
|
(unsigned char*)&in[0]), |
|
|
|
CRYPTOKI_FN_LOG("C_InitToken")); |
|
|
|
CRYPTOKI_FN_LOG("C_InitToken")); |
|
|
|
else |
|
|
|
else |
|
|
|
return check(_library->C_InitToken |
|
|
|
return check(_library->C_InitToken |
|
|
|
(_slot, |
|
|
|
(_slot, |
|
|
|
0, 0, // pin from external pin pad
|
|
|
|
0, 0, // pin from external pin pad
|
|
|
|
(unsigned char*)&label.fix()[0]), |
|
|
|
(unsigned char*)&in[0]), |
|
|
|
CRYPTOKI_FN_LOG("C_InitToken")); |
|
|
|
CRYPTOKI_FN_LOG("C_InitToken")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|