JwtParserInterface Class Reference

#include <parser_jwt.h>

Public Member Functions

MAXON_METHOD Result< void > Read (UrlOrInputStream &&nameOrStream, JWTPARSERFLAGS flags, const StringDecodingRef &stringDecoding, const Block< const Char > &publicKey, const ValueReceiver< const DataDictionary & > &jsonObjects, BaseArray< Char > *originalToken)
 
MAXON_METHOD Result< void > Read (const Block< const Char > &jwtString, JWTPARSERFLAGS flags, const StringDecodingRef &stringDecoding, const Block< const Char > &publicKey, const ValueReceiver< const DataDictionary & > &jsonObjects)
 
MAXON_METHOD Result< CStringWrite (const DataDictionary &jsonObject, const StringEncodingRef &stringEncoding, const Block< const Char > &privateKey)
 

Static Public Member Functions

static MAXON_METHOD Interface * Alloc (MAXON_SOURCE_LOCATION_DECLARATION)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (JwtParserInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.jwtparser")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( JwtParserInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.jwtparser"   
)
private

◆ Alloc()

static MAXON_METHOD Interface* Alloc ( MAXON_SOURCE_LOCATION_DECLARATION  )
static
Parameters
[in]allocLocationSource location.

◆ Read() [1/2]

MAXON_METHOD Result<void> Read ( UrlOrInputStream &&  nameOrStream,
JWTPARSERFLAGS  flags,
const StringDecodingRef &  stringDecoding,
const Block< const Char > &  publicKey,
const ValueReceiver< const DataDictionary & > &  jsonObjects,
BaseArray< Char > *  originalToken 
)

ConvertFromJWT converts a JWT token into a json DataDictionary. For more details of JWT see https://jwt.io/

Parameters
[in]nameOrStreamJSON formated input stream or file url.
[in]flagsSee JWTPARSERFLAGS.
[in]publicKeyRSA256 public key to verify the JWT token.
[in]jsonObjectsValueReceiver which receives all processed DataDictionaries.
[out]originalToken[Optional] Returns the original token memory read from the stream.
Returns
OK on success. If successful it's guaranteed that at least one DataDictionary was found.

◆ Read() [2/2]

MAXON_METHOD Result<void> Read ( const Block< const Char > &  jwtString,
JWTPARSERFLAGS  flags,
const StringDecodingRef &  stringDecoding,
const Block< const Char > &  publicKey,
const ValueReceiver< const DataDictionary & > &  jsonObjects 
)

◆ Write()

MAXON_METHOD Result<CString> Write ( const DataDictionary &  jsonObject,
const StringEncodingRef &  stringEncoding,
const Block< const Char > &  privateKey 
)