Passwordfile library  5.0.6
C++ library to read/write passwords from/to encrypted files
openssl.h
Go to the documentation of this file.
1 #ifndef PASSWORD_FILE_UTIL_OPENSSL_H
2 #define PASSWORD_FILE_UTIL_OPENSSL_H
3 
4 #include "../global.h"
5 
6 #include <cstddef>
7 #include <cstdint>
8 
9 namespace Util {
10 
11 namespace OpenSsl {
12 
13 struct Sha256Sum {
14  static constexpr std::size_t size = 32;
15  unsigned char data[size] = { 0 };
16 };
17 
20 PASSWORD_FILE_EXPORT Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size);
21 PASSWORD_FILE_EXPORT std::uint32_t generateRandomNumber(std::uint32_t min, std::uint32_t max);
22 
23 } // namespace OpenSsl
24 } // namespace Util
25 
26 #endif // PASSWORD_FILE_UTIL_OPENSSL_H
#define PASSWORD_FILE_EXPORT
Marks the symbol to be exported by the passwordfile library.
PASSWORD_FILE_EXPORT void init()
Initializes OpenSSL.
Definition: openssl.cpp:28
PASSWORD_FILE_EXPORT void clean()
Cleans resources of OpenSSL.
Definition: openssl.cpp:39
PASSWORD_FILE_EXPORT std::uint32_t generateRandomNumber(std::uint32_t min, std::uint32_t max)
PASSWORD_FILE_EXPORT Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size)
Computes a SHA-256 sum using OpenSSL.
Definition: openssl.cpp:50
Contains utility classes and functions.
Definition: openssl.h:9
static constexpr std::size_t size
Definition: openssl.h:14
unsigned char data[size]
Definition: openssl.h:15