We are using SoftHSM in our application. We have generated tokens and imported keys in it. Now we have created one job which monitors if our SoftHSM is Up and running.

For that, It seems that the Session.GetOperationState() method should be able to work. However I am getting an error message as below:

Method C_GetOperationState returned CKR_FUNCTION_NOT_SUPPORTED.

Please help, if this method is suitable for my need or should I usew some other function. Thanks in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

Method Session::GetOperationState freezes cryptographic operation (e.g. after computation of hash for the first half of file) and method Session::SetOperationState resumes cryptographic operation (e.g. for the computation of hash for the second half of the file).

If you want to perform health check of your HSM it should be enough to open new session with Slot::OpenSession method, check its state with Session::GetSessionInfo method and close the session afterwards.