|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atlassian.security.utils.ConstantTimeComparison
public class ConstantTimeComparison
This class provides some constant time comparison functions. It uses MessageDigest.isEqual, which since java 6u17 has been implemented using a constant time comparison.
| Method Summary | |
|---|---|
static boolean |
isEqual(byte[] a,
byte[] b)
A constant time comparison implementation of isEqual. |
static boolean |
isEqual(String a,
String b)
A constant time comparison implementation of isEqual. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isEqual(byte[] a,
byte[] b)
throws NullPointerException
a - a byte [] to compare.b - another byte [] to compare.
NullPointerException - if either a or b are null.
public static boolean isEqual(String a,
String b)
throws NullPointerException
a - a String to compare.b - another String to compare.
NullPointerException - if either a or b are null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||