Peter Koch <pk <at> opensc-project.org> writes:

> How did you encrypt your data? Looks like a padding problem to me.
> OpenSC assumes that you used PKCS#1-padding before you encrypted
> your data. I'm not sure whether all keys on your SignTrust card
> supports non-PKCS#1-padding. Let me know if you must decrypt
> non-PKCS#1-padded data.
> 
> Peter
> 

I encrypt data with OpenSSL. 

First, I create RSA object by d2i_RSAPublicKey then call RSA_public_encrypt 
with RSA_PKCS1_PADDING last parameter. Size of exit buffer obtain by RSA_size.


On decrypt operation, ADPU has first data byte "0x81", as I know it is indicate 
to use PKCS1 crypted data. 

I was testing this code on other cards (cardos and netkey). Cardos don't 
support PKCS#1-padding, so in exit buffer after decryption don't cut out 
pudding bytes (other problem :( ). But encrypt\decrypt operations on both cards 
complete successfully.




_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to