Passwordfile library: util/openssl.h Source File

Passwordfile library 5.0.13 C++ library to read/write passwords from/to encrypted files

Loading...
Searching...
No Matches
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
18 PASSWORD_FILE_EXPORT void init();
19 PASSWORD_FILE_EXPORT void clean();
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
global.h
PASSWORD_FILE_EXPORT
#define PASSWORD_FILE_EXPORT
Marks the symbol to be exported by the passwordfile library.
Definition global.h:14
Util::OpenSsl
Contains functions utilizing the usage of OpenSSL.
Definition openssl.h:11
Util::OpenSsl::init
PASSWORD_FILE_EXPORT void init()
Initializes OpenSSL.
Definition openssl.cpp:28
Util::OpenSsl::clean
PASSWORD_FILE_EXPORT void clean()
Cleans resources of OpenSSL.
Definition openssl.cpp:39
Util::OpenSsl::generateRandomNumber
PASSWORD_FILE_EXPORT std::uint32_t generateRandomNumber(std::uint32_t min, std::uint32_t max)
Util::OpenSsl::computeSha256Sum
PASSWORD_FILE_EXPORT Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size)
Computes a SHA-256 sum using OpenSSL.
Definition openssl.cpp:50
Util
Contains utility classes and functions.
Definition openssl.h:9
Util::OpenSsl::Sha256Sum
Definition openssl.h:13
Util::OpenSsl::Sha256Sum::size
static constexpr std::size_t size
Definition openssl.h:14
Util::OpenSsl::Sha256Sum::data
unsigned char data[size]
Definition openssl.h:15