Method CreateToken
CreateToken<T>(byte[])
Creates the token from its JWT byte array representation.
public static T CreateToken<T>(byte[] byteArray)
Parameters
byteArraybyte[]byte array of the JWT.
Returns
- T
Token.
Type Parameters
TTokenType T.
Exceptions
- ArgumentException
if jwtAsString cannot be assigned to a token type.
CreateToken<T>(string)
Creates a token from its JWT string with the chosen TokenType T This method is obsolete and will be removed in future versions. Please use the byte[]-based method instead for better security and flexibility.
[Obsolete("This method is deprecated. Use the byte[] version instead.")]
public static T CreateToken<T>(string jwtAsString)
Parameters
jwtAsStringstringstring representation of the JWT.
Returns
- T
Token.
Type Parameters
TTokenType T.
Exceptions
- ArgumentException
if jwtAsString cannot be assigned to a token type.
CreateToken(byte[])
Creates the token from its JWT byte array representation.
public static JwtWrapper CreateToken(byte[] byteArray)
Parameters
byteArraybyte[]byte array of the JWT.