# Having Cert. problems

Joshua Marquart (josh@opone.com)
Wed, 11 Nov 1998 17:25:11 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Blake Ramsdell: "RE: X509Certificate.getSerialNumber does not need to return a"
- Previous message: Mark Herschberg: "Javakey Strange behavior"

Hello. I'm attempting to use keytool and the certification management tool
and
jarsigner to allow my applet to access a SQL server using OBDC-JDBC
connections.

I tried this through Netscape and it works, but I didn't even need to sign a
certificate,
but when I tried it through Internet Explorer or Appletviewer it does not
work and I get the
following error:

APPLETVIEWER:
java.security,AccessControlException: access denied
(java.lang.RuntimePermision accessClassInPackage.sun.jdbc.odbc )
at java.security.AccessControlContext.checkPermission(Compiled Code)
at java.security.AccessController.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkPackageAccess(Compiled Code)
at sun.applet.AppletSecurity.checkPackageAccess(Compiled Code)
at sun.applet.AppletClassLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Compiled Code)
at DataManager.init(Compiled Code)
and so on...

INTERNET EXPLORER:
com.ms.security.SecurityExceptionEx[DataManager.init]: cannot access file
JdbcOdbcSecurityCheck
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.checkWrite
at sun/jdbc/odbc/JdbcOdbcDriver.trusted
at sun/jdbc/odbc/JdbcOdbcDriver.acceptsURL
at sun/jdbc/odbc/JdbcOdbcDriver.connect
at java/sql/DriverManager.getConnection
at java/sql/DriverManager.getConnection
at DataManager.init <--DataManager is my Applet name
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
java.sql.SQLException: No suitable driver
at java/sql/DriverManager.getConnection
at java/sql/DriverManager.getConnection
at DataManager.init
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

The code that it stumbles on (that it gets the exception at) is:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
DriverManager.setLoginTimeout(100);
String url = "jdbc:odbc:dataman";
Connection con = DriverManager.getConnection(url, "USERNAME",
"USERPASS");

Right at the last line (Connection con ...).
I have tried making self certfications for a JAR with my files in it...
and Netscape runs my "signed JAR file" normally, without and secu conflict
but with the following in the console:

# Error: Invalid Hash of this JAR entry (-7882)
# jar file: C:\WINDOWS\TEMP\jzipVVRK.TMP
# path: LinkList.class
# Error: The certificate is not approved for the attempted application.
(-8101)
# jar file: C:\WINDOWS\TEMP\jzipVVRK.TMP
# path: C:\WINDOWS\TEMP\jzipVVRK.TMP
# Error: loading of signatures has failed (-1)
# jar file: C:\WINDOWS\TEMP\jzipVVRK.TMP
# path: /c%7C/jdev/dm/

I've tried importing an exported certificate from my keystore but Netscape
and IE don't accept them.
Here's what I do Keystore-wise...

keytool -genkey -alias myname -keypass mypass -dname "cn=Josh, ou=rnd,
o=opone, c=us" -storepass thispass
jar cf DM.jar *.class
jarsigner -storepass thispass -keypass mypass DM.jar myname
keytool -export -alias myname -file certif.cer

Now I figure that I have a self-certified x509v1 certificate with the alias
myname and password mypass
but when I try to add it to IE or Netscape as an imported certificate, I get
mypass as password, I can BROWSE
for the certificate, but it never imports it.
And I have verified that the jar is signed using
jarsigner -verify

I've looked at the following pages for help on your site already:
java.sun.com/products/jdk/1.2/docs/tooldocs/win32/keytool.html
java.sun.com/products/jdk/1.2/docs/tooldocs/win32/keytool.html

java.sun.com/security/signExample/ <- but this is for 1.1

Code from HTML file used to call the applet:
<applet code="DataManager.class" archive="DM.jar" align="baseline"
WIDTH=1000 HEIGHT=500>

I have also used HTMLCONVERTER 1.1.1 that you provide to translate to
plug-in status, but
though the program has worked on previous attempts BEFORE I added the
JDBC/ODBC connectivity
code, it does not work now.
I get a "Applet DataManager notinited" message at the bottom of the screen.

I can provide any other information that you ask other than specific
usernames and passwords.
If you can please help me or if you can direct me to an area to get help, I
would greatly appreciate
that. I am a novice at working with Java, having only been working with it
for over 3 months but
I catch on quickly and would appreciate any help I can get. Thank you.

-Josh Marquart

This message was from:
Joshua Marquart at Opinion One
(513)-361-2761 josh@opone.com

- Next message: Blake Ramsdell: "RE: X509Certificate.getSerialNumber does not need to return a"
- Previous message: Mark Herschberg: "Javakey Strange behavior"