You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the library to sign a hash using a custom PKCS#11 provider with the following code.
lib=pkcs11.lib(lib_path)
token=lib.get_token()
withtoken.open(user_pin=pin) assession:
ifcert_label:
certs=session.get_objects({pkcs11.Attribute.LABEL: cert_label})
elifcert_id:
certs=session.get_objects({pkcs11.Attribute.ID: cert_id})
else:
raiseValueError("You have to specify a cert_id or a cert_label")
ifnotcerts:
raisepkcs11.exceptions.NoSuchObject("Certificate was not found")
cert=next(certs)
priv_keys=session.get_objects({
pkcs11.Attribute.CLASS: pkcs11.ObjectClass.PRIVATE_KEY,
pkcs11.Attribute.ID: cert[pkcs11.Attribute.ID]
})
The thing is when I call session.get_objects({pkcs11.Attribute.LABEL: cert_label}) these are the calls to the provider:
The library doesn't call C_FindObjectsFinal, which means that the operation is still on progress. When the program gets to priv_keys = session.get_objects({... the provider returns Exit: CKR_OPERATION_ACTIVE.
Is there something that I'm missing? Maybe I have to call C_FindObjectsFinal manually.
The text was updated successfully, but these errors were encountered:
I'm trying to use the library to sign a hash using a custom PKCS#11 provider with the following code.
The thing is when I call
session.get_objects({pkcs11.Attribute.LABEL: cert_label})
these are the calls to the provider:The library doesn't call C_FindObjectsFinal, which means that the operation is still on progress. When the program gets to
priv_keys = session.get_objects({...
the provider returnsExit: CKR_OPERATION_ACTIVE
.Is there something that I'm missing? Maybe I have to call C_FindObjectsFinal manually.
The text was updated successfully, but these errors were encountered: