If it is not a PIN code but key based authentication, the error is misleading. In which context is this function called? (for example, if used through PKCS#11, how does the usual call stack look like in terms of C_ functions?)