public class SqrlUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
base64UrlDecode(String toDecodeParam)
Performs the SQRL required base64URL decoding
|
static String |
base64UrlDecodeToString(String toDecode)
Performs the SQRL required base64URL decoding
|
static String |
base64UrlDecodeToStringOrErrorMessage(String toDecode) |
static String |
buildLogMessageForSqrlClientRequest(javax.servlet.http.HttpServletRequest request) |
static String |
buildRequestParamList(javax.servlet.http.HttpServletRequest servletRequest)
Internal use only.
|
static String |
computeCookieDomain(javax.servlet.http.HttpServletRequest request,
SqrlConfig config) |
static String |
computeSfnFromUrl(javax.servlet.http.HttpServletRequest request)
Internal use only.
|
static String |
cookiesToString(javax.servlet.http.Cookie[] cookieArray) |
static javax.servlet.http.Cookie |
createOrUpdateCookie(javax.servlet.http.HttpServletRequest request,
String cookieDomain,
String name,
String value,
int maxAgeInSeconds,
SqrlConfig config) |
static void |
deleteCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SqrlConfig sqrlConfig,
String... cookiesToDelete) |
static String |
findCookieValue(javax.servlet.http.HttpServletRequest request,
String toFind) |
static InetAddress |
ipStringToInetAddresss(String ipAddressString)
Internal use only.
|
static boolean |
isBlank(String string)
Provides the functionality of Apache commons StringUtils.isBlank() without bringing in the dependency
|
static boolean |
isNotBlank(String string)
Provides the functionality of Apache commons StringUtils.isNotBlank() without bringing in the dependency
|
static String |
logEnterServlet(javax.servlet.http.HttpServletRequest request) |
static String |
parameterMapToString(Map<String,String[]> parameterMap) |
static String |
sqrlBase64UrlEncode(byte[] bytes)
Performs the SQRL required base64URL encoding
|
static String |
sqrlBase64UrlEncode(String toEncode)
Performs the SQRL required base64URL encoding
|
static boolean |
verifyED25519(byte[] signatureFromMessage,
byte[] messageBytes,
byte[] publicKeyBytes)
Internal use only.
|
public static String sqrlBase64UrlEncode(byte[] bytes)
bytes - the data to be encodedpublic static String sqrlBase64UrlEncode(String toEncode)
toEncode - the string to be encodedpublic static byte[] base64UrlDecode(String toDecodeParam) throws SqrlException
toDecodeParam - the data to be decodedSqrlException - if an error occurspublic static String base64UrlDecodeToString(String toDecode) throws SqrlException
toDecodeParam - the data to be decodedSqrlException - if UTF8 is not supportedpublic static String base64UrlDecodeToStringOrErrorMessage(String toDecode)
public static boolean verifyED25519(byte[] signatureFromMessage,
byte[] messageBytes,
byte[] publicKeyBytes)
throws SqrlException
signatureFromMessage - the signature datamessageBytes - the message that was signedpublicKeyBytes - the public key to be used for verificationSqrlException - if an error occurs during ED25519 operationspublic static boolean isBlank(String string)
string - the string to checkpublic static boolean isNotBlank(String string)
string - the string to checkpublic static InetAddress ipStringToInetAddresss(String ipAddressString) throws SqrlException
ipAddressString - the ip address to parseSqrlException - if an UnknownHostException occurspublic static String computeSfnFromUrl(javax.servlet.http.HttpServletRequest request)
request - public static String buildRequestParamList(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest - the requestpublic static javax.servlet.http.Cookie createOrUpdateCookie(javax.servlet.http.HttpServletRequest request,
String cookieDomain,
String name,
String value,
int maxAgeInSeconds,
SqrlConfig config)
public static String findCookieValue(javax.servlet.http.HttpServletRequest request, String toFind)
public static void deleteCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
SqrlConfig sqrlConfig,
String... cookiesToDelete)
public static final String cookiesToString(javax.servlet.http.Cookie[] cookieArray)
public static String computeCookieDomain(javax.servlet.http.HttpServletRequest request, SqrlConfig config)
public static String logEnterServlet(javax.servlet.http.HttpServletRequest request)
public static String buildLogMessageForSqrlClientRequest(javax.servlet.http.HttpServletRequest request)
Copyright © 2016. All rights reserved.