C++ Utilities 5.30.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
verification.h File Reference
#include "../conversion/stringconversion.h"
#include <openssl/ec.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <algorithm>
#include <array>
#include <cctype>
#include <string>
#include <string_view>
Include dependency graph for verification.h:

Go to the source code of this file.

Namespaces

namespace  CppUtilities
 Contains all utilities provides by the c++utilities library.
namespace  CppUtilities::Detail

Typedefs

using CppUtilities::MainVerifyFunctionType = std::string (*)(std::string_view, std::string_view, std::string_view)
 The signature of the main verifySignature() function.

Functions

std::string CppUtilities::Detail::getOpenSslError ()
 Returns the current OpenSSL error.
std::string CppUtilities::Detail::extractPemBody (std::string_view pem, std::string_view header)
 Extracts the base64-encoded body from a PEM block.
std::string CppUtilities::Detail::parsePemSignature (std::string_view pemSignature, std::pair< std::unique_ptr< std::uint8_t[]>, std::uint32_t > &decodedSignature)
 Converts PEM-encoded signature into DER-encoded signature.
std::string CppUtilities::verifySignature (std::string_view publicKeyPem, std::string_view signaturePem, std::string_view data)
 Verifies data with the specified public key publicKeyPem and signature signaturePem.
template<class Keys, class VerifyFunction = MainVerifyFunctionType>
std::string CppUtilities::verifySignature (Keys &&publicKeysPem, std::string_view signaturePem, std::string_view data, VerifyFunction &&verifyFunction=static_cast< MainVerifyFunctionType >(&verifySignature))
 Verifies data with the specified public keys publicKeysPem and signature signaturePem.