congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PasswordUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
PasswordUtil
in
org.apache.directory.api.ldap.model.password

Best Java code snippets using org.apache.directory.api.ldap.model.password.PasswordUtil (Showing top 20 results out of 315)

origin: cloudfoundry/uaa

public static void main(String[] args) throws Exception {
  LdapSecurityConstants test = PasswordUtil.findAlgorithm("{sha}YaE1CJ6sVhov987e77A5db7QAPg=".getBytes());
  System.out.println(test);
}
origin: cloudfoundry/uaa

public boolean comparePasswords(byte[] received, byte[] stored) {
  return PasswordUtil.compareCredentials(received, stored);
}
origin: org.apache.directory.api/api-all

LdapSecurityConstants algorithm = findAlgorithm( credentials );
    return getCredentials( credentials, algoLength, MD5_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA1_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA256_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA384_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA512_LENGTH, algorithm );
    return getPbkdf2Credentials( credentials, algoLength, algorithm );
    split( credentials, algoLength, salt, password );
    return new PasswordDetails( algorithm, salt, password );
    return getCryptCredentials( credentials, algoLength, algorithm );
origin: org.apache.directory.api/api-ldap-client-all

LdapSecurityConstants algorithm = findAlgorithm( storedCredentials );
  PasswordDetails passwordDetails = PasswordUtil.splitCredentials( storedCredentials );
  byte[] userPassword = PasswordUtil.encryptPassword( receivedCredentials, passwordDetails.getAlgorithm(),
    passwordDetails.getSalt() );
  return compareBytes( userPassword, passwordDetails.getPassword() );
  return compareBytes( receivedCredentials, storedCredentials );
origin: org.apache.directory.server/apacheds-interceptors-hash

LdapSecurityConstants existingAlgo = PasswordUtil.findAlgorithm( bytes );
  values.add( PasswordUtil.createStoragePassword( bytes, algorithm ) );
origin: com.qwazr/qwazr-library-ldap

public byte[] getShaPassword(final String clearPassword) {
  return PasswordUtil.createStoragePassword(clearPassword.getBytes(), LdapSecurityConstants.HASH_METHOD_SHA);
}
origin: org.apache.directory.api/api-ldap-model

    salt = generateCryptSalt( 2 );
    break;
  case HASH_METHOD_CRYPT_SHA256:
  case HASH_METHOD_CRYPT_SHA512:
    salt = generateCryptSalt( 8 );
    break;
byte[] hashedPassword = encryptPassword( credentials, algorithm, salt );
StringBuilder sb = new StringBuilder();
    merge( hashedPasswordWithSaltBytes, salt, hashedPassword );
    merge( hashedPasswordWithSaltBytes, hashedPassword, salt );
origin: org.apache.directory.api/api-all

return digest( LdapSecurityConstants.HASH_METHOD_SHA, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA256, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA384, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA512, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_MD5, credentials, salt );
return generatePbkdf2Hash( credentials, algorithm, salt );
origin: org.apache.directory.api/api-ldap-model

LdapSecurityConstants algorithm = findAlgorithm( credentials );
    return getCredentials( credentials, algoLength, MD5_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA1_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA256_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA384_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA512_LENGTH, algorithm );
    return getPbkdf2Credentials( credentials, algoLength, algorithm );
    split( credentials, algoLength, salt, password );
    return new PasswordDetails( algorithm, salt, password );
    return getCryptCredentials( credentials, algoLength, algorithm );
origin: org.apache.directory.api/api-ldap-model

LdapSecurityConstants algorithm = findAlgorithm( storedCredentials );
  PasswordDetails passwordDetails = PasswordUtil.splitCredentials( storedCredentials );
  byte[] userPassword = PasswordUtil.encryptPassword( receivedCredentials, passwordDetails.getAlgorithm(),
    passwordDetails.getSalt() );
  return compareBytes( userPassword, passwordDetails.getPassword() );
  return compareBytes( receivedCredentials, storedCredentials );
origin: org.apache.directory.server/apacheds-interceptors-hash

LdapSecurityConstants existingAlgo = PasswordUtil.findAlgorithm( userPassword.getBytes() );
  byte[] hashedPassword = PasswordUtil.createStoragePassword( userPassword.getBytes(), algorithm );
origin: org.apache.directory.api/api-ldap-client-all

/**
 * @see #createStoragePassword(byte[], LdapSecurityConstants)
 * 
 * @param credentials The password
 * @param algorithm The algorithm to use
 * @return The resulting byte[] containing the paswword
 */
public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm )
{
  return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm );
}
origin: org.apache.directory.api/api-all

    salt = generateCryptSalt( 2 );
    break;
  case HASH_METHOD_CRYPT_SHA256:
  case HASH_METHOD_CRYPT_SHA512:
    salt = generateCryptSalt( 8 );
    break;
byte[] hashedPassword = encryptPassword( credentials, algorithm, salt );
StringBuilder sb = new StringBuilder();
    merge( hashedPasswordWithSaltBytes, salt, hashedPassword );
    merge( hashedPasswordWithSaltBytes, hashedPassword, salt );
origin: org.apache.directory.api/api-ldap-model

return digest( LdapSecurityConstants.HASH_METHOD_SHA, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA256, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA384, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_SHA512, credentials, salt );
return digest( LdapSecurityConstants.HASH_METHOD_MD5, credentials, salt );
return generatePbkdf2Hash( credentials, algorithm, salt );
origin: org.apache.directory.api/api-ldap-client-all

LdapSecurityConstants algorithm = findAlgorithm( credentials );
    return getCredentials( credentials, algoLength, MD5_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA1_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA256_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA384_LENGTH, algorithm );
    return getCredentials( credentials, algoLength, SHA512_LENGTH, algorithm );
    return getPbkdf2Credentials( credentials, algoLength, algorithm );
    split( credentials, algoLength, salt, password );
    return new PasswordDetails( algorithm, salt, password );
    return getCryptCredentials( credentials, algoLength, algorithm );
origin: org.apache.directory.api/api-all

LdapSecurityConstants algorithm = findAlgorithm( storedCredentials );
  PasswordDetails passwordDetails = PasswordUtil.splitCredentials( storedCredentials );
  byte[] userPassword = PasswordUtil.encryptPassword( receivedCredentials, passwordDetails.getAlgorithm(),
    passwordDetails.getSalt() );
  return compareBytes( userPassword, passwordDetails.getPassword() );
  return compareBytes( receivedCredentials, storedCredentials );
origin: org.apache.directory.api/api-ldap-model

/**
 * @see #createStoragePassword(byte[], LdapSecurityConstants)
 * 
 * @param credentials The password
 * @param algorithm The algorithm to use
 * @return The resulting byte[] containing the paswword
 */
public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm )
{
  return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm );
}
origin: org.apache.directory.api/api-ldap-client-all

    salt = generateCryptSalt( 2 );
    break;
  case HASH_METHOD_CRYPT_SHA256:
  case HASH_METHOD_CRYPT_SHA512:
    salt = generateCryptSalt( 8 );
    break;
byte[] hashedPassword = encryptPassword( credentials, algorithm, salt );
StringBuilder sb = new StringBuilder();
    merge( hashedPasswordWithSaltBytes, salt, hashedPassword );
    merge( hashedPasswordWithSaltBytes, hashedPassword, salt );
origin: org.apache.directory.server/apacheds-interceptors-authn

if ( PasswordUtil.compareCredentials( credentials, storedPassword ) )
origin: org.apache.directory.server/apacheds-interceptors-authn

LdapSecurityConstants secConst = PasswordUtil.findAlgorithm( password );
org.apache.directory.api.ldap.model.passwordPasswordUtil

Javadoc

A utility class containing methods related to processing passwords.

Most used methods

  • createStoragePassword
    create a hashed password in a format that can be stored in the server. If the specified algorithm re
  • findAlgorithm
    Get the algorithm from the stored password. It can be found on the beginning of the stored password,
  • compareCredentials
    Compare the credentials. We have at least 6 algorithms to encrypt the password : * - SHA *
  • compareBytes
    Compare two byte[] in a constant time. This is necessary because using an Array.equals() is not Timi
  • digest
    Compute the hashed password given an algorithm, the credentials and an optional salt.
  • encryptPassword
    encrypts the given credentials based on the algorithm name and optional salt
  • generateCryptSalt
  • generatePbkdf2Hash
    generates a hash based on the PKCS5S2 spec [http://en.wikipedia.org/wiki/PBKDF2] Note: this has bee
  • getCredentials
    Compute the credentials
  • getCryptCredentials
  • getPbkdf2Credentials
    Gets the credentials from a PKCS5S2 hash. The salt for PKCS5S2 hash is prepended to the password
  • merge
  • getPbkdf2Credentials,
  • merge,
  • split,
  • splitCredentials,
  • isPwdExpired

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now