Class AesCipher
- Namespace
- Renci.SshNet.Security.Cryptography.Ciphers
- Assembly
- Renci.SshNet.dll
AES cipher implementation.
public sealed class AesCipher : BlockCipher, IDisposable
- Inheritance
-
AesCipher
- Implements
- Inherited Members
Constructors
AesCipher(byte[], byte[], AesCipherMode, bool)
Initializes a new instance of the AesCipher class.
public AesCipher(byte[] key, byte[] iv, AesCipherMode mode, bool pkcs7Padding = false)
Parameters
key
byte[]The key.
iv
byte[]The IV.
mode
AesCipherModeThe mode.
pkcs7Padding
boolEnable PKCS7 padding.
Exceptions
- ArgumentNullException
key
is null.- ArgumentException
Keysize is not valid for this algorithm.
Methods
Decrypt(byte[], int, int)
public override byte[] Decrypt(byte[] input, int offset, int length)
Parameters
Returns
- byte[]
DecryptBlock(byte[], int, int, byte[], int)
public override int DecryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
Parameters
Returns
Dispose()
public void Dispose()
Dispose(bool)
Dispose the instance.
public void Dispose(bool disposing)
Parameters
disposing
boolSet to True to dispose of resouces.
Encrypt(byte[], int, int)
public override byte[] Encrypt(byte[] input, int offset, int length)
Parameters
Returns
- byte[]
EncryptBlock(byte[], int, int, byte[], int)
public override int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)