public final class SecurityUtils extends Object
| Modifier | Constructor and Description |
|---|---|
private |
SecurityUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createAuthorizationHeader(Object object,
String key,
String prefix)
Creates an authorization header with a JWT token.
|
static String |
createToken(Map<String,?> payloadMap,
String key)
Creates a JWT token with the provided payload and secret key.
|
static String |
createToken(Object object,
String key)
Creates a JWT token for the given object using the provided key.
|
static String |
verifyToken(String token,
String key)
Verifies a JWT token's signature and validity using the provided key.
|
public static String createAuthorizationHeader(Object object, String key, String prefix)
object - Object to be included in the token payloadkey - Secret key used to sign the tokenprefix - Prefix to be added to the token (e.g., "Bearer ")public static String createToken(Object object, String key)
object - Object to be converted to payloadkey - Secret key used to sign the tokenpublic static String createToken(Map<String,?> payloadMap, String key)
payloadMap - Map containing the payload data to be included in the tokenkey - Secret key used to sign the tokenCopyright © 2023–2025. All rights reserved.