title: Generate AES key without password using BouncyCastle
body: <p>I need to generate a key to use when encrypting a file symmetrically using AES256/CBC</p>
  
  <p>The key itself will be encrypted with RSA public/private so I don't need a password applied.</p>
  
  <p>In Java, this seems to be done <a href="https://stackoverflow.com/a/17812871/156755">as follows</a>:</p>
  
  <pre><code>SecureRandom random = new SecureRandom();
  byte[] keyBytes = new byte[32]; //32 Bytes = 256 Bits
  random.nextBytes(keyBytes);
  SecretKeySpec key = new SecretKeySpec(keyBytes, "AES");
  </code></pre>
  
  <p>However, <code>SecretKeySpec</code> isn't defined in the C# BouncyCastle library available via NuGet.</p>
  
  <p>What's the C# equivalent? Since I'm not using a password, is it sufficient to just grab the next <em>n</em> random bytes from <code>SecureRandom</code> (which does exist)?</p>