Hi Jesus,
You explicitly need to enable File I/O privilege in your applet to access the
file javax.comm.properties.
OCF 1.1.1 correctly enables correct privileges to read the opencard.properties
file and to access the system properties. However it does not enable File I/O
privilege for the javax.comm.properties file. This explained the security
exception generated by Microsoft VM.
To solve this problem, you need to insert the following line in your applet
code, just before you call SmartCard.start():
com.ms.security.PolicyEngine.assertPermission
(com.ms.security.PermissionID.FILEIO);
I originally had the same problem when using Microsoft IE and pure Java driver.
With the previous fix, I was able to access
the smart card through pure Java driver.
Xavier Lorphelin
JSource
Jesus Paul Tomillo <[EMAIL PROTECTED]> on 08/03/99 04:36:39 AM
To: [EMAIL PROTECTED]
cc: (bcc: Xavier Lorphelin/Jsource)
Subject: [OCF] OCF applet for MS Internet Explorer, help!
Hi again,
I was trying to create an OCF applet for the Microsoft Internet Explorer
browser, so I got OCF 1.1.1, MS SDK 3.2 and Java COMM api 2.0 for my
GCR410 reader.
I followed all the steps in the OCF1.1.1 guide ("Writing secure applets
with OpenCard and Microsoft Explorer") and tested it with Explorer 5.0 in
NT4.
But the applet was not able to initialize. After asking me to grant all
permissions to this applet (because I signed it with the LOW security
flag), the content of the Java console was:
com.ms.security.SecurityExceptionEx[Host]: cannot access file
C:\WINNT\Java\lib\javax.comm.properties
at com/ms/security/permissions/FileIOPermission.check
at com/ms/security/PolicyEngine.deepCheck
at com/ms/security/PolicyEngine.checkPermission
at com/ms/security/StandardSecurityManager.chk
at com/ms/security/StandardSecurityManager.checkRead
at java/io/FileInputStream.<init>
at java/io/FileInputStream.<init>
at javax/comm/CommPortIdentifier.loadDriver
at javax/comm/CommPortIdentifier.<clinit>
at javax/comm/CommPortIdentifier.getPortIdentifier
at com/gemplus/opencard/terminal/GemplusSerialCardTerminal.open
at com/gemplus/opencard/terminal/GemCoreCardTerminal.open
at opencard/core/terminal/CardTerminalRegistry.add
at
com/gemplus/opencard/terminal/GemplusCardTerminalFactory.createCardTerminals
at opencard/core/service/SmartCard.handleTerminalFactoryEntries
at opencard/core/service/SmartCard.configureTerminalRegistry
at opencard/core/service/SmartCard.start
at AppOCF.start
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
java.lang.ExceptionInInitializerError: com/ms/security/SecurityExceptionEx
at javax/comm/CommPortIdentifier.getPortIdentifier
at com/gemplus/opencard/terminal/GemplusSerialCardTerminal.open
at com/gemplus/opencard/terminal/GemCoreCardTerminal.open
at opencard/core/terminal/CardTerminalRegistry.add
at
com/gemplus/opencard/terminal/GemplusCardTerminalFactory.createCardTerminals
at opencard/core/service/SmartCard.handleTerminalFactoryEntries
at opencard/core/service/SmartCard.configureTerminalRegistry
at opencard/core/service/SmartCard.start
at AppOCF.start
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
...And I promise you that the javax.comm.properties file is in
C:\WINNT\Java\lib\ !!!!
The curious thing is that when I re-initialize this applet, only the
second exception is generated.
Could anyone help me? Have anyone created a successfull OCF applet for
Explorer?
Thanks,
Jesus Paul
Visit the OpenCard Framework's WWW site at http://www.opencard.org/ for
access to documentation, code, presentations, and OCF announcements.
-----------------------------------------------------------------------------
To unsubscribe from the OCF Mailing list, send a mail to
"[EMAIL PROTECTED]" with the word "unsubscribe" in the BODY of the
message.
Visit the OpenCard Framework's WWW site at http://www.opencard.org/ for
access to documentation, code, presentations, and OCF announcements.
-----------------------------------------------------------------------------
To unsubscribe from the OCF Mailing list, send a mail to
"[EMAIL PROTECTED]" with the word "unsubscribe" in the BODY of the
message.