Tay Thotheolh

Ranch Hand
+ Follow
since Aug 07, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tay Thotheolh

Hi. I have a theoretical problem here. is it possible for a class to impersonate it's identity ? E.g. Class A attempts to access Class B methods. Class B methods uses a getClass().getName(); method to attempt to check Class A to ensure it is who it is. Can impersonation take place ? e.g. Class C impersonates Class A to get pass the getclass().getName(); Class B uses for checks ?

If Class B wants to implement getClass().getName() for checks effective on the sample method below, how do I implement it properly in the sample code below ?



The above example is a simulation of a plugin applet in the system trying to access an internal key server database in the system.
14 years ago
What warning is it ? Is it an invalid certificate or something like that ?
14 years ago
The android project in netbeans couldn't clean nor build nor run.
14 years ago
I am using NetBeans 6.9 with a newly installed 'nbandroid' package while following the instructions from http://wiki.netbeans.org/IntroAndroidDevNetBeans. I have the Android SDK installed and it's fully updated.

I am using Linux platform by the way.

I get this error when I try to build and run my Android application.



How do I fix the above error ?

Thanks.
14 years ago
Hi. I am wondering if it is possible to create an internal access control model in a Java application based on classes that attempt to access certain methods or classes ?

My idea is that a Java application with plugin capabilities may have certain methods or classes too sensitive for plugin classes to access. E.g. secure storage or user password authentication classes shouldn't be accessed by plugins at all.

I was wondering if it is possible to use XXXClass.getClass() which returns a "Class" class object to do checking against an access control list for the system ?

Is it practically safe to do so too ?

I am wondering maybe some malicious classes may try to spoof a Class object to gain access or maybe is it possible for some malicious class to take control of a legitimate class to access restricted areas in an application system ?

If using "Class" class objects to determine the ability to access restricted classes or methods are not safe, is there a set of samples that can be created to proof that this method of access control between classes and methods are not safe ?

Thanks.
14 years ago
Hi. May I know if there's anyway to change java look and feel dynamically without restarting java apps ?

Thanks.

Regards,
Thotheolh.
14 years ago
Hi. I have a DH key agreement and i made a test and run it and an exception was raised. I am using BC as provider. It was all ok until it hit some weird exceptions.



The DH functions are found in DH class and the testing is found in DHTest class. Apparently I could not attachment zips nor txt nor java files so I am sry but I have to post the whole java codes here which I wished I could avoid.

DH.java



DHTest.java





Thanks.

Regards,
Thotheolh.
14 years ago
Thanks. I have found a way to convert bytes to public key.

It's in "http://www.exampledepot.com/egs/javax.crypto/KeyAgree.html" and "http://www.javafaq.nu/java-example-code-189.html".
14 years ago
Thanks for the reply. I understand DH is used to exchange keys or insecure channels. The public key I am talking about is the Alice and Bob public keys they exchange during their DH besides the P and G values.

The problem I am having now is not how to extract the byte[] from the public key but how do I recreate the byte[] of the public key sent across the network into a PublicKey object again. I have looked through the PublicKey java doc but it seems like there is no direct way for using the transfered byte[] and re-assemble them back to PublicKey objects.
14 years ago
Hi. I am implementing a network based diffie hellman. The two communicating parties need to exchange their public keys. How do I encode/decode them as hex string so I can conveniently send the public keys over the network in string packets ?

Thanks.

Regards,
Thotheolh.
14 years ago
Hi.

May I know how do I find out if the selected JTable row is empty of values ?

When I do the following code:



I get the following exceptions:



The exception is too to list down here.

How do I do a check to ensure that the selected row is not empty so it doesn't throw an exception ?

Thanks.
14 years ago
Hi. I have a JEditorPane that uses a HTMLEditorKit for rendering HTML. I set it to render "http://www.webstandards.org/files/acid2/test.html#top" url which is the Acid 2 html test kit and it threw me the following exception:


Here are my code fragments:


How do I grant it's permission in hard code.
14 years ago