Date: Wed, 14 May 1997 08:35:40 -0700
From: David.Brownell@Eng (David Brownell)
Message-Id: <199705141535.IAA13500@argon.eng.sun.com>
To: burnettS@RSA.COM, java-security@web2.javasoft.com
Subject: Re: SecureRandom.nextBytes
Yes, it fills the byte array, and you specify the number of bytes
by allocating an array of that size.
As usual, though, memory allocation is not free, and it would be
useful to have a nextBytes(byte buf[], int offset, int len) variant
to remove the need to allocate memory and then copy the resulting
data out of that buffer.
- Dave
> From burnettS@RSA.COM Wed May 14 08:25:24 1997
> From: Steve Burnett <burnettS@RSA.COM>
> To: "'JavaSoft crypto questions'" <java-security@web2.javasoft.com>
> Subject: SecureRandom.nextBytes
> Date: Wed, 14 May 1997 08:21:16 -0700
>
> One of the methods in the SecureRandom class is
>
> void nextBytes (byte bytes[]);
>
> The description says, "Generates a user-specified number of random
> bytes."
>
> Does this mean that the number of bytes this method will generate is
> the length of the byte array? Does this method generate bytes.length
> psedo-random bytes, filling every byte in the array? My question is
> really How does the user specify the number of random bytes?
>
> --Steve Burnett
> burnetts@rsa.com
>