Using Nitrokey Pro to programatically encode data


i’m working on a project, where we want verify some data programatically. The idea is to encrypt the data with a private key and decrypt it in our software, where the public key is provided (e.g. hard-coded). So i followed the process of generating a rsa-key pair and stored the private keys on a Nitrokey Pro Stick.
Now the question is, how the encryption can be done? What i need is a method, where i can put data in, which encrypts the data with the stored private key. Then this method would return the encrypted data. Can this be done with the libnitrokey or is this done via another library like OpenSSL or is this the wrong workflow? I looked into the nitrokey-lib, but could not find a suitable method.

Kind Regards,

Hello Andreas!

I think the best library for this case would be OpenSC.
As for libnitrokey, it works with the additional, non-smartcard features, like OTP or Password Safe.


Hi Szczepan,

thank you for your answer and the suggestion.