title: SecureRandom setSeed method fails on MacOS
body: <p>Running macOS High Sierra 10.13.5 and Java 1.8.0u171.</p>
  
  <p>I have something like the following code:</p>
  
  <pre><code>SecureRandom random = SecureRandom.getInstance("NativePRNGNonBlocking");
  random.setSeed(bla byte array);
  </code></pre>
  
  <p>I encounter the following exception whenever this is run, I have redacted some of the stack trace that contains some sensitive bits:</p>
  
  <pre><code>java.security.ProviderException: setSeed() failed
      at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:472)
      at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:331)
      at sun.security.provider.NativePRNG$NonBlocking.engineSetSeed(NativePRNG.java:312)
      at java.security.SecureRandom.setSeed(SecureRandom.java:427)
  --redacted--
  Caused by: java.io.IOException: Operation not permitted
      at java.io.FileOutputStream.writeBytes(Native Method)
      at java.io.FileOutputStream.write(FileOutputStream.java:313)
      at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:470)
      at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:331)
      at sun.security.provider.NativePRNG$NonBlocking.engineSetSeed(NativePRNG.java:312)
      at java.security.SecureRandom.setSeed(SecureRandom.java:427)
  --redacted--
  </code></pre>
  
  <p>It appears that it is trying to write something, but I don't know what, or where.  There is code in the area that mentions /dev/random, so I figured I would check the perms of that, but I don't know what to make of that either.</p>
  
  <pre><code>x@y:~ $ ls -ld /dev/null
  crw-rw-rw-  1 root  wheel    3,   2 Jun 11 15:25 /dev/null
  x@y:~ $ ls -ld /dev/urandom
  crw-rw-rw-  1 root  wheel   14,   1 Jun 11 15:02 /dev/urandom
  x@y:~ $ ls -ld /dev/random
  crw-rw-rw-  1 root  wheel   14,   0 Jun  7 08:15 /dev/random
  </code></pre>
  
  <p>Any ideas what the issue is, and what I can do to remedy it?</p>
  
  <p>EDIT: I found that it appears that <code>NativePRNGNonBlocking</code> appears to try and access <code>/dev/urandom</code> which OSX apparently doesn't allow writing to.  Is there a way I can enable writing to it, or another method of avoiding this while still maintaining non-blocking behavior?</p>