logo       

Re: opensc and infocamere card: msg#00253

encryption.opensc.devel

Subject: Re: opensc and infocamere card

Il giorno mar, 29-03-2005 alle 15:17 +0200, Stef Hoeben ha scritto:
> Hi,
>
> you are sure that your file (filetobesigned) has the same size as your key's
> modulus (that's required for the RSA-X-509 mechanism).
>
> If it's just for testing, you could try "pkcs11-tool -t -l".
>
> Or "pkcs15-crypt -s -i <file_of_20_bytes> --pkcs11 --sha-1 -o signat.bin
> -k <keyID>"
> (to find out the keyID: "pkcs15-tool -k").

Thank you Stef,
I did not check the file size since I didn't know about this constraint.
The first command line you suggested gives an error:

giuseppe@eppesuig3:~$ LD_LIBRARY_PATH=/usr/local/lib
giuseppe@eppesuig3:~$ export LD_LIBRARY_PATH
giuseppe@eppesuig3:~$ /usr/local/bin/pkcs11-tool -t -l
pkcs15.c:483:sc_pkcs15_bind_internal: unable to enumerate apps: Unknown
data received from card
card-etoken.c:162:etoken_check_sw: file not found
iso7816.c:440:iso7816_select_file: returning with: File not found
card-etoken.c:406:etoken_select_file: returning with: File not found
card.c:756:sc_select_file: returning with: File not found
Please enter PIN:
C_SeedRandom() and C_GenerateRandom():
not implemented
Digests:
all 4 digest functions seem to work
MD5: OK
SHA-1: OK
RIPEMD160: OK
Signatures (currently only RSA signatures)
testing key 0 (Authentication Key)
all 4 signature functions seem to work
testing signature mechanisms:
RSA-X-509: ERR: verification failed
RSA-PKCS: ERR: verification failed
SHA1-RSA-PKCS: ERR: verification failed
MD5-RSA-PKCS: ERR: verification failed
RIPEMD160-RSA-PKCS: ERR: verification failed
Verify (currently only for RSA):
testing key 0 (Authentication Key)
RSA-X-509: ERR: verification failed ERR: C_Verify() returned
CKR_SIGNATURE_INVALID (0xc0)
Key unwrap (RSA)
testing key 0 (Authentication Key) -- can't be used to unwrap,
skipping
Decryption (RSA)
testing key 0 (Authentication Key)
RSA-X-509: resulting cleartext doesn't match input
Original: 61 62 63 64 65 66 67 68 69 00
Decrypted: 23 6f 38 e9 e2 a8 61 db 4d 4e 8e 79 66 65 88 89 7f 29 5a
07 86 58 62 4f cf 45 e3 1b c0 d6 5e 51 0e 96 71 ee 0c 07 2a 48 6a de 26
2c b3 fe 15 15 76 56 5c 36 4e 9a 0b 7c bd 1d 19 d2 27 2e 5b 02 28 46 30
c6 ba 07 bd ce 77 6f d4 a1 b9 2f 7e a4 e6 4f d3 d9 5e 28 94 56 c7 db a5
e1 a5 2f 97 2b de 7a 7a 4d 57 df ba cc 37 f5 7e 04 9c 38 60 4c df d0 58
1a 56 95 b6 fe e6 33 6d 4a c0 fb 1f 45
pkcs15-sec.c:142:sc_pkcs15_decipher: Invalid PKCS#1 padding: Wrong
padding
error: PKCS11 function C_Decrypt failed: rv = CKR_GENERAL_ERROR (0x5)

Aborting.
RSA-PKCS: giuseppe@eppesuig3:~$

while the second one works, after changed --pkcs11 in --pkcs1.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise