Share via


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)

Syntax

'Declaration
Public Overridable Function CreateEncryptor As ICryptoTransform
public virtual ICryptoTransform CreateEncryptor()
public:
virtual ICryptoTransform^ CreateEncryptor()
abstract CreateEncryptor : unit -> ICryptoTransform 
override CreateEncryptor : unit -> ICryptoTransform 
public function CreateEncryptor() : ICryptoTransform

Return Value

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

Remarks

If the current Key property is null Nothing nullptr unit a null reference (Nothing in Visual Basic) , the GenerateKey method is called to create a new random Key. If the current IV property is null Nothing nullptr unit a 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.

.NET Framework Security

See Also

Reference

SymmetricAlgorithm Class

CreateEncryptor Overload

System.Security.Cryptography Namespace