2#ifndef _aspose_system_security_crypto_symmetric_algorithm_h_
3#define _aspose_system_security_crypto_symmetric_algorithm_h_
5#include "system/object.h"
6#include "system/array.h"
7#include "cipher_mode.h"
9#include "padding_mode.h"
10#include "i_crypto_transform.h"
12namespace System{
namespace Security{
namespace Cryptography{
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Symmetric algorithm using same key for encryption and decryption base class. Objects of this class sh...
Definition: symmetric_algorithm.h:19
virtual CipherMode get_Mode()
Gets mode of cryptographic operation.
System::ArrayPtr< uint8_t > m_iv
Initial value.
Definition: symmetric_algorithm.h:117
virtual void set_KeySize(int value)
Sets key size of cryptographic operation.
PaddingMode m_padding
Padding.
Definition: symmetric_algorithm.h:129
bool ValidKeySize(int bitLength)
Checks if key size is valid.
int m_key_size
Key size.
Definition: symmetric_algorithm.h:125
virtual SharedPtr< ICryptoTransform > CreateEncryptor(System::ArrayPtr< uint8_t > rgbKey, System::ArrayPtr< uint8_t > rgbIV)=0
Creates encryptor with explicit parameters.
int m_block_size
Block size.
Definition: symmetric_algorithm.h:113
virtual SharedPtr< ICryptoTransform > CreateDecryptor(System::ArrayPtr< uint8_t > rgbKey, System::ArrayPtr< uint8_t > rgbIV)=0
Creates decryptor with explicit parameters.
virtual PaddingMode get_Padding()
Gets padding of cryptographic operation.
virtual void set_Key(System::ArrayPtr< uint8_t > value)
Sets key of cryptographic operation.
virtual void set_FeedbackSize(int value)
Sets feedback size of cryptographic operation.
virtual void set_Padding(PaddingMode value)
Sets padding of cryptographic operation.
static SharedPtr< SymmetricAlgorithm > Create(const String &algName)
Creates algorithm instance.
virtual SharedPtr< ICryptoTransform > CreateDecryptor()
Creates decryptor with parameters associated with algorithm object.
virtual void set_IV(System::ArrayPtr< uint8_t > value)
Sets initial value of cryptographic operation.
virtual System::ArrayPtr< uint8_t > get_Key()
Gets key of cryptographic operation. Creates new if not created yet.
virtual int get_FeedbackSize()
Gets feedback size of cryptographic operation.
virtual System::ArrayPtr< uint8_t > get_IV()
Gets initial value of cryptographic operation. Creates new if not created yet.
int m_feedback_size
Feedback size.
Definition: symmetric_algorithm.h:115
virtual void GenerateIV()=0
Generates random initial value for the algorithm. Overrides existing one (if any).
virtual void set_BlockSize(int value)
Sets block size of cryptographic operation.
virtual void set_Mode(CipherMode value)
Sets mode of cryptographic operation.
virtual SharedPtr< ICryptoTransform > CreateEncryptor()
Creates encryptor with parameters associated with algorithm object.
CipherMode m_mode
Direction.
Definition: symmetric_algorithm.h:127
std::vector< SharedPtr< KeySizes > > m_legal_key_sizes
Allowed key sizes.
Definition: symmetric_algorithm.h:123
virtual void GenerateKey()=0
Generates random key for the algorithm. Overrides existing one (if any).
SymmetricAlgorithm(const std::vector< SharedPtr< KeySizes > > &block_sizes, const std::vector< SharedPtr< KeySizes > > &key_sizes)
Constructor.
System::ArrayPtr< uint8_t > m_key
Key.
Definition: symmetric_algorithm.h:119
virtual int get_BlockSize()
Gets block size of cryptographic operation.
virtual int get_KeySize()
Gets key size of cryptographic operation.
std::vector< SharedPtr< KeySizes > > m_legal_block_sizes
Allowed block sizes.
Definition: symmetric_algorithm.h:121
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
CipherMode
Block cipher mode.
Definition: cipher_mode.h:9
PaddingMode
Defines how to treat messages that is shorter than block required by crypto operation....
Definition: padding_mode.h:9
Definition: db_command.h:9