Class OSecurityManager
java.lang.Object
com.orientechnologies.orient.core.security.OSecurityManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteArrayToHexStr(byte[] data) static booleancheckPassword(String iPassword, String iHash) Checks if an hash string matches a password, based on the algorithm found on hash string.static booleancheckPasswordWithSalt(String iPassword, String iHash) static booleancheckPasswordWithSalt(String iPassword, String iHash, String algorithm) static StringcreateHash(String iInput, String iAlgorithm) static StringcreateHash(String iInput, String iAlgorithm, boolean iIncludeAlgorithm) Hashes the input string.static StringcreateHashWithSalt(String iPassword) static StringcreateHashWithSalt(String iPassword, int iIterations, String algorithm) static StringcreateSHA256(String iInput) static byte[]digestSHA256(String iInput) static OSecurityManagerinstance()
-
Field Details
-
HASH_ALGORITHM
- See Also:
-
HASH_ALGORITHM_PREFIX
- See Also:
-
PBKDF2_ALGORITHM
- See Also:
-
PBKDF2_ALGORITHM_PREFIX
- See Also:
-
PBKDF2_SHA256_ALGORITHM
- See Also:
-
PBKDF2_SHA256_ALGORITHM_PREFIX
- See Also:
-
SALT_SIZE
public static final int SALT_SIZE- See Also:
-
HASH_SIZE
public static final int HASH_SIZE- See Also:
-
-
Constructor Details
-
OSecurityManager
public OSecurityManager()
-
-
Method Details
-
createHash
public static String createHash(String iInput, String iAlgorithm) throws NoSuchAlgorithmException, UnsupportedEncodingException -
instance
-
checkPassword
Checks if an hash string matches a password, based on the algorithm found on hash string.- Parameters:
iHash- Hash string. Can contain the algorithm as prefix in the format{ALGORITHM}-HASH.iPassword-- Returns:
-
createSHA256
-
createHash
Hashes the input string.- Parameters:
iInput- String to hashiIncludeAlgorithm- Include the algorithm used or not- Returns:
-
digestSHA256
-
createHashWithSalt
-
createHashWithSalt
-
checkPasswordWithSalt
-
checkPasswordWithSalt
-
byteArrayToHexStr
-
newCredentialInterceptor
-