This class implements functions allowing to sign data or to provide hash values for data.
More...
|
static unsigned int | crc32 (const unsigned char *buffer, const size_t bufferSize) |
| Determines the CRC32 hash for a specified data buffer. More...
|
|
static void | md5 (const unsigned char *buffer, const size_t bufferSize, unsigned char hash[16]) |
| Determines the MD5 hash for a specified data buffer. More...
|
|
static void | sha1 (const unsigned char *buffer, const size_t bufferSize, unsigned char hash[20]) |
| Determines the SHA1 hash for a specified data buffer. More...
|
|
static void | hmacSHA1 (const unsigned char *buffer, const size_t bufferSize, const unsigned char *key, const size_t keySize, unsigned char hash[20]) |
| Determines the keyed hash message authentication code using SHA1 for a specified data buffer and secrete key. More...
|
|
static bool | evaluateCodeSignature (const std::wstring &filePath, bool &trustedCodeSignature, std::wstring *subjectName) |
| Evaluates if the code signature of the specified file exists and is trusted by the platform-specfic certificate store. More...
|
|
|
static bool | evaluateCodeSignatureAppleMacos (const std::wstring &filePath, bool &trustedCodeSignature, std::wstring *subjectName) |
| Evaluates if the code signature of the specified file exists and is trusted by the certificate store on macOS. More...
|
|
static bool | evaluateCodeSignatureWindows (const std::wstring &filePath, bool &trustedCodeSignature, std::wstring *subjectName) |
| Evaluates if the code signature of the specified file exists and is trusted by the certificate store on Windows. More...
|
|
static bool | determineSignatureSubjectName (const std::wstring &filePath, std::wstring &subjectName) |
| Returns the subject name of the digital signature for the specified file. More...
|
|
This class implements functions allowing to sign data or to provide hash values for data.
◆ crc32()
static unsigned int Ocean::IO::Signature::crc32 |
( |
const unsigned char * |
buffer, |
|
|
const size_t |
bufferSize |
|
) |
| |
|
static |
Determines the CRC32 hash for a specified data buffer.
- Parameters
-
buffer | The buffer for which the hash will be determined, must be valid |
bufferSize | The size of the buffer in bytes, with range (0, 2^32 - 1) |
- Returns
- The resulting CRC32 hash value for the given buffer
◆ determineSignatureSubjectName()
static bool Ocean::IO::Signature::determineSignatureSubjectName |
( |
const std::wstring & |
filePath, |
|
|
std::wstring & |
subjectName |
|
) |
| |
|
staticprivate |
Returns the subject name of the digital signature for the specified file.
The method will fail if the specified file has no digital signature.
- Parameters
-
filePath | File path to signed code file |
subjectName | Receives the subject name |
- Returns
- Ture if succeeded; otherwise, false is returned.
◆ evaluateCodeSignature()
bool Ocean::IO::Signature::evaluateCodeSignature |
( |
const std::wstring & |
filePath, |
|
|
bool & |
trustedCodeSignature, |
|
|
std::wstring * |
subjectName |
|
) |
| |
|
inlinestatic |
Evaluates if the code signature of the specified file exists and is trusted by the platform-specfic certificate store.
On Apple platforms the subject name may contain a team identifier code (e.g., subject (ABCDEFG))
- Parameters
-
filePath | File path to signed code file |
trustedCodeSignature | Receives true if the code signature of the file is valid and trusted; otherwise false is returned. |
subjectName | Optional parameter that receives the subject name |
- Returns
- True if signature evaluation and subject name determination succeeded; otherwise, false is returned.
- See also
- evaluateCodeSignatureAppleMacos(), evaluateCodeSignatureWindows()
◆ evaluateCodeSignatureAppleMacos()
static bool Ocean::IO::Signature::evaluateCodeSignatureAppleMacos |
( |
const std::wstring & |
filePath, |
|
|
bool & |
trustedCodeSignature, |
|
|
std::wstring * |
subjectName |
|
) |
| |
|
staticprivate |
Evaluates if the code signature of the specified file exists and is trusted by the certificate store on macOS.
The subject name may contain a team identifier code (e.g., subject (ABCDEFG))
- Parameters
-
filePath | File path to signed code file |
trustedCodeSignature | Receives true if the code signature of the file is valid and trusted; otherwise false is returned. |
subjectName | Optional parameter that receives the subject name |
- Returns
- Ture if signature evaluation and subject name determination succeeded; otherwise, false is returned.
- See also
- evaluateCodeSignature()
◆ evaluateCodeSignatureWindows()
static bool Ocean::IO::Signature::evaluateCodeSignatureWindows |
( |
const std::wstring & |
filePath, |
|
|
bool & |
trustedCodeSignature, |
|
|
std::wstring * |
subjectName |
|
) |
| |
|
staticprivate |
Evaluates if the code signature of the specified file exists and is trusted by the certificate store on Windows.
On Apple platforms the subject name may contain a team identifier code (e.g., subject (ABCDEFG))
- Parameters
-
filePath | File path to signed code file |
trustedCodeSignature | Receives true if the code signature of the file is valid and trusted; otherwise false is returned. |
subjectName | Optional parameter that receives the subject name |
- Returns
- True if signature evaluation and subject name determination succeeded; otherwise, false is returned.
- See also
- evaluateCodeSignatureAppleMacos()
◆ hmacSHA1()
static void Ocean::IO::Signature::hmacSHA1 |
( |
const unsigned char * |
buffer, |
|
|
const size_t |
bufferSize, |
|
|
const unsigned char * |
key, |
|
|
const size_t |
keySize, |
|
|
unsigned char |
hash[20] |
|
) |
| |
|
static |
Determines the keyed hash message authentication code using SHA1 for a specified data buffer and secrete key.
- Parameters
-
buffer | The buffer for which the hash will be determined, may be nullptr if bufferSize is 0 |
bufferSize | The size of the buffer in bytes, with range [0, infinity) |
key | The key which will be used to determine the hash, may be nullptr if keySize is 0 |
keySize | The size of the key in bytes, with range [0, infinity) |
hash | The resulting SHA1 hash value for the given buffer |
◆ md5()
static void Ocean::IO::Signature::md5 |
( |
const unsigned char * |
buffer, |
|
|
const size_t |
bufferSize, |
|
|
unsigned char |
hash[16] |
|
) |
| |
|
static |
Determines the MD5 hash for a specified data buffer.
- Parameters
-
buffer | The buffer for which the hash will be determined, may be nullptr if bufferSize is 0 |
bufferSize | The size of the buffer in bytes, with range [0, infinity) |
hash | The resulting MD5 hash value for the given buffer |
◆ sha1()
static void Ocean::IO::Signature::sha1 |
( |
const unsigned char * |
buffer, |
|
|
const size_t |
bufferSize, |
|
|
unsigned char |
hash[20] |
|
) |
| |
|
static |
Determines the SHA1 hash for a specified data buffer.
- Parameters
-
buffer | The buffer for which the hash will be determined, may be nullptr if bufferSize is 0 |
bufferSize | The size of the buffer in bytes, with range [0, infinity) |
hash | The resulting SHA1 hash value for the given buffer |
The documentation for this class was generated from the following file: