Codota Logo
PasswordDetails.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.apache.directory.api.ldap.model.password.PasswordDetails
constructor

Best Java code snippets using org.apache.directory.api.ldap.model.password.PasswordDetails.<init> (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.apache.directory.api/api-ldap-model

private static PasswordDetails getCryptCredentials( byte[] credentials, int algoLength,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, no decoding required.
  // The salt length is dynamic, between the 2nd and 3rd '$'.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  // skip {crypt}$x$
  int pos = algoLength;
  while ( pos < credentials.length )
  {
    if ( credentials[pos] == '$' )
    {
      break;
    }
    pos++;
  }
  byte[] salt = Arrays.copyOfRange( credentials, algoLength, pos );
  byte[] password = Arrays.copyOfRange( credentials, pos + 1, credentials.length );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-ldap-client-all

private static PasswordDetails getCryptCredentials( byte[] credentials, int algoLength,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, no decoding required.
  // The salt length is dynamic, between the 2nd and 3rd '$'.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  // skip {crypt}$x$
  int pos = algoLength;
  while ( pos < credentials.length )
  {
    if ( credentials[pos] == '$' )
    {
      break;
    }
    pos++;
  }
  byte[] salt = Arrays.copyOfRange( credentials, algoLength, pos );
  byte[] password = Arrays.copyOfRange( credentials, pos + 1, credentials.length );
  return new PasswordDetails( algorithm, salt, password );
}
origin: org.apache.directory.api/api-all

private static PasswordDetails getCryptCredentials( byte[] credentials, int algoLength,
  LdapSecurityConstants algorithm )
{
  // The password is associated with a salt. Decompose it
  // in two parts, no decoding required.
  // The salt length is dynamic, between the 2nd and 3rd '$'.
  // The algorithm, salt, and password will be stored into the PasswordDetails structure.
  // skip {crypt}$x$
  int pos = algoLength;
  while ( pos < credentials.length )
  {
    if ( credentials[pos] == '$' )
    {
      break;
    }
    pos++;
  }
  byte[] salt = Arrays.copyOfRange( credentials, algoLength, pos );
  byte[] password = Arrays.copyOfRange( credentials, pos + 1, credentials.length );
  return new PasswordDetails( algorithm, salt, password );
}
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-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-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

/**
 * 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-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

return new PasswordDetails( null, null, credentials );
  password = new byte[credentials.length - salt.length - algoLength];
  split( credentials, algoLength, salt, password );
  return new PasswordDetails( algorithm, salt, password );
    password = Arrays.copyOfRange( credentials, credentials.length - 31, credentials.length );
    return new PasswordDetails( algorithm, salt, password );
origin: org.apache.directory.api/api-ldap-model

return new PasswordDetails( null, null, credentials );
  password = new byte[credentials.length - salt.length - algoLength];
  split( credentials, algoLength, salt, password );
  return new PasswordDetails( algorithm, salt, password );
    password = Arrays.copyOfRange( credentials, credentials.length - 31, credentials.length );
    return new PasswordDetails( algorithm, salt, password );
origin: org.apache.directory.api/api-ldap-client-all

return new PasswordDetails( null, null, credentials );
  password = new byte[credentials.length - salt.length - algoLength];
  split( credentials, algoLength, salt, password );
  return new PasswordDetails( algorithm, salt, password );
    password = Arrays.copyOfRange( credentials, credentials.length - 31, credentials.length );
    return new PasswordDetails( algorithm, salt, password );
org.apache.directory.api.ldap.model.passwordPasswordDetails<init>

Javadoc

Creates a new PasswordDetails instance

Popular methods of PasswordDetails

  • getAlgorithm
    The hash algorithm used to hash the password, null for plain text passwords.
  • getPassword
    The hashed or plain text password.
  • getSalt
    The salt used to hash the password, null if no salt was used.

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now