Share via


GenerateKey Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Generates a random key to use for the algorithm.

Namespace:  System.Security.Cryptography
Assembly:  System.Security (in System.Security.dll)

Syntax

'Declaration
Public Overrides Sub GenerateKey
public override void GenerateKey()
public:
virtual void GenerateKey() override
abstract GenerateKey : unit -> unit 
override GenerateKey : unit -> unit 
public override function GenerateKey()

Exceptions

Exception Condition
CryptographicException

The key could not be generated.

.NET Framework Security

See Also

Reference

AesCryptoServiceProvider Class

System.Security.Cryptography Namespace