Class EncryptUtil
- java.lang.Object
-
- jetbrains.buildServer.serverSide.crypt.EncryptUtil
-
public class EncryptUtil extends Object
- Author:
- Pavel.Sher Date: 16.04.2008
-
-
Field Summary
Fields Modifier and Type Field Description static String
OLD_SCRAMBLED_PREFIX
-
Constructor Summary
Constructors Constructor Description EncryptUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static byte[]
fromHex(String hex)
Converts hex representation to corresponding bytesstatic boolean
isScrambled(String scrambled)
static String
md5(String str)
Generates MD5 hash from the specified string and returns result in the hex format.static String
scramble(String value)
Scrambles value usingstatic String
scrambleValue(String value)
Deprecated.static String
toHex(byte[] bytes)
Accepts bytes and returns string with hex representation of these bytesstatic String
unscramble(String scrambled)
Unscrambles scrambled data
-
-
-
Field Detail
-
OLD_SCRAMBLED_PREFIX
public static final String OLD_SCRAMBLED_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
md5
public static String md5(String str)
Generates MD5 hash from the specified string and returns result in the hex format.- Parameters:
str
- string- Returns:
- MD5 hash
-
toHex
public static String toHex(byte[] bytes)
Accepts bytes and returns string with hex representation of these bytes- Parameters:
bytes
- bytes to convert to hex- Returns:
- hex representation of bytes
-
fromHex
public static byte[] fromHex(String hex)
Converts hex representation to corresponding bytes- Parameters:
hex
- hex representation of bytes sequence- Returns:
- bytes sequence
-
isScrambled
public static boolean isScrambled(String scrambled)
- Parameters:
scrambled
- input text- Returns:
- true if input string is scrambled
-
unscramble
public static String unscramble(String scrambled) throws IllegalArgumentException
Unscrambles scrambled data- Parameters:
scrambled
- data to unscramble- Returns:
- unscrambled data
- Throws:
IllegalArgumentException
- if specified value is not scrambled
-
scrambleValue
@Deprecated public static String scrambleValue(String value)
Deprecated.Scrambles value using the specified secret key (must be 24 bytes length)- Parameters:
value
- to scramble- Returns:
- scrambled value
-
-