| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::signature_verifier Class Reference

Verifies signatures on incoming webhooks using OpenSSL. More...

`#include <signature_verifier.h>`

## Public Member Functions

| signature_verifier ()
| Constructor initializes the OpenSSL context and public key buffer.
bool | verify_signature (const std::string &timestamp, const std::string &body, const std::string &signature, const std::string &public_key_hex)
| Verifies the signature with the provided public key, timestamp, body, and signature.

## Detailed Description

Verifies signatures on incoming webhooks using OpenSSL.

## Constructor & Destructor Documentation

## ◆ signature_verifier()

dpp::signature_verifier::signature_verifier | ( |  | ) |

Constructor initializes the OpenSSL context and public key buffer.

## Member Function Documentation

## ◆ verify_signature()

bool dpp::signature_verifier::verify_signature | ( | const std::string & | timestamp,
|  | const std::string & | body,
|  | const std::string & | signature,
|  | const std::string & | public_key_hex )

Verifies the signature with the provided public key, timestamp, body, and signature.

Parameters

  timestamp | The timestamp of the request
  body | The body of the request
  signature | The hex-encoded signature to verify
  public_key_hex | The hex-encoded public key

Returns
  true if the signature is valid, false otherwise

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0