Package es.kukenan.smartfi.parser
Class CoreParser
java.lang.Object
es.kukenan.smartfi.parser.CoreParser
Bean uses to generate correct hashcodes according to rules of CORE system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CipherBean user to Cypher into several algorithms.private MessageDigestBean use to cypher into SHA256.private static final char[]Variable needed to do hexadecimal conversions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringbytesToHex(byte[] bytes) Method to convert bytes to hexadecimal.coreDecrypt(String in, String hexkey) Decipher CORE input.coreEncrypt(String in, int length, String hexkey) Method to generate hashcodes encrypted due to CORE rules.private StringdecryptAes(String hexkey, String hexin) Decrypt into AES codification.private StringencryptAes(String hexkey, String hexin) Encrypt to AES.private StringgenerateHashAes(String hexkey, String hexin, int mode) Generate hash fo AES.Generate hash defined for cipher in CORE.private StringhashSha256Hex(String in, String salt) Generate hash in SHA256 in hexadecimal format.private byte[]Method to convert hexadecimal to array of bytes.
-
Field Details
-
cf
Bean user to Cypher into several algorithms. -
digest
Bean use to cypher into SHA256. -
hexArray
private static final char[] hexArrayVariable needed to do hexadecimal conversions.
-
-
Constructor Details
-
CoreParser
public CoreParser()Constructor fro AuthBean.
-
-
Method Details
-
bytesToHex
Method to convert bytes to hexadecimal.- Parameters:
bytes- String of bytes to convert.- Returns:
- Convert bytes to hexadecimal.
-
hexToByteArray
Method to convert hexadecimal to array of bytes.- Parameters:
s- input to convert from byte to char array.- Returns:
- Conversion of arrays of bytes.
-
generateHashAes
Generate hash fo AES.- Parameters:
hexkey- Key for AES in hexadecimal format.hexin- Input fro EAS in hexadecimal format.mode- Cypher or Decipher mode for AES.- Returns:
- String cipher or decipher in AES.
-
encryptAes
Encrypt to AES.- Parameters:
hexkey- Key in hexadecimal format.hexin- Input in hexadecimal format.- Returns:
- String with AES encryptation.
-
decryptAes
Decrypt into AES codification.- Parameters:
hexkey- Key into hexadecimal format.hexin- Input into hexadecimal format.- Returns:
- String decypher AES Algorithm.
-
coreDecrypt
Decipher CORE input.- Parameters:
in- Input for decrypt into CORE decryption.hexkey- Key in hexadecimal format to CORE decryption.- Returns:
- String decrypted for CORE.
-
coreEncrypt
Method to generate hashcodes encrypted due to CORE rules.- Parameters:
in- Input for CORE encryption.length- Max length of CORE encryption.hexkey- Key for encryption on hexadecimal format.- Returns:
- String encrypted for CORE.
-
hashSha256Hex
Generate hash in SHA256 in hexadecimal format.- Parameters:
in- Input in SHA256 algorithm.salt- param.- Returns:
- SHA256 input into hexadecimal format.
-
hashCore
Generate hash defined for cipher in CORE. This hash is used into Kukenbank and BancoFar for hash password for login.- Parameters:
in- Input to generate hash for CORE.salt- param. This salt must to be defined into app properties for use.length- Length of input- Returns:
- String with hash of CORE convert to hexadecimal.
-