to get/generate nonce. error in random, getBytes Options

by sebby zml » Tue, 09 Mar 2010 09:52:26 GMT


Sponsored Links
 Hello every1,

I am now working on a program which is someting related to IMS.
I want the Server to send back a nonce to the Client.
In order to get nonce, I tried using the code from this site.

==>   http://forums.sun.com/thread.jspa?threadID=595626 

-Use java.security.SecureRandom:

--byte[] nonce = new byte[16];
--Random rand;
--rand = SecureRandom.getInstance ("SHA1PRNG");
--rand.getBytes (nonce);

But the problem is I could not use rand.getBytes as the class Random
doesn't provide methot getbytes().

Is there any other way to get or generate nonce? please help.
Thanks a lot.


--



to get/generate nonce. error in random, getBytes Options

by sebby zml » Wed, 10 Mar 2010 04:32:45 GMT


 Hello every1,

I am now working on a program which is someting related to IMS.
I want the Server to send back a nonce to the Client.
In order to get nonce, I tried using the code from this site.

==>   http://forums.sun.com/thread.jspa?threadID=595626 

-Use java.security.SecureRandom:

--byte[] nonce = new byte[16];
--Random rand;
--rand = SecureRandom.getInstance ("SHA1PRNG");
--rand.getBytes (nonce);

But the problem is I could not use rand.getBytes as the class Random
doesn't provide methot getbytes().

Is there any other way to get or generate nonce? please help.
Thanks a lot.


--


Sponsored Links