diff --git a/include/jwt/detail/meta.hpp b/include/jwt/detail/meta.hpp index 4081ddc..10f71c7 100644 --- a/include/jwt/detail/meta.hpp +++ b/include/jwt/detail/meta.hpp @@ -1,6 +1,7 @@ #ifndef CPP_JWT_META_HPP #define CPP_JWT_META_HPP +#include #include #include "jwt/string_view.hpp" @@ -123,17 +124,42 @@ struct is_parameter_concept struct is_sequence_concept: std::false_type { }; +/// For array types template -struct is_sequence_concept<>: std::true_type +struct is_sequence_concept>::value> + > + >: std::true_type { }; -*/ + +template +struct is_sequence_concept::iterator::iterator_category + >::value + >, + + decltype( + std::declval().begin(), + std::declval().end(), + (void)0 + ) + > + >: std::true_type +{ +}; + /** * Find if a type is present in the typelist. diff --git a/include/jwt/test/test_jwt_object b/include/jwt/test/test_jwt_object index 0afd7b6..ffbb701 100755 Binary files a/include/jwt/test/test_jwt_object and b/include/jwt/test/test_jwt_object differ diff --git a/include/jwt/test/test_jwt_object.cc b/include/jwt/test/test_jwt_object.cc index 0c1d36b..50c1032 100644 --- a/include/jwt/test/test_jwt_object.cc +++ b/include/jwt/test/test_jwt_object.cc @@ -49,6 +49,8 @@ void basic_jwt_object_test() void jwt_object_pem_test() { + using namespace jwt::params; + std::string pub_key = R"(-----BEGIN PUBLIC KEY----- MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEomxC9ycc8AkXSwWQpu1kN5Fmgy/sD/KJ @@ -75,6 +77,8 @@ MIGkAgEBBDBeLCgapjZmvTatMHaYX3A02+0Ys3Tr8kda+E9DFnmCSiCOEig519fT ; std::cout << "pem sign " << obj.signature() << std::endl; + auto dec_obj = jwt::decode(obj.signature(), pub_key, algorithms({"es256"})); + std::cout << dec_obj.payload() << std::endl; } int main() {