-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to sign using a hardware token? #235
Comments
Hello - there is no guide, because I've never heard of such a need before. Can you provide some more details? What specifically are you trying to accomplish? What is the API for your token? |
Well, my use case is signing a XML but using a certificate stored in hardware token (SafeNet eToken 5110 in my case). I searched a bit more and ended up using a java library already (xades4j), so, it's not a huge priority for me. Having it In Python would be nicer though (as all my other code to manage things is in Python). I have some code which works for me to sign it (pasted below using the PyKCS11, which I know works when using my token here), but it lacks the support to save in the xades format.
|
Thanks, yeah I think support for PKCS11 is outside the scope of this library's design. If you need specific changes to the SignXML API to make it easier to subclass for your needs and isolate the signing functionality, let me know. |
Opened #237 to track PKCS11 support. |
Is there currently any way to sign XML using smart card HSM and store it for example in specification like https://www.w3.org/TR/xmldsig-core/. |
@ii00 as I mentioned above, I've opened a separate issue to track PKCS11 support, so as long as your smart card HSM supports PKCS11, that work will help once it is completed. The XML Signature specification you linked does not explicitly mention smart cards or HSMs. Can you elaborate on the specific part of the spec you were referring to, and the specific application that you need this for, with an example? |
@kislyuk I have to authorize our medical app to our governmental National Health Information System:
Obviously I have to use library like PyKCS11 or python-pkcs11 to get the private key and certificate as @fabioz showed in his example. Then use XAdESSigner() which takes data, key and cert. I can extract the cert and pass it in base64. But key parameter have to be string or RSAPrivateKey |
Hello, is there some guide on how to use signxml using a hardware token?
-- I'm not sure if this is a feature request or just something I didn't find in the documentation -- I did spend a good time looking for it, but couldn't find it.
As a note, I actually can get to sign with the
PyKCS11
library, but it doesn't really provide the other parts expected fromXAdES
(so, not sure if some integration would be welcome if it's something not supported).The text was updated successfully, but these errors were encountered: