4#include <system/io/stream.h>
5#include <security/cryptography/asymmetric_algorithm.h>
6#include <security/cryptography/rsa_encryption_padding.h>
7#include <security/cryptography/rsa_signature_padding.h>
8#include <security/cryptography/rsa_parameters.h>
10namespace System {
namespace Security {
namespace Cryptography {
23 ASPOSECPP_SHARED_RTTI_INFO_DECL();
169 ASPOSECPP_SHARED_API
RSA();
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Abstract base class for asymmetric encryption algorithms. Objects of this class should only be alloca...
Definition: asymmetric_algorithm.h:19
Base class for implementations of RSA algorithm. Objects of this class should only be allocated using...
Definition: rsa.h:17
virtual ByteArrayPtr SignHash(ByteArrayPtr hash, HashAlgorithmName hash_algorithm, SharedPtr< RSASignaturePadding > padding)
Computes the signature for the specified hash value.
ByteArrayPtr SignData(const ByteArrayPtr &data, int32_t offset, int32_t count, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Computes the hash value of the specified data array using the specified hash algorithm and padding,...
bool VerifyData(const StreamPtr &stream, const ByteArrayPtr &signature, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Verifies that the signature of the specified binary stream is valid.
static SharedPtr< RSA > Create()
Creates default RSA aglorithm implementation.
String get_SignatureAlgorithm() override
Gets signature algorithm associated with CSP object.
virtual ByteArrayPtr DecryptValue(ByteArrayPtr rgb)
Decrypts value using private key.
virtual ByteArrayPtr EncryptValue(ByteArrayPtr rgb)
Encrypts value using private key.
virtual ByteArrayPtr Encrypt(ByteArrayPtr data, SharedPtr< RSAEncryptionPadding > padding)
Encrypts input data using the specified padding mode.
void FromXmlString(String xml_string) override
Initializes object using XML-encoded parameters.
static SharedPtr< RSA > CreateFromXmlString(const String &xml_string)
Creates default RSA algorithm implementation with specifed XML-encoded parameters.
static SharedPtr< RSA > Create(int32_t key_size_in_bits)
Creates default RSA algorithm implementation with specifed key size.
bool VerifyData(const ByteArrayPtr &data, int32_t offset, int32_t count, const ByteArrayPtr &signature, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Verifies that the signature of the specified data is valid.
virtual ByteArrayPtr HashData(StreamPtr stream, HashAlgorithmName hash_algorithm)
Computes the hash value of the specified binary stream using the specified hash algorithm.
virtual ByteArrayPtr Decrypt(ByteArrayPtr data, SharedPtr< RSAEncryptionPadding > padding)
Decrypts input data using the specified padding mode.
virtual RSAParameters ExportParameters(bool include_private_parameters)=0
Exports all parameters.
String get_KeyExchangeAlgorithm() override
Checks key exchange algorithm associated with object.
virtual bool VerifyHash(ByteArrayPtr hash, ByteArrayPtr signature, const HashAlgorithmName &hash_algorithm, SharedPtr< RSASignaturePadding > padding)
Verifies that the signature of the specified hash is valid.
ByteArrayPtr SignData(const ByteArrayPtr &data, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Computes the hash value of the specified data array using the specified hash algorithm and padding,...
ByteArrayPtr SignData(const StreamPtr &stream, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Computes the hash value of the specified binary stream using the specified hash algorithm and padding...
virtual ByteArrayPtr HashData(ByteArrayPtr data, int32_t offset, int32_t count, HashAlgorithmName hash_algorithm)
Computes the hash value of the specified data array using the specified hash algorithm.
bool VerifyData(const ByteArrayPtr &data, const ByteArrayPtr &signature, const HashAlgorithmName &hash_algorithm, const SharedPtr< RSASignaturePadding > &padding)
Verifies that the signature of the specified data is valid.
virtual void ImportParameters(RSAParameters parameters)=0
Imports all parameters from data structure.
static SharedPtr< RSA > Create(const String &alg_name)
Creates default RSA algorithm implementation.
static SharedPtr< RSA > Create(const RSAParameters ¶meters)
Creates default RSA algorithm implementation with specifed parameters.
String ToXmlString(bool include_private_parameters) override
Exports all parameters in XML format.
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
Definition: db_command.h:9
String representing the name of a hash algorithm. This type should be allocated on stack and passed t...
Definition: hash_algorithm_name.h:13
Data structure of RSA algorithm parameters. This type should be allocated on stack and passed to func...
Definition: rsa_parameters.h:13