Skip to content
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

there are any plan to support PKCS11 certificates? #847

Closed
welitonfreitas opened this issue Jun 21, 2019 · 2 comments
Closed

there are any plan to support PKCS11 certificates? #847

welitonfreitas opened this issue Jun 21, 2019 · 2 comments

Comments

@welitonfreitas
Copy link

hi,

The are any plans for supporting PKCS11 certs? I have the need to use some hardware certificates for ssl requests.

if not, what is the difficulty and where to start implementing it today in pyopenssl?

tanks..

@danizen
Copy link

danizen commented Dec 19, 2019

I'm not a pyopenssl developer, but it looks like the minimum needed to do this is to implement a sub-class of OpenSSL.crypto.PKey which acts as a wrapper for a private key on a smart card, and returns a sub-class of cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey which implements the sign method on the smart card itself.

A possibility for this is to use the package PyKCS11 to dialog with the smart card - this has worked for me for basic encryption, decryption and signing previously on both Windows and OS X.

See related issue requests/toolbelt#282 and related issue LudovicRousseau/PyKCS11#68

@reaperhulk
Copy link
Member

PKCS11 support requires OpenSSL engines, which are not planned for support at this time. You can do this by patching ENGINE functions back into cryptography and using them though.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants