|
RADLib
RADical C++ application framework
|
Digest and signing primitives backed by OpenSSL. More...
#include <RADSecurity.h>
Static Public Member Functions | |
| static std::vector< uint8_t > | sha256 (const std::vector< uint8_t > &bytes) |
| Computes SHA-256 over bytes. More... | |
| static std::vector< uint8_t > | sha256 (const std::string &text) |
| Computes SHA-256 over text bytes. More... | |
| static RADCore::RADResult< std::vector< uint8_t > > | sha256File (const std::string &path) |
| Computes SHA-256 over file contents. More... | |
| static std::string | toHex (const std::vector< uint8_t > &bytes) |
| Returns lowercase hexadecimal text for bytes. More... | |
| static RADCore::RADResult< std::vector< uint8_t > > | fromHex (const std::string &hex) |
| Parses lowercase or uppercase hexadecimal text. More... | |
| static RADCore::RADResult< std::vector< uint8_t > > | randomBytes (size_t count) |
| Generates cryptographically secure random bytes. More... | |
| static RADCore::RADResult< std::string > | generateRsaPrivateKeyPem (int bits=2048) |
| Generates an RSA private key in PEM format. More... | |
| static RADCore::RADResult< std::string > | publicKeyFromPrivateKeyPem (const std::string &privateKeyPem) |
| Extracts the public key PEM from a private key PEM. More... | |
| static RADCore::RADResult< std::vector< uint8_t > > | signSha256 (const std::vector< uint8_t > &bytes, const std::string &privateKeyPem) |
| Signs bytes using RSA-SHA256 and a private key PEM. More... | |
| static bool | verifySha256 (const std::vector< uint8_t > &bytes, const std::vector< uint8_t > &signature, const std::string &publicKeyPem) |
| Verifies an RSA-SHA256 signature over bytes. More... | |
| static RADCore::RADResult< void > | signFileSha256 (const std::string &filePath, const std::string &signaturePath, const std::string &privateKeyPem) |
| Signs a file using RSA-SHA256 and writes the signature bytes. More... | |
| static bool | verifyFileSha256 (const std::string &filePath, const std::string &signaturePath, const std::string &publicKeyPem) |
| Verifies a file signature generated by signFileSha256(). More... | |
| static RADCore::RADResult< std::string > | fileFingerprintSha256 (const std::string &path) |
| Returns a SHA-256 fingerprint for a certificate/key file. More... | |
Digest and signing primitives backed by OpenSSL.
|
static |
Returns a SHA-256 fingerprint for a certificate/key file.
|
static |
Parses lowercase or uppercase hexadecimal text.
|
static |
Generates an RSA private key in PEM format.
|
static |
Extracts the public key PEM from a private key PEM.
|
static |
Generates cryptographically secure random bytes.
|
static |
Computes SHA-256 over text bytes.
|
static |
Computes SHA-256 over bytes.
|
static |
Computes SHA-256 over file contents.
|
static |
Signs a file using RSA-SHA256 and writes the signature bytes.
|
static |
Signs bytes using RSA-SHA256 and a private key PEM.
|
static |
Returns lowercase hexadecimal text for bytes.
|
static |
Verifies a file signature generated by signFileSha256().
|
static |
Verifies an RSA-SHA256 signature over bytes.