Package com.jk.core.security
Class JKSecurityUtil
java.lang.Object
com.jk.core.security.JKSecurityUtil
The Class JKSecurityUtil.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Password
createPassword
(char[] password) Creates the password.static Password
createPassword
(String text) Creates the password.static String
Decode.static byte[]
decodeFromBase64
(String string) Decode from base 64.static byte[]
Decrypt.static String
Encode.static String
encodeInToBase64
(byte[] string) Encode in to base 64.static String
encrypt
(byte[] plainText) Encrypt.static byte[]
hash
(char[] data, byte[] salt) Hash.static void
The main method.static String
maskString
(String text) Mask string.static byte[]
paddArray
(byte[] original, int padding) Padd array.static byte[]
salt()
Salt.
-
Constructor Details
-
JKSecurityUtil
public JKSecurityUtil()
-
-
Method Details
-
main
The main method.- Parameters:
args
- the arguments- Throws:
Exception
- the exception
-
encrypt
Encrypt.- Parameters:
plainText
- the plain text- Returns:
- the byte[]
-
decrypt
Decrypt.- Parameters:
cipherBytes
- the cipher bytes- Returns:
- the byte[]
-
paddArray
public static byte[] paddArray(byte[] original, int padding) Padd array.- Parameters:
original
- the originalpadding
- the padding- Returns:
- the byte[]
-
decode
Decode.- Parameters:
source
- the source- Returns:
- the string
-
decodeFromBase64
Decode from base 64.- Parameters:
string
- the string- Returns:
- the byte[]
-
encode
Encode.- Parameters:
source
- the source- Returns:
- the string
-
encodeInToBase64
Encode in to base 64.- Parameters:
string
- the string- Returns:
- the string
-
salt
public static byte[] salt()Salt.- Returns:
- the byte[]
-
hash
public static byte[] hash(char[] data, byte[] salt) Hash.- Parameters:
data
- the datasalt
- the salt- Returns:
- the byte[]
-
createPassword
Creates the password.- Parameters:
password
- the password- Returns:
- the password
-
maskString
Mask string.- Parameters:
text
- the text- Returns:
- the string
-
createPassword
Creates the password.- Parameters:
text
- the text- Returns:
- the password
-