Tabnine Logo
PasswordUtil.split
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.directory.api/api-ldap-client-all

/**
 * Gets the credentials from a PKCS5S2 hash.
 * The salt for PKCS5S2 hash is prepended to the password
 * 
 * @param credentials The password
 * @param algoLength The length of the algorithm part
 * @param algorithm The algorithm in use
 * @return The split credentials, containing the algorithm, the salt and the password 
 */
private static PasswordDetails getPbkdf2Credentials( byte[] credentials, int algoLength, LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the *beginning* of the credentials, and is 16 bytes long
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - PKCS5S2_LENGTH;
  byte[] salt = new byte[saltLength];
  byte[] password = new byte[PKCS5S2_LENGTH];
  split( passwordAndSalt, 0, salt, password );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-ldap-model

/**
 * Gets the credentials from a PKCS5S2 hash.
 * The salt for PKCS5S2 hash is prepended to the password
 * 
 * @param credentials The password
 * @param algoLength The length of the algorithm part
 * @param algorithm The algorithm in use
 * @return The split credentials, containing the algorithm, the salt and the password 
 */
private static PasswordDetails getPbkdf2Credentials( byte[] credentials, int algoLength, LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the *beginning* of the credentials, and is 16 bytes long
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - PKCS5S2_LENGTH;
  byte[] salt = new byte[saltLength];
  byte[] password = new byte[PKCS5S2_LENGTH];
  split( passwordAndSalt, 0, salt, password );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-all

/**
 * Compute the credentials
 * 
 * @param credentials the credentials
 * @param algoLength The algorithm length
 * @param hashLen The hash length
 * @param algorithm the algorithm to use
 * @return The split password string, containing the credentials, the salt and the password
 */
private static PasswordDetails getCredentials( byte[] credentials, int algoLength, int hashLen,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the end of the credentials.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - hashLen;
  byte[] salt = saltLength == 0 ? null : new byte[saltLength];
  byte[] password = new byte[hashLen];
  split( passwordAndSalt, 0, password, salt );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Compute the credentials
 * 
 * @param credentials the credentials
 * @param algoLength The algorithm length
 * @param hashLen The hash length
 * @param algorithm the algorithm to use
 * @return The split password string, containing the credentials, the salt and the password
 */
private static PasswordDetails getCredentials( byte[] credentials, int algoLength, int hashLen,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the end of the credentials.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - hashLen;
  byte[] salt = saltLength == 0 ? null : new byte[saltLength];
  byte[] password = new byte[hashLen];
  split( passwordAndSalt, 0, password, salt );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-all

/**
 * Gets the credentials from a PKCS5S2 hash.
 * The salt for PKCS5S2 hash is prepended to the password
 * 
 * @param credentials The password
 * @param algoLength The length of the algorithm part
 * @param algorithm The algorithm in use
 * @return The split credentials, containing the algorithm, the salt and the password 
 */
private static PasswordDetails getPbkdf2Credentials( byte[] credentials, int algoLength, LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the *beginning* of the credentials, and is 16 bytes long
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - PKCS5S2_LENGTH;
  byte[] salt = new byte[saltLength];
  byte[] password = new byte[PKCS5S2_LENGTH];
  split( passwordAndSalt, 0, salt, password );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-ldap-model

/**
 * Compute the credentials
 * 
 * @param credentials the credentials
 * @param algoLength The algorithm length
 * @param hashLen The hash length
 * @param algorithm the algorithm to use
 * @return The split password string, containing the credentials, the salt and the password
 */
private static PasswordDetails getCredentials( byte[] credentials, int algoLength, int hashLen,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, after having decoded the password.
  // The salt is at the end of the credentials.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  byte[] passwordAndSalt = Base64
    .decode( Strings.utf8ToString( credentials, algoLength, credentials.length - algoLength ).toCharArray() );
  int saltLength = passwordAndSalt.length - hashLen;
  byte[] salt = saltLength == 0 ? null : new byte[saltLength];
  byte[] password = new byte[hashLen];
  split( passwordAndSalt, 0, password, salt );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-all

split( credentials, algoLength, salt, password );
return new PasswordDetails( algorithm, salt, password );
origin: org.apache.directory.api/api-ldap-model

split( credentials, algoLength, salt, password );
return new PasswordDetails( algorithm, salt, password );
origin: org.apache.directory.api/api-ldap-client-all

split( credentials, algoLength, salt, password );
return new PasswordDetails( algorithm, salt, password );
org.apache.directory.api.ldap.model.passwordPasswordUtilsplit

Javadoc

Decompose the stored password in an algorithm, an eventual salt and the password itself. If the algorithm is SHA, SSHA, MD5 or SMD5, the part following the algorithm is base64 encoded

Popular methods of PasswordUtil

  • 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,
  • splitCredentials,
  • isPwdExpired

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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