<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Does anybody know how to use the smartcard to encrypt and decrypt files?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">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.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">To encrypt:</div><div class="gmail_default" style="font-family:monospace,monospace">pkcs15-tool -r 0002 > x509.cert</div><div class="gmail_default" style="font-family:monospace,monospace">openssl smime -encrypt -binary -aes-256-cbc -in clear.txt -out clear.txt.enc -outform PEM x509.cert</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><br><br><br>
<hr align="left" width="25%">
Thank you for your time,<br><br>Boyd H. Ako<br><br><a href="mailto:boyd.hanalei.ako@gmail.com" target="_blank">boyd.hanalei.ako@gmail.com</a></div><div><a href="https://www.boydhanaleiako.me" target="_blank">https://www.boydhanaleiako.me<br></a><br>PGP/GPG Public Key: <a href="https://sks-keyservers.net/pks/lookup?op=get&search=0xC58073B21618F134" target="_blank">https://sks-keyservers.net/pks/lookup?op=get&search=0xC58073B21618F134</a><br>
<hr>
</div></div></div></div></div></div></div></div>