# Help me It's again javakey!!!!!

Gubbi Vivek (vivek@cap-fin.co.uk)
Fri, 11 Dec 1998 10:15:58 -0000

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Luigi Fonti: "java.policy is OK with Appletviewer, KO with Netscape"
- Previous message: Brian Sterling: "Re: No ability to set security policy for RuntimPermission"
- Next in thread: Jan Luehe: "Re: Help me It's again javakey!!!!!"

------ =_NextPart_000_01BE24EF.40638440
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi ,

Problem : - My applet is not able to local file system.

What i Did : -

1. The source is attached down
2. compiled the source file
3. created identifier(signer) using

javakey -cs "vivek" true

4. created public key and private key using

javakey -gk "vivek" DSA 512 viv_pub viv_priv

5. Generated certificate using

javakey -gc cert_directive

cert_directive file is attached down

6. created jar file using

jar -cvf read.jar readFIle*

7. Signed the jar file using

javakey -gs sign_directive read.jar

The sign_directive file is attached down

8. mkdir read

9. move readFile.jar.sig \read\read.jar

10. jar xf read.jar

11. run the readFile.html

result :

Readfile: caught security exception file :/C:/vivek/java/read/read/userinfo.ini

But the same runs perfect with appletviewer....

I am using internet explorer

Please help me in solving this problem Thanks in advance..

bye,
vivek

------ =_NextPart_000_01BE24EF.40638440
Content-Type: text/html; name="ATT00000.htm"
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
Hi ,
Problem : - My applet is not able to local file system.
What i Did : -
1. The source is attached down
2. compiled the source file
3. created identifier(signer) using
javakey -cs "vivek" true
4. created public key and private key using
javakey -gk "vivek" DSA 512 viv_pub viv_priv
5. Generated certificate using
javakey -gc cert_directive
cert_directive file is attached down
6. created jar file using
jar -cvf read.jar readFIle*
7. Signed the jar file using
javakey -gs sign_directive read.jar
The sign_directive file is attached down
8. mkdir read
9. move readFile.jar.sig \read\read.jar
10. jar xf read.jar
11. run the readFile.html
result :
Readfile: caught security exception file :/C:/vivek/java/read/read/userinfo.ini
But the same runs perfect with appletviewer....
I am using internet explorer
Please help me in solving this problem Thanks in advance..
bye,
vivek
------ =_NextPart_000_01BE24EF.40638440 Content-Type: application/octet-stream; name="readFile.java" Content-Transfer-Encoding: base64 LyoqCiAgKiBXaXRoIE5ldHNjYXBlIE5hdmlnYXRvciAyLjAsIHRoaXMgYWx3YXlzIHJhaXNlcyBz ZWN1cml0eSBleGNlcHRpb24uIAogICogCiAgKiBXaXRoIEpESyAxLjAgYXBwbGV0dmlld2VyLCAK ICAqICBmb3IgYXBwbGV0cyBsb2FkZWQgb3ZlciB0aGUgbmV0LCBpZiBhY2wucmVhZD0vZXRjLCB0 aGVuIHRoaXMgd29ya3MuCiAgKgogICogIGlmIHlvdSBpbnN0YWxsIHRoaXMgYXBwbGV0J3MgLmNs YXNzIGZpbGUgaW4gYSBkaXJlY3Rvcnkgb24geW91cgogICogIENMQVNTUEFUSCwgdGhlbiB0aGUg YXBwbGV0IGNhbiByZWFkIGZpbGVzIG9uIHRoZSBjbGllbnQgZmlsZQogICogIHN5c3RlbSwgcmVn YXJkbGVzcyBvZiBob3cgeW91IHNldCBhY2wucmVhZC4KICAqCiAgKiBAdmVyc2lvbiBKREsgMS4w IGJldGEKICAqIEBhdXRob3IgIE1hcmlhbm5lIE11ZWxsZXIKICAqLwoKaW1wb3J0IGphdmEuYXd0 Lio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLmxhbmcuKjsKaW1wb3J0IGphdmEuYXBw bGV0Lio7DQppbXBvcnQgamF2YS5uZXQuKjsNCmltcG9ydCBqYXZhLmF3dC5ldmVudC5LZXlFdmVu dDsNCmltcG9ydCBqYXZhLnNxbC4qOw0KaW1wb3J0IGphdmEubWF0aC4qOw0KaW1wb3J0IGphdmEu dXRpbC4qOw0KaW1wb3J0IGphdmEudXRpbC5EYXRlOw0KaW1wb3J0IGphdmEuaW8uRmlsZTsNCmlt cG9ydCBqYXZhLmlvLkZpbGVJbnB1dFN0cmVhbTsNCmltcG9ydCBqYXZhLmF3dC5GaWxlR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GlvbiIrIGdldENvZGVCYXNlKCkudG9TdHJpbmcoKStteUZpbGUsIDEwLCAxMCk7CiAgICAgICAg fQoJY2F0Y2ggKElPRXhjZXB0aW9uIGlvZSkgewoJCWcuZHJhd1N0cmluZygicGFpbnQ6IGNhdWdo dCBpL28gZXhjZXB0aW9uIiwgMTAsIDEwKTsKICAgICAgICB9CgkJCiAgIH0KfQoK ------ =_NextPart_000_01BE24EF.40638440 Content-Type: application/octet-stream; name="sign_directive" Content-Transfer-Encoding: base64 Iw0KICMgOTYvMDkvMjIgQCgjKXNpZ2RpciAxLjENCiAjDQoNCiAjDQogIyBKYXIgc2lnbmluZyBk aXJlY3RpdmUuIFRoaXMgaXMgdGhlIGRpcmVjdGl2ZSBmaWxlIHVzZWQgYnkgamF2YWtleSB0bw0K ICMgc2lnbiBhIGphciBmaWxlLg0KICMNCg0KICMgV2hpY2ggc2lnbmVyIHRvIHVzZS4gVGhpcyBt dXN0IGJlIGluIHRoZSBzeXN0ZW0ncyBkYXRhYmFzZS4NCg0Kc2lnbmVyPXZpdmVrDQoNCiAjIENl cnQgbnVtYmVyIHRvIHVzZSBmb3IgdGhpcyBzaWduZXIuIFRoaXMgZGV0ZXJtaW5lcyB3aGljaA0K ICMgY2VydGlmaWNhdGUgd2lsbCBiZSBpbmNsdWRlZCBpbiB0aGUgUEtDUzcgYmxvY2suIFRoaXMg aXMgbWFuZGF0b3J5DQogIyBhbmQgaXMgMSBiYXNlZC4NCg0KY2VydD0xDQoNCiAjIENlcnQgY2hh aW4gZGVwdGggb2YgYSBjaGFpbiBvZiBjZXJ0aWZpY2F0ZSB0byBpbmNsdWRlLiBUaGlzIGlzDQog IyBjdXJyZW50bHkgbm90IHN1cHBvcnRlZC4NCg0KY2hhaW49MA0KDQogIyBUaGUgbmFtZSB0byBn aXZlIHRvIHRoZSBzaWduYXR1cmUgZmlsZSBhbmQgYXNzb2NpYXRlZCBzaWduYXR1cmUNCiAjIGJs b2NrLiAoaS5lLiBEVUtFU0lH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MgMjAwNSANCnNlcmlhbC5udW1iZXI9MTAwMQ0Kb3V0LmZpbGU9dml2Lng1MDkN CiAgICAgICAgICAgICAgDQo= ------ =_NextPart_000_01BE24EF.40638440 Content-Type: text/html; name="readFile.htm" Content-Transfer-Encoding: 7bit
First Applet
------ =_NextPart_000_01BE24EF.40638440--

- Next message: Luigi Fonti: "java.policy is OK with Appletviewer, KO with Netscape"
- Previous message: Brian Sterling: "Re: No ability to set security policy for RuntimPermission"
- Next in thread: Jan Luehe: "Re: Help me It's again javakey!!!!!"