SecureRandom Class Reference

#include <secure_random.h>

详细描述

Class for generating cryptographically strong random sequences. The following systems are used:

静态公共成员函数

static MAXON_METHOD SecureRandomProvider   GetDefaultProvider ()
static MAXON_METHOD Bool   GetRandomNumber ( SecureRandomProvider provider, const Block < Byte > &buffer)

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( SecureRandom , MAXON_REFERENCE_NONE , "net.maxon.interface.securerandom")

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( SecureRandom   ,
MAXON_REFERENCE_NONE   ,
"net.maxon.interface.securerandom"   
)
private

◆  GetDefaultProvider()

static MAXON_METHOD SecureRandomProvider GetDefaultProvider ( )
static

Gets a provider for the CSPRNG.

返回
The provider. If the return value is nullptr the function failed.

◆  GetRandomNumber()

static MAXON_METHOD Bool GetRandomNumber ( SecureRandomProvider   provider ,
const Block < Byte > &  buffer  
)
static

Gets a provider for the CSPRNG.

返回
The provider. If the return value is nullptr the function failed. Fills the buffer with cryptographically strong random bytes. example: SecureRandom::GetRandomNumber (provider, ToBlock<Byte>(certificateBuffer, SIZEOF(certificateBuffer)));
参数
[in] provider The secure random provider.
[in] buffer A pointer to a buffer that is to be filled.
返回
True, if the buffer was filled successfully, false otherwise.