10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::jwt::FixedKeyJWTSignatureValidator Class Reference

#include <FixedKeyJWTSignatureValidator.h>

Detailed Description

A tenduke::jwt::JWTSignatureValidator, which expects that the signature digestAlgorithm and verification key are pre-configured.

The class uses tenduke::crypto::MessageDigestFactory to create the actual validator.

Inheritance diagram for tenduke::jwt::FixedKeyJWTSignatureValidator:
tenduke::jwt::JWTSignatureValidator

Public Member Functions

 FixedKeyJWTSignatureValidator (std::shared_ptr< const tenduke::crypto::MessageDigestVerifierFactory > verifierFactory)
 Constructs new instance.
 
bool validate (const json::JSONObject *jwtHeader, const char *payload, std::size_t payloadLength, const unsigned char *signatureBytes, std::size_t signatureLengthB) const override
 Validates JWT signature.
 

Constructor & Destructor Documentation

◆ FixedKeyJWTSignatureValidator()

tenduke::jwt::FixedKeyJWTSignatureValidator::FixedKeyJWTSignatureValidator ( std::shared_ptr< const tenduke::crypto::MessageDigestVerifierFactory verifierFactory)
explicit

Constructs new instance.

Parameters
verifierFactory-

Member Function Documentation

◆ validate()

bool tenduke::jwt::FixedKeyJWTSignatureValidator::validate ( const json::JSONObject jwtHeader,
const char *  payload,
std::size_t  payloadLength,
const unsigned char *  signatureBytes,
std::size_t  signatureLengthB 
) const
overridevirtual

Validates JWT signature.

Parameters
jwtHeaderJWT-header, can be e.g. used to determine the key and digestAlgorithm used
payloadJWT-payload to verify
payloadLengthlength of the payload
signatureBytesthe signature
signatureLengthBthe signature length
Returns
true if the signature is valid, false if not
Exceptions
tenduke::crypto::CryptoExceptionif there are are cryptographic issues

Implements tenduke::jwt::JWTSignatureValidator.


The documentation for this class was generated from the following files: