Re: Problem with the import java.security.*;

2008-12-01 Thread Sumit Chandel
Hi Phani,
I can confirm that the java.security package is not supported in GWT.

Keep in mind that GWT is for Ajax application development on the
client-side, so all code gets cross-compiled from Java to obfuscated and
optimized JavaScript that can run in the browser. Therefore, you are bound
by the same browser limitations as any other Ajax framework, hence
java.security functionality not being available on the client.

What you could do to solve the unique number generation problem in the code
snippet above is have it run on the server and pass back the number to the
client through a GWT RPC call or a RequestBuilder callback.

For more information on either technique, check out the GWT docs linked
below.

GWT Developer Guide:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=google-web-toolkit-doc-1-5

Hope that helps,
-Sumit Chandel

On Sat, Nov 29, 2008 at 3:35 PM, medgey [EMAIL PROTECTED] wrote:


 If you are trying to use the java.security package on the client it is
 unlikely that GWT supports them.

 On Nov 28, 6:08 am, Phani [EMAIL PROTECTED] wrote:
  Hi All,
 
  In my application i have to implement a unique number generation i.e
  UUID using SecureRandom class of java.security package. Please refer
  the below code.
  try {
  // Create a secure random number generator
  SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
  // Get 1024 random bits
  byte[] bytes = new byte[1024/8];
  sr.nextBytes(bytes);
 
  // Create two secure number generators with the same seed
  int seedByteCount = 10;
  byte[] seed = sr.generateSeed(seedByteCount);
  sr = SecureRandom.getInstance(SHA1PRNG);
  sr.setSeed(seed);
  SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
  sr2.setSeed(seed);
  } catch (NoSuchAlgorithmException e) {
  }
  But i'm facing a problem stating that java.security cannot be resolved
  to a type. Please help me.Whether  GWT doesn't support java.security
  package?
  Thanks in Advance,
  Phani.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem with the import java.security.*;

2008-11-29 Thread medgey

If you are trying to use the java.security package on the client it is
unlikely that GWT supports them.

On Nov 28, 6:08 am, Phani [EMAIL PROTECTED] wrote:
 Hi All,

 In my application i have to implement a unique number generation i.e
 UUID using SecureRandom class of java.security package. Please refer
 the below code.
 try {
         // Create a secure random number generator
         SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
             // Get 1024 random bits
         byte[] bytes = new byte[1024/8];
         sr.nextBytes(bytes);

         // Create two secure number generators with the same seed
         int seedByteCount = 10;
         byte[] seed = sr.generateSeed(seedByteCount);
         sr = SecureRandom.getInstance(SHA1PRNG);
         sr.setSeed(seed);
         SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
         sr2.setSeed(seed);
     } catch (NoSuchAlgorithmException e) {
     }
 But i'm facing a problem stating that java.security cannot be resolved
 to a type. Please help me.Whether  GWT doesn't support java.security
 package?
 Thanks in Advance,
 Phani.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Problem with the import java.security.*;

2008-11-28 Thread Phani

Hi All,

In my application i have to implement a unique number generation i.e
UUID using SecureRandom class of java.security package. Please refer
the below code.
try {
// Create a secure random number generator
SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
// Get 1024 random bits
byte[] bytes = new byte[1024/8];
sr.nextBytes(bytes);

// Create two secure number generators with the same seed
int seedByteCount = 10;
byte[] seed = sr.generateSeed(seedByteCount);
sr = SecureRandom.getInstance(SHA1PRNG);
sr.setSeed(seed);
SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
sr2.setSeed(seed);
} catch (NoSuchAlgorithmException e) {
}
But i'm facing a problem stating that java.security cannot be resolved
to a type. Please help me.Whether  GWT doesn't support java.security
package?
Thanks in Advance,
Phani.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem with the import java.security.*;

2008-11-28 Thread Peter Ondruška

I do not think you can do that with GWT. Therefore I use
http://uuid-service.appspot.com though not with GWT application.
Peter

2008/11/28, Phani [EMAIL PROTECTED]:

 Hi All,

 In my application i have to implement a unique number generation i.e
 UUID using SecureRandom class of java.security package. Please refer
 the below code.
 try {
 // Create a secure random number generator
 SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
 // Get 1024 random bits
 byte[] bytes = new byte[1024/8];
 sr.nextBytes(bytes);

 // Create two secure number generators with the same seed
 int seedByteCount = 10;
 byte[] seed = sr.generateSeed(seedByteCount);
 sr = SecureRandom.getInstance(SHA1PRNG);
 sr.setSeed(seed);
 SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
 sr2.setSeed(seed);
 } catch (NoSuchAlgorithmException e) {
 }
 But i'm facing a problem stating that java.security cannot be resolved
 to a type. Please help me.Whether  GWT doesn't support java.security
 package?
 Thanks in Advance,
 Phani.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---