4#include <system/io/stream.h>
6#include <security/cryptography/rsa.h>
7#include <security/cryptography/i_csp_asymmetric_algorithm.h>
8#include <security/cryptography/hash_algorithm.h>
10namespace System {
namespace Security {
namespace Cryptography {
13 struct RSACryptoServiceProviderPimpl;
14 struct RSAPKCS1SignatureFormatterPimpl;
15 struct RSAPKCS1SignatureDeformatterPimpl;
25 friend struct Details::RSAPKCS1SignatureFormatterPimpl;
27 friend struct Details::RSAPKCS1SignatureDeformatterPimpl;
36 typedef System::BaseTypesInfo<BaseType, BaseType1> ThisBaseTypesInfo;
38 ASPOSECPP_SHARED_RTTI_INFO_DECL();
217 bool m_persist_key_in_csp;
219 static bool s_use_machine_key_store;
221 std::unique_ptr<Details::RSACryptoServiceProviderPimpl> m_pimpl;
223 void VerifyNotDisposed()
const;
224 void VerifyPrivateKeyExists()
const;
225 void SetupLegalKeySizesValue();
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
Asymmetric algorithm base class. Objects of this class should only be allocated using System::MakeObj...
Definition: i_csp_asymmetric_algorithm.h:14
RSA algorithm in CSP form. Objects of this class should only be allocated using System::MakeObject() ...
Definition: rsa_crypto_service_provider.h:23
RSAParameters ExportParameters(bool include_private_parameters) override
Exports CSP parameters.
RSACryptoServiceProvider(const RSAParameters ¶meters)
Constructor.
ByteArrayPtr SignHash(const ByteArrayPtr &rgb_hash, const String &str)
Computes the signature of specified input value. Not implemented.
bool get_PersistKeyInCsp() const
Checks whether key is persisted in CSP object.
bool VerifyHash(const ByteArrayPtr &rgb_hash, const String &str, const ByteArrayPtr &rgb_signature)
Checks data signature.
ByteArrayPtr HashData(ByteArrayPtr data, int32_t offset, int32_t count, HashAlgorithmName hash_algorithm) override
Computes the hash value of the specified data array using the specified hash algorithm.
ByteArrayPtr Encrypt(ByteArrayPtr data, SharedPtr< RSAEncryptionPadding > padding) override
Encrypts input data using the specified padding mode.
ByteArrayPtr Decrypt(ByteArrayPtr data, SharedPtr< RSAEncryptionPadding > padding) override
Decrypts input data using the specified padding mode.
String get_SignatureAlgorithm() override
Gets signature algorithm associated with CSP object.
ByteArrayPtr SignData(const ByteArrayPtr &buffer, const SharedPtr< Object > &halg)
Computes the signature of specified input value.
bool VerifyData(const ByteArrayPtr &buffer, const SharedPtr< Object > &halg, const ByteArrayPtr &signature)
Checks data signature.
int32_t get_KeySize() override
Gets key size used by algorithm.
ByteArrayPtr ExportCspBlob(bool include_private_parameters) override
Exports blob with information on key. Not implemented.
RSACryptoServiceProvider(const SharedPtr< CspParameters > ¶meters)
Constructor. Not implemented.
static void set_UseMachineKeyStore(bool value)
Defines whether the key persists in machine store instead of user store.
SharedPtr< CspKeyContainerInfo > get_CspKeyContainerInfo() override
Gets a CspKeyContainerInfo object.
static bool get_UseMachineKeyStore()
Checks whether the key persists in machine store instead of user store.
ByteArrayPtr Encrypt(const ByteArrayPtr &rgb, bool use_oaep)
Encrypts message. Not implemented.
ByteArrayPtr HashData(StreamPtr stream, HashAlgorithmName hash_algorithm) override
Computes the hash value of the specified binary stream using the specified hash algorithm.
String get_KeyExchangeAlgorithm() override
Checks key exchange algorithm associated with object.
ByteArrayPtr SignData(const ByteArrayPtr &buffer, int32_t offset, int32_t count, const SharedPtr< Object > &halg)
Computes the signature of specified input value.
ByteArrayPtr SignHash(ByteArrayPtr hash, HashAlgorithmName hash_algorithm, SharedPtr< RSASignaturePadding > padding) override
Computes the signature for the specified hash value.
void ImportParameters(RSAParameters parameters) override
Imports CSP parameters.
void Dispose() override
Frees data associated with object.
void set_PersistKeyInCsp(bool value)
Defines whether key is persisted in CSP object.
ByteArrayPtr Decrypt(const ByteArrayPtr &rgb, bool use_oaep)
Decrypts message. Not implemented.
void ImportCspBlob(ByteArrayPtr key_blob) override
Imports blob with information on key. Not implemented.
RSACryptoServiceProvider()
Constructor. Uses default parameters.
bool VerifyHash(ByteArrayPtr hash, ByteArrayPtr signature, const HashAlgorithmName &hash_algorithm, SharedPtr< RSASignaturePadding > padding) override
Verifies that the signature of the specified hash is valid.
bool get_PublicOnly() const
Checks if public key only is present in CSP object.
RSACryptoServiceProvider(int32_t key_size, const SharedPtr< CspParameters > ¶meters)
Constructor. Not implemented.
RSACryptoServiceProvider(int32_t key_size)
Constructor.
ByteArrayPtr SignData(const SharedPtr< IO::Stream > &input_stream, const SharedPtr< Object > &halg)
Computes the signature of specified input value.
Base class for implementations of RSA algorithm. Objects of this class should only be allocated using...
Definition: rsa.h:17
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