<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>I’m struggling with the following task. I’m writing a software application linked with OpenSSL-1.0.2. It receives an encrypted symmetric key (say, with identifying parameters) that needs to be decrypted using hardware token, accessible via PKCS#11. I know that engine_pkcs11 (or rather it’s current incarnation libp11) does that fine when invoked via CLI.</div><div><br></div><div>My question is: what’s the smallest simplest code example that you could share to show an absolutely minimalistic way of performing such decryption? Let’s assume that everything is already known or determined from those other parameters – like the token type is already known (RSA), the serial number + CN + SAN of the certificate used to encrypt, etc.</div><div><br></div><div>Thank you, and apologies if this question is less than smart.</div><div><br></div><div>P.S. An alternative is to access the token directly via OpenSC (as libp11 does it anyway), but I suspect it would be more complicated code-wise?</div><div><div>-- </div><div><div style="font-size: medium;">Regards,</div><div style="font-size: medium;">Uri Blumenthal</div></div></div></body></html>