1#ifndef TENDUKE_JWK_JWKSVALIDATOR_H
2#define TENDUKE_JWK_JWKSVALIDATOR_H
5#include "./JWKSDownloader.h"
6#include "../crypto/msgauthn/HashAlgorithm.h"
7#include "../jwt/JWTSignatureValidator.h"
41 const std::shared_ptr<tenduke::jwk::JWKS> &keySet,
49 std::size_t payloadLength,
50 const unsigned char * signatureBytes,
51 std::size_t signatureLengthB
59 std::vector<std::shared_ptr<const tenduke::crypto::PublicKey>>
getVerificationKeys()
const override;
68 virtual std::unique_ptr<tenduke::jwk::JWK>
findJWK(
const std::string &keyId)
const;
88 const std::shared_ptr<tenduke::jwk::JWKS> keySet;
JSON object element.
Definition JSONObject.h:16
virtual std::unique_ptr< tenduke::jwk::JWK > findJWK(const std::string &keyId) const
Locates the key from cache by id.
Definition JWKSSignatureValidator.cpp:110
JWKSSignatureValidator(const std::shared_ptr< tenduke::jwk::JWKS > &keySet, ::tenduke::crypto::HashAlgorithm validationAlgorithm=::tenduke::crypto::HashAlgorithm::NONE)
Constructs new instance.
Definition JWKSSignatureValidator.cpp:155
virtual void mergeKeys(const tenduke::jwk::JWKS &newKeySet) const
Merges keys from newKeySet to the contained keySet.
Definition JWKSSignatureValidator.cpp:141
virtual std::unique_ptr< tenduke::jwk::JWK > findRotatedJWK(const tenduke::jwk::JWK &rejectedKey) const
Locates a replacement for the key, which did not verify the signature of a JWT without "kid"-claim.
Definition JWKSSignatureValidator.cpp:135
virtual void replaceKeys(const tenduke::jwk::JWKS &newKeySet) const
Replaces keys of the contained keySet with the keys from newKeySet.
Definition JWKSSignatureValidator.cpp:148
std::vector< std::shared_ptr< const tenduke::crypto::PublicKey > > getVerificationKeys() const override
Returns the keys in the key set, which are usable for verifying signatures with the validation algori...
Definition JWKSSignatureValidator.cpp:98
bool validate(const tenduke::json::JSONObject *jwtHeader, const char *payload, std::size_t payloadLength, const unsigned char *signatureBytes, std::size_t signatureLengthB) const override
Validates JWT signature.
Definition JWKSSignatureValidator.cpp:19
JSON Web Key Set, a container for one or more tenduke::jwk::JWKs, indexed by the JWK key ID.
Definition JWKS.h:17
Describes a JWK, Json Web Key.
Definition JWK.h:17
Service for validating the JWT-signature.
Definition JWTSignatureValidator.h:18
HashAlgorithm
Currently supported hash algorithms.
Definition HashAlgorithm.h:13
Support for JSON Web Keys.
Definition DynamicJWKSSignatureValidator.h:13
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4