CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
rng_crypto_service_provider.h
1
2#ifndef _security_cryptography_rng_crypto_service_provider_h_
3#define _security_cryptography_rng_crypto_service_provider_h_
4
5#include <security/cryptography/random_number_generator.h>
6#include <memory>
7
8#ifdef ASPOSECPPLIB_BEING_BUILT
9#include <botan/auto_rng.h>
10#endif
11
12
13namespace Botan {
15 ASPOSECPP_3RD_PARTY_CLASS(AutoSeeded_RNG);
16}
17
18
19namespace System { namespace Security { namespace Cryptography {
20
25class ASPOSECPP_SHARED_CLASS RNGCryptoServiceProvider final : public RandomNumberGenerator
26{
27public:
29 ASPOSECPP_SHARED_API RNGCryptoServiceProvider();
31 virtual ASPOSECPP_SHARED_API ~RNGCryptoServiceProvider();
32
35 ASPOSECPP_SHARED_API void GetBytes(ArrayPtr<uint8_t> bytes) override;
38 ASPOSECPP_SHARED_API void GetNonZeroBytes(ArrayPtr<uint8_t> bytes) override;
41 ASPOSECPP_SHARED_API void GetBytes(System::Details::ArrayView<uint8_t> bytes) override;
44 ASPOSECPP_SHARED_API void GetNonZeroBytes(System::Details::ArrayView<uint8_t> bytes) override;
45
46private:
48 std::unique_ptr<Botan::AutoSeeded_RNG> m_rng;
49};
50
51}}}
52#endif // _security_cryptography_rng_crypto_service_provider_h_
Radom number generator that follows CSP notion. Objects of this class should only be allocated using ...
Definition: rng_crypto_service_provider.h:26
void GetNonZeroBytes(ArrayPtr< uint8_t > bytes) override
Fills existing array elements with random non-zero bytes.
void GetBytes(System::Details::ArrayView< uint8_t > bytes) override
Fills existing array view elements with random bytes.
void GetBytes(ArrayPtr< uint8_t > bytes) override
Fills existing array elements with random bytes.
void GetNonZeroBytes(System::Details::ArrayView< uint8_t > bytes) override
Fills existing array view elements with random non-zero bytes.
Abstract class for random number generators to inherit from. Objects of this class should only be all...
Definition: random_number_generator.h:19
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9