KrakenTyio / eid-javascript-lib

Automatically exported from code.google.com/p/eid-javascript-lib
0 stars 0 forks source link

Data read off eID card is incomplete #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Read the data off my eID card using the demo app
2. Print out card.nationalNumber
3. print out the birth date

What is the expected output? What do you see instead?
I'm always getting 0 as a nationalNumber
And the date is one day too early for my birth date

What version of the product are you using? On what operating system?
1.3, Mac OSX 10.5.8 Safari

Please provide any additional information below.

Original issue reported on code.google.com by donald.p...@gmail.com on 21 Aug 2009 at 9:09

GoogleCodeExporter commented 8 years ago
PS: this only seems to be the case in Safari. Firefox seems to work alright.
It seems to be in the JavaObjectConvertor.toNumber function that var num = new 
Number(javaObject) converts 
this to 0 in Safari...
Think this would probably be reproducible in Safari Windows but can't test...

Original comment by donald.p...@gmail.com on 21 Aug 2009 at 9:34

GoogleCodeExporter commented 8 years ago
I can fix this by changing line 490 from 
var num = new Number(javaObject);
to
var num = new Number(parseInt(javaObject));

Not sure if this would break other things though... but it seems to fix things 
on Safari..

Original comment by donald.p...@gmail.com on 21 Aug 2009 at 9:44

GoogleCodeExporter commented 8 years ago
I'm just posting my findings here as I go, hope you don't mind :p
The birth date issue seems to come from the fact that Safari uses GMT dates to 
print out toLocaleDateString
Since birth dates on eID are encoded at 00:00, 12 Oct 1984 00:00 GMT +2 gives 
you 11 Oct 1984 22:00...

Original comment by donald.p...@gmail.com on 21 Aug 2009 at 9:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This issue is fixed in version 1.4 released on 03/09/2009

Version 1.4 contains the following changes:
    * Fix for JRE 6 Update 15: check if applet is loaded as sub applet (using
applet-launcher) or as main applet (using Next-Generation Java Plug-in).
    * Fix for issue 1: Conversion of Java String objects returned by the
applet into
Javascript Number objects fails in Safari. Therefore Java String objects
are first
converted to Javascript String objects and then converted to Javascript
Number objects.
    * Fix for issue 1: Dateformatter is used to format dates in toString
methods of
Card-, EIDCard- or SISCard objects.

Original comment by Johan.De...@gmail.com on 4 Sep 2009 at 9:41