Package com.securenative.utils
Class Utils
- java.lang.Object
-
- com.securenative.utils.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOOKIE_NAME
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
Modifier and Type Method Description static StringcalculateHash(String str)static StringclientIpFromRequest(javax.servlet.ServletRequest request)static StringcookieIdFromRequest(javax.servlet.ServletRequest request, SecureNativeOptions options)static Stringdecrypt(String s, String key)static Stringencrypt(String text, String key)static StringgenerateTimestamp()static javafx.util.Pair<Long,String>getProcessInfo()static booleanisNullOrEmpty(String s)static booleanisVerifiedSnRequest(String payload, String headerSignature, String apiKey)static StringremoteIpFromRequest(javax.servlet.ServletRequest request)static StringsecureHeaderFromRequest(javax.servlet.ServletRequest request)static StringuserAgentFromRequest(javax.servlet.ServletRequest request)static intversionCompare(String str1, String str2)
-
-
-
Field Detail
-
COOKIE_NAME
public static String COOKIE_NAME
-
-
Method Detail
-
isVerifiedSnRequest
public static boolean isVerifiedSnRequest(String payload, String headerSignature, String apiKey)
-
isNullOrEmpty
public static boolean isNullOrEmpty(String s)
-
decrypt
public static String decrypt(String s, String key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, NumberFormatException
-
encrypt
public static String encrypt(String text, String key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException
-
cookieIdFromRequest
public static String cookieIdFromRequest(javax.servlet.ServletRequest request, SecureNativeOptions options)
-
secureHeaderFromRequest
public static String secureHeaderFromRequest(javax.servlet.ServletRequest request)
-
clientIpFromRequest
public static String clientIpFromRequest(javax.servlet.ServletRequest request)
-
remoteIpFromRequest
public static String remoteIpFromRequest(javax.servlet.ServletRequest request)
-
userAgentFromRequest
public static String userAgentFromRequest(javax.servlet.ServletRequest request)
-
generateTimestamp
public static String generateTimestamp()
-
-