4#include "Stroika/Frameworks/StroikaPreComp.h"
6#include "Stroika/Foundation/Containers/Sequence.h"
8#include "Stroika/Foundation/DataExchange/BadFormatException.h"
10#include "Stroika/Foundation/Execution/Throw.h"
37 if (parts.
size () != 3) {
40 BLOB joseHeader = Cryptography::Encoding::Algorithm::Base64::Decode (parts[0]);
41 BLOB payload = Cryptography::Encoding::Algorithm::Base64::Decode (parts[1]);
42 [[maybe_unused]]
BLOB signature = Cryptography::Encoding::Algorithm::Base64::Decode (parts[2]);
44 VariantValue headerObj = DataExchange::Variant::JSON ::Reader{}.Read (joseHeader);
45 VariantValue payloadObj = DataExchange::Variant::JSON ::Reader{}.Read (payload);
55String JWT::ToString ()
const
59 sb <<
"headerClaims: " << fHeaderClaims_;
60 sb <<
", payloadClaims_: " << fPayloadClaims_;
Similar to String, but intended to more efficiently construct a String. Mutable type (String is large...
String is like std::u32string, except it is much easier to use, often much more space efficient,...
nonvirtual Containers::Sequence< String > Tokenize() const
A generalization of a vector: a container whose elements are keyed by the natural numbers.
JWT(const JWT &)=default
construct a JWT from an encoded string. If fullyValidate true, also validate the signature (NYI)
Simple variant-value (case variant union) object, with (variant) basic types analogous to a value in ...
nonvirtual RETURNTYPE As() const
nonvirtual size_t size() const
Returns the number of items contained.
void Throw(T &&e2Throw)
identical to builtin C++ 'throw' except that it does helpful, type dependent DbgTrace() messages firs...