dcsimg
how to register a provider in a applet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   satyendra_adhikari
Posted On:   Thursday, December 27, 2001 12:28 AM

I am working on PGP encryption for data before sending to server . i have written the application which runs nicely on my JVM but when i am trying to repeat same steps in applet when when i call these methods.. java.security.Security.addProvider(new cryptix.jce.provider.CryptixCrypto() ); java.security.Security.addProvider(new cryptix.openpgp.provider.CryptixOpenPGP() ); i am getting these exceptions.... com.ms.security.SecurityExceptionEx[encrypt/Encrypt.startEncryption] at com/ms/security/PolicyEngine.deepCheck at com/ms/security/PolicyEngine.checkPermission at com/ms/security/StandardSecurityManager.chk at com/ms/security/StandardSecurityManager.checkSecurityAccess at java   More>>

I am working on PGP encryption for data
before sending to server .
i have written the application which runs nicely on my JVM but when i am trying to repeat same steps in applet when when i call these methods..
java.security.Security.addProvider(new cryptix.jce.provider.CryptixCrypto() ); java.security.Security.addProvider(new cryptix.openpgp.provider.CryptixOpenPGP() );
i am getting these exceptions....

com.ms.security.SecurityExceptionEx[encrypt/Encrypt.startEncryption]
at com/ms/security/PolicyEngine.deepCheck
at com/ms/security/PolicyEngine.checkPermission
at com/ms/security/StandardSecurityManager.chk
at com/ms/security/StandardSecurityManager.checkSecurityAccess
at java/security/Security.check
at java/security/Security.insertProviderAt
at java/security/Security.addProvider
at encrypt/Encrypt.startEncryption
at encrypt/Encrypt.
at LoginApplD.actionPerformed
at java/awt/Button.processActionEvent
at java/awt/Button.processEvent
at java/awt/Component.dispatchEventImpl
at java/awt/Component.dispatchEvent
at com/ms/awt/WUIPeer.handleEvent
at com/ms/awt/WButtonPeer.handleEvent
at java/awt/Component.postEvent
at com/ms/ui/AwtUIHost.postEvent
at com/ms/awt/WUIPeer.postEvent
at com/ms/ui/UIRoot.postEvent
at com/ms/ui/UIComponent.postEvent
at com/ms/ui/UIStateContainer.postEvent
at com/ms/ui/UIButton.¤
at com/ms/ui/UIButton.mouseClicked
at com/ms/ui/UIComponent.handleEvent
at com/ms/ui/UIComponent.postEvent
at com/ms/ui/UIStateContainer.postEvent
at com/ms/ui/UIComponent.postEvent
at com/ms/ui/UIStateComponent.postEvent
at com/ms/ui/UIRoot.Ä
at com/ms/ui/UIRoot.forwardEvent
at com/ms/ui/AwtUIHost.postEvent
at com/ms/awt/WUIPeer.postEvent
at com/ms/ui/AwtUIHost.processEvent
at java/awt/Component.dispatchEventImpl
at java/awt/Container.dispatchEventImpl
at java/awt/Component.dispatchEvent
at java/awt/EventDispatchThread.run

please suggest what is my mistake.

   <<Less

Re: how to register a provider in a applet

Posted By:   Anonymous  
Posted On:   Thursday, December 27, 2001 03:04 AM


This problem comes with MS realization of Java Security. MS recommends in this case do the following:

Before the block where you call addProvider() function place the block:


try {
if (Class.forName("com.ms.security.PolicyEngine") != null) {
PolicyEngine.assertPermission(PermissionID.SECURITY);
}
}
catch (Throwable t) {
}

And place the string :

 "import com.ms.security.*;" 

in import section of your source.

This way asserts needed security permission in IE and works only in trusted applets. Note that IE don't understand signed jars and you can trust such applet only by placing it in signed cab file. NN works with signed jars fine. Look for MS SDK 4.0 for Java if you want work with signed cab files.

Hope this helps you!

About | Sitemap | Contact