Package org.summerboot.jexpress.security
Class SecurityUtil
java.lang.Object
org.summerboot.jexpress.security.SecurityUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]static final HostnameVerifierstatic final Patternstatic final Patternstatic final Patternstatic final Patternstatic final HostnameVerifierstatic final Patternstatic final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbase64Decode(String base64Text) static Stringbase64Encode(String plain) static Stringdecrypt encrypted value with prefix to plain textstatic char[]decrypt2Char(String encrypted, boolean warped) decrypt encrypted value with prefix to plain text char arraystatic byte[]static Stringstatic StringstripControls(String input, String substitute) Removes all unprintable characters from a string and replaces with substitute (i.e. a space).static booleanvalidatePassword(String pwd, int length)
-
Field Details
-
DO_NOT_VERIFY_REMOTE_IP
-
hostnameVerifier
-
CIPHER_SUITES
-
hasUppercase
-
hasLowercase
-
hasNumber
-
hasSpecialChar
-
PATTERN_UNPRINTABLE
-
PATTERN_UNPRINTABLE_CRLFTAB
-
-
Constructor Details
-
SecurityUtil
public SecurityUtil()
-
-
Method Details
-
encrypt
- Parameters:
plainData-warped- true if the encrypted value is in a warper like password=DEC(encrypted password)- Returns:
- Throws:
GeneralSecurityException
-
decrypt2Char
decrypt encrypted value with prefix to plain text char array- Parameters:
encrypted-warped- true if the encrypted value is in a warper like password=ENC(encrypted password)- Returns:
- Throws:
GeneralSecurityException
-
decrypt
decrypt encrypted value with prefix to plain text- Parameters:
encrypted-warped- true if the encrypted value is in a warper like password=ENC(encrypted password)- Returns:
- Throws:
GeneralSecurityException
-
decryptEx
- Throws:
GeneralSecurityException
-
base64Decode
-
base64Encode
-
validatePassword
-
stripControls
Removes all unprintable characters from a string and replaces with substitute (i.e. a space).- Parameters:
input-substitute-- Returns:
- the stripped value
-