JWT-CPP v0.7.0
A header only library for creating and validating JSON Web Tokens (JWT) in C++
Loading...
Searching...
No Matches
jwt::algorithm::pss Struct Reference

Base class for PSS-RSA family of algorithms. More...

#include <jwt.h>

Inheritance diagram for jwt::algorithm::pss:
[legend]

Public Member Functions

 pss (const std::string &public_key, const std::string &private_key, const std::string &public_key_password, const std::string &private_key_password, const EVP_MD *(*md)(), std::string name)
 
std::string sign (const std::string &data, std::error_code &ec) const
 
void verify (const std::string &data, const std::string &signature, std::error_code &ec) const
 
std::string name () const
 

Detailed Description

Base class for PSS-RSA family of algorithms.

Constructor & Destructor Documentation

◆ pss()

jwt::algorithm::pss::pss ( const std::string & public_key,
const std::string & private_key,
const std::string & public_key_password,
const std::string & private_key_password,
const EVP_MD *(*)() md,
std::string name )
inline

Construct new pss algorithm

Parameters
public_keyRSA public key in PEM format
private_keyRSA private key or empty string if not available. If empty, signing will always fail.
public_key_passwordPassword to decrypt public key pem.
private_key_passwordPassword to decrypt private key pem.
mdPointer to hash function
nameName of the algorithm

Member Function Documentation

◆ name()

std::string jwt::algorithm::pss::name ( ) const
inline

Returns the algorithm name provided to the constructor

Returns
algorithm's name

◆ sign()

std::string jwt::algorithm::pss::sign ( const std::string & data,
std::error_code & ec ) const
inline

Sign jwt data

Parameters
dataThe data to sign
ecerror_code filled with details on error
Returns
ECDSA signature for the given data

◆ verify()

void jwt::algorithm::pss::verify ( const std::string & data,
const std::string & signature,
std::error_code & ec ) const
inline

Check if signature is valid

Parameters
dataThe data to check signature against
signatureSignature provided by the jwt
ecFilled with error details

The documentation for this struct was generated from the following file: