public class SecurityUtil
extends java.lang.Object
| Constructor and Description |
|---|
SecurityUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
secureEquals(byte[] b1,
byte[] b2)
Compares two
byte arrays by performing the same number
of operations for both equality and inequality. |
static boolean |
secureEquals(char[] c1,
char[] c2)
Compares two character arrays by performing the same number
of operations for both equality and inequality.
|
static boolean |
secureEquals(java.lang.String s1,
java.lang.String s2)
Compares two strings by performing the same number
of operations for both equality and inequality when strings are of equal length.
|
public static final boolean secureEquals(byte[] b1,
byte[] b2)
byte arrays by performing the same number
of operations for both equality and inequality. Arrays must be equal length.b1 - The first array.b2 - The second array.public static final boolean secureEquals(char[] c1,
char[] c2)
c1 - The first character array.c2 - The second character array.public static final boolean secureEquals(java.lang.String s1,
java.lang.String s2)
s1 - The first string.s2 - The second string.