DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
JWTToken.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "Common.h"
7#include "System/Object.h"
8#include "System/String.h"
11
12namespace DotNetDupe {
13 namespace System {
76 }
77}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Represents a collection of keys and values.
Definition Dictionary.h:66
String GetSignature() const
Gets the cryptographic signature string component of the token.
Definition JWTToken.cpp:68
Collections::Generic::Dictionary< String, String > & GetPayload()
Gets a mutable reference to the payload claims dictionary.
Definition JWTToken.cpp:58
~JWTToken()=default
Default virtual destructor.
String CreateToken(const String &secretKey)
Encodes and cryptographically signs the token using HMAC-SHA256.
Definition JWTToken.cpp:91
static SmartPointer< JWTToken > Parse(const String &tokenStr)
Parses a serialized compact JWT string into a JWTToken instance.
Definition JWTToken.cpp:108
JWTToken()
Initializes a new instance of the JWTToken class with default header values.
Definition JWTToken.cpp:42
Collections::Generic::Dictionary< String, String > & GetHeader()
Gets a mutable reference to the JOSE header dictionary.
Definition JWTToken.cpp:48
bool Verify(const String &secretKey) const
Verifies the token signature against a specified secret key.
Definition JWTToken.cpp:122
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
A unified smart pointer that supports both unique and shared ownership semantics.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74