10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
JWTSignatureValidator Class Referenceabstract

#include <JWTSignatureValidator.h>

Detailed Description

Service for validating the JWT-signature.

Inheritance diagram for JWTSignatureValidator:
tenduke::ee::licensing::impl::KeyListSignatureValidator tenduke::jwk::JWKSSignatureValidator tenduke::jwt::FixedKeyJWTSignatureValidator tenduke::jwk::DynamicJWKSSignatureValidator

Public Member Functions

virtual bool validate (const tenduke::json::JSONObject *jwtHeader, const char *payload, std::size_t payloadLength, const unsigned char *signatureBytes, std::size_t signatureLengthB) const=0
 Validates JWT signature.
virtual std::vector< std::shared_ptr< const tenduke::crypto::PublicKey > > getVerificationKeys () const
 Returns the public keys, which the validator currently trusts for verifying signatures.

Member Function Documentation

◆ getVerificationKeys()

virtual std::vector< std::shared_ptr< const tenduke::crypto::PublicKey > > tenduke::jwt::JWTSignatureValidator::getVerificationKeys ( ) const
inlinevirtual

Returns the public keys, which the validator currently trusts for verifying signatures.

The keys can be stored to verify the signatures later, e.g. when there is no network connection. The keys come from memory: this method never loads keys over the network.

The default implementation returns no keys, for validators which cannot provide them.

Returns
the keys, empty if not available

◆ validate()

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

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

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