[openssl-users] Smartcard cert used for encrypt\decrypt

Boyd Ako boyd.hanalei.ako at gmail.com
Wed Jan 30 23:07:55 UTC 2019

Does anybody know how to use the smartcard to encrypt and decrypt files?

I was able to encrypt a file using the cert on the smartcard. However, I
couldn't decrypt it. I think it's mainly because I don't know how to get
the Private Key on the token to decrypt it. I've tried `pkcs11-tool -l --id
0002 -r --type privkey` but I get a "sorry, reading private keys not (yet)
supported" message.

To encrypt:
pkcs15-tool -r 0002 > x509.cert
openssl smime -encrypt -binary -aes-256-cbc -in clear.txt -out
clear.txt.enc -outform PEM x509.cert

Thank you for your time,

Boyd H. Ako

boyd.hanalei.ako at gmail.com

PGP/GPG Public Key:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20190130/1c5146d0/attachment.html>

More information about the openssl-users mailing list