10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
FixedKeyJWTSignatureValidator Class Reference

#include <FixedKeyJWTSignatureValidator.h>

Detailed Description

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

Only asymmetric algorithms are supported.

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

Public Member Functions

 FixedKeyJWTSignatureValidator (const std::shared_ptr< const ::tenduke::crypto::PublicKey > &validationKey, ::tenduke::crypto::HashAlgorithm algorithm)
 Constructs a 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()

Constructs a new instance.

Parameters
validationKey-
algorithm-

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: