CreateEncryptor Method

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

Creates a symmetric encryptor object with the current Key property and initialization vector (IV).

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

abstract CreateEncryptor : unit -> ICryptoTransform 
override CreateEncryptor : unit -> ICryptoTransform 

Return Value

Type: System.Security.Cryptography..::..ICryptoTransform
A symmetric encryptor object.

If the current Key property is nullNothingnullptrunita null reference (Nothing in Visual Basic), the GenerateKey method is called to create a new random Key. If the current IV property is nullNothingnullptrunita null reference (Nothing in Visual Basic), the GenerateIV method is called to create a new random IV.

Use the CreateDecryptor overload with the same signature to decrypt the result of this method.

Show: