Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
When overridden in a derived class, generates a random key (Key) to use for the algorithm.
Namespace: System.Security.Cryptography
Assembly: System.Security (in System.Security.dll)
Syntax
'Declaration
Public MustOverride Sub GenerateKey
public abstract void GenerateKey()
public:
virtual void GenerateKey() abstract
abstract GenerateKey : unit -> unit
public abstract function GenerateKey()
Remarks
In general, there is no reason to use this method, because CreateEncryptor() or 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.