Algorithm. Generate Key Method
When overridden in a derived class, generates a random key (Key) to use for the algorithm.
public: abstract void GenerateKey();
public abstract void GenerateKey ();
abstract member GenerateKey : unit -> unit
Public MustOverride Sub GenerateKey ()
In general, there is no reason to use this method, because
CreateEncryptor(null, null) automatically generates both an initialization vector and a key. However, you may want to use the GenerateKey method to reuse a symmetric algorithm instance with a different key.