> Question: what is limitation on size of pbData for successful decryption. 
> I know, what for successful encryption, size of pbData must be less of equal 
> max_in_size. On decryption for NetKey card max_in_size == 117 (ex_size == 
> 128,  
> RSA_PKCS1_PADDING_SIZE == 11), but if in RSA_public_encrypt *pdwDataLen > 
> 114, 
> then tcos decrypt adpu return error 0x6988 ("key object used for sm has 
> invalid 
> format").

With TCOS cards and 1024 bit keys your padding must be at least 11 bytes.
PKCS#1-padding will add another 3 bytes, i.e.

00 <block type byte> <padding bytes> 00 <data bytes>

Hence your data must contain no more than 128-11-3=114 bytes. If it
does not, then TCOS will respond with 6988.

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

Reply via email to