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 a detailed slot info.

Here is the source code. You can compile the codes with:

$gcc cryinfo.c -o slotinfo -lpkcs11