Dump PKCS11 Slot Info
Recently, I needed a tool to show the detailed PKCS11 slot information. Cryptoadm is a good utility to display cryptographic provider information for a system, but it does not show me the "ulMaxSessionCount" field, which was important to me at that time, I was eager to know what's the maximum number of sessions that can be opened with the token at one time by a single application. Google did not help this time, so I had to write a simple tool by myself. Past the code here, maybe one day, it will save me a lot time when I need such a detailed slot info. Compile the codes with: $gcc cryinfo.c -o slotinfo -lpkcs11 Copy (or download ), save, compile the source code bellow: #include <stdio.h> #include <security/cryptoki.h> #include <security/pkcs11.h> extern void dump_info(); int main(int argc, char **argv) { CK_RV rv; CK_MECHANISM mechanism = {CKM_RC4, NULL_PTR, 0L}; CK_SESSION_HANDLE hSession; // initialize teh crypto ...