From: Douglas E E. <dee...@gm...> - 2016-03-25 12:45:10
|
Another option if you can not use a newer versions of pkcs11-tool. If the card has a matching certificate, use pkcs11-tool to read certificate, then use: openssl rsautl -certin On 3/24/2016 10:57 AM, Johannes Rath wrote: > Hi all, > > I want to extract the public key and use it for encryption with OpenSSL. It works fine like this: > > /pkcs15-tool --read-public-key keyid -o publickey.pem/ > > /openssl rsautl -inkey publickey.pem -pubin -encrypt -pkcs -in plaintext.txt -out ciphertext.txt/ > > // > > But when I use pkcs11-tool the exported key is kind of weird. I am using: > > /pkcs11-tool --read-object --type pubkey --id keyid -o publickey.key/ > > // > > I am trying to use publickey.key as the inkey for openssl rsautil -encrypt, but I always get an error from OpenSSL. > > Any ideas? > > Thanks in advance > > Johannes > > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 > > > > _______________________________________________ > Opensc-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensc-devel > -- Douglas E. Engert <DEE...@gm...> |