Replies: 2 comments 7 replies
-
I'm not familiar with the specific token you mention, but your discovery routine is a little off:
FWIW, in order to sign over PKCS#11, you just need a private key handle. The associated certificates can be read from the PKCS#11 token, but you can also provision them out-of-band if necessary, so I'd focus on figuring out how to access the key first. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'll explain how i did it in Ubuntu 22.04 . First you need your smartcard's "label" text (Will ask you your PIN). The module "libbit4ipki.so" is from our smartcard's manufacturer, contained in the driver, that installs in this location:
I can sign with this command (after some test&error). The second is with invisible signature. The field is a internal label visible with Acrobat when you show the signature:
Hope will help you or anybody! |
Beta Was this translation helpful? Give feedback.
-
Hi,
Has anyone got PKCS11 signing working with ePass2003 token?
The terminology of certificate label /id/key_id/key_label etc seem to be different, so I first printed it and tried passing the same values. Still getting error, so wondering if I'm not looking at the right object.
Above label and Id are printing, so that means I got the library, session and certificate.
I tried many ways to get the signer, but it always gives one or the other error:
pkcs11.exceptions.PKCS11Error: Could not find cert with label '..'
This throws: pkcs11.exceptions.NoSuchKey: No key matching {<Attribute.CLASS>: <ObjectClass.PRIVATE_KEY>, <Attribute.ID>: b'7...'
3. signer = pkcs11.PKCS11Signer(
sess, cert_label='mylabel', signing_cert=cert, other_certs_to_pull=default_other_certs,
bulk_fetch=True, prefer_pss=True
)
Traceback (most recent call last):
.....site-packages\pyhanko_certvalidator\registry.py", line 137, in register
if cert.issuer_serial in self.certs:
AttributeError: 'Certificate' object has no attribute 'issuer_serial'
Beta Was this translation helpful? Give feedback.
All reactions