[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Checking text signed with Netscape with IAIK_JCE




Dear all,

Netscape offers a signing function in its 4.x browser that is accessible
with
JavaScript. This makes it possible to sign a text at the client and to
submit
this to the server.

I am trying to check this signature using IAIK. The netscape specs say the
result 
of the sign function is ''a base-64-encoded PKCS #7 signed object". Does
anyone
have experience with this?

I am trying to convert this data to binary data and then to a SignedData
Object.
Is this the right choice?

This is my code:

				obj = DerCoder.decode(bytes);
				System.out.println(obj.toString());
				System.out.println(obj.getAsnType());
			 	
			 	/* method 2: Explicit 
			 	*/
			 	AlgorithmID[] algIDs = { AlgorithmID.sha1,
AlgorithmID.md5 };
			 	SignedData sd = new SignedData(bytes,
algIDs);
			 	sd.decode(obj);

I get a an exception. My output:

	C:\jdk1.2.2\bin\java.exe   B64Test 
	SEQUENCE[C] = 2 elements
	ASN.1 Type [16,SEQUENCE,UNIVERSAL]
	iaik.pkcs.PKCSParsingException: Next ASN.1 object is no INTEGER!
		at iaik.pkcs.pkcs7.SignedData.decode(Unknown Source)
		at B64Test

Any help would be greatly appreciated,

Thanks in advance,


Jeroen van Grondelle


Info on the sign function:
	http://developer.netscape.com/tech/security/formsign/formsign.html

Jeroen van Grondelle
Logica BV
Divisie O&IDT
Tel: +31 (0)55 5261 555
Fax: + 31 (0)55 5261 500
http://www.logica.com


--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce