Commit 89be7144 authored by Alberto Inch's avatar Alberto Inch
Browse files

Adding init token function.

parent c3734bb1
......@@ -17,6 +17,7 @@ class Token
void close(CK_SESSION_HANDLE hSession);
void changePin(CK_SESSION_HANDLE hSession, const char* oldPin, const char* newPin);
void unlock(CK_SESSION_HANDLE hSession, const char* soPin, const char* newPin);
void init(CK_SLOT_ID slot, const char* soPin);
virtual ~Token();
protected:
......
......@@ -87,6 +87,14 @@ void Token::unlock(CK_SESSION_HANDLE hSession, const char* soPin, const char* ne
functionList->C_Logout(hSession);
error(rv);
}
}
void Token::init(CK_SLOT_ID slot, const char* soPin) {
char soBuf[21];
strcpy(soBuf, soPin);
soPin = soBuf;
CK_RV rv = functionList->C_InitToken(slot, (CK_UTF8CHAR *)soBuf, strlen(soBuf), (unsigned char*)"ePass2003");
error(rv);
}
char* Token::byteToHex(CK_BYTE_PTR bytes, int l) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment