if ( numBytes <= 0 ) {
throw new IllegalArgumentException(Messages.getString("security.195", numBytes)); //$NON-NLS-1$
}
if ( !serviceAvailable ) {
throw new ProviderException(
Messages.getString("security.197") ); //$NON-NLS-1$
}
byte[] myBytes = new byte[numBytes];
if ( !getWindowsRandom(myBytes, numBytes) ) {
// it is unexpected result
throw new ProviderException(
Messages.getString("security.198") ); //$NON-NLS-1$
}
return myBytes;
}