public class OSecurityManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HASH_ALGORITHM |
static String |
HASH_ALGORITHM_PREFIX |
static int |
HASH_SIZE |
static String |
PBKDF2_ALGORITHM |
static String |
PBKDF2_ALGORITHM_PREFIX |
static String |
PBKDF2_SHA256_ALGORITHM |
static String |
PBKDF2_SHA256_ALGORITHM_PREFIX |
static int |
SALT_SIZE |
Constructor and Description |
---|
OSecurityManager() |
Modifier and Type | Method and Description |
---|---|
static String |
byteArrayToHexStr(byte[] data) |
boolean |
checkPassword(String iPassword,
String iHash)
Checks if an hash string matches a password, based on the algorithm found on hash string.
|
boolean |
checkPasswordWithSalt(String iPassword,
String iHash) |
boolean |
checkPasswordWithSalt(String iPassword,
String iHash,
String algorithm) |
static String |
createHash(String iInput,
String iAlgorithm) |
String |
createHash(String iInput,
String iAlgorithm,
boolean iIncludeAlgorithm)
Hashes the input string.
|
String |
createHashWithSalt(String iPassword) |
String |
createHashWithSalt(String iPassword,
int iIterations,
String algorithm) |
String |
createSHA256(String iInput) |
byte[] |
digestSHA256(String iInput) |
OSecurityFactory |
getSecurityFactory() |
static OSecurityManager |
instance() |
OCredentialInterceptor |
newCredentialInterceptor() |
OSecurityInternal |
newSecurity() |
void |
setSecurityFactory(OSecurityFactory factory) |
public static final String HASH_ALGORITHM
public static final String HASH_ALGORITHM_PREFIX
public static final String PBKDF2_ALGORITHM
public static final String PBKDF2_ALGORITHM_PREFIX
public static final String PBKDF2_SHA256_ALGORITHM
public static final String PBKDF2_SHA256_ALGORITHM_PREFIX
public static final int SALT_SIZE
public static final int HASH_SIZE
public static String createHash(String iInput, String iAlgorithm) throws NoSuchAlgorithmException, UnsupportedEncodingException
public static OSecurityManager instance()
public boolean checkPassword(String iPassword, String iHash)
iHash
- Hash string. Can contain the algorithm as prefix in the format
{ALGORITHM}-HASH
.iPassword
- public String createHash(String iInput, String iAlgorithm, boolean iIncludeAlgorithm)
iInput
- String to hashiIncludeAlgorithm
- Include the algorithm used or notpublic byte[] digestSHA256(String iInput)
public String createHashWithSalt(String iPassword, int iIterations, String algorithm)
public boolean checkPasswordWithSalt(String iPassword, String iHash, String algorithm)
public static String byteArrayToHexStr(byte[] data)
public OCredentialInterceptor newCredentialInterceptor()
public OSecurityFactory getSecurityFactory()
public void setSecurityFactory(OSecurityFactory factory)
public OSecurityInternal newSecurity()
Copyright © 2009–2020 OrientDB. All rights reserved.