Tabnine Logo
NTLM.setupKey
Code IndexAdd Tabnine to your IDE (free)

How to use
setupKey
method
in
org.apache.commons.httpclient.auth.NTLM

Best Java code snippets using org.apache.commons.httpclient.auth.NTLM.setupKey (Showing top 5 results out of 315)

origin: commons-httpclient/commons-httpclient

/**
 * Return the cipher for the specified key.
 * @param key The key.
 * @return Cipher The cipher.
 * @throws AuthenticationException If the cipher cannot be retrieved.
 */
private Cipher getCipher(byte[] key) throws AuthenticationException {
  try {
    final Cipher ecipher = Cipher.getInstance("DES/ECB/NoPadding");
    key = setupKey(key);
    ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
    return ecipher;
  } catch (NoSuchAlgorithmException e) {
    throw new AuthenticationException("DES encryption is not available.", e);
  } catch (InvalidKeyException e) {
    throw new AuthenticationException("Invalid key for DES encryption.", e);
  } catch (NoSuchPaddingException e) {
    throw new AuthenticationException(
      "NoPadding option for DES is not available.", e);
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Return the cipher for the specified key.
 * @param key The key.
 * @return Cipher The cipher.
 * @throws AuthenticationException If the cipher cannot be retrieved.
 */
private Cipher getCipher(byte[] key) throws AuthenticationException {
  try {
    final Cipher ecipher = Cipher.getInstance("DES/ECB/NoPadding");
    key = setupKey(key);
    ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
    return ecipher;
  } catch (NoSuchAlgorithmException e) {
    throw new AuthenticationException("DES encryption is not available.", e);
  } catch (InvalidKeyException e) {
    throw new AuthenticationException("Invalid key for DES encryption.", e);
  } catch (NoSuchPaddingException e) {
    throw new AuthenticationException(
      "NoPadding option for DES is not available.", e);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Return the cipher for the specified key.
 * @param key The key.
 * @return Cipher The cipher.
 * @throws AuthenticationException If the cipher cannot be retrieved.
 */
private Cipher getCipher(byte[] key) throws AuthenticationException {
  try {
    final Cipher ecipher = Cipher.getInstance("DES/ECB/NoPadding");
    key = setupKey(key);
    ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
    return ecipher;
  } catch (NoSuchAlgorithmException e) {
    throw new AuthenticationException("DES encryption is not available.", e);
  } catch (InvalidKeyException e) {
    throw new AuthenticationException("Invalid key for DES encryption.", e);
  } catch (NoSuchPaddingException e) {
    throw new AuthenticationException(
      "NoPadding option for DES is not available.", e);
  }
}
origin: org.apache.commons/httpclient

/**
 * Return the cipher for the specified key.
 * @param key The key.
 * @return Cipher The cipher.
 * @throws AuthenticationException If the cipher cannot be retrieved.
 */
private Cipher getCipher(byte[] key) throws AuthenticationException {
  try {
    final Cipher ecipher = Cipher.getInstance("DES/ECB/NoPadding");
    key = setupKey(key);
    ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
    return ecipher;
  } catch (NoSuchAlgorithmException e) {
    throw new AuthenticationException("DES encryption is not available.", e);
  } catch (InvalidKeyException e) {
    throw new AuthenticationException("Invalid key for DES encryption.", e);
  } catch (NoSuchPaddingException e) {
    throw new AuthenticationException(
      "NoPadding option for DES is not available.", e);
  }
}
origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Return the cipher for the specified key.
 * @param key The key.
 * @return Cipher The cipher.
 * @throws AuthenticationException If the cipher cannot be retrieved.
 */
private Cipher getCipher(byte[] key) throws AuthenticationException {
  try {
    final Cipher ecipher = Cipher.getInstance("DES/ECB/NoPadding");
    key = setupKey(key);
    ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DES"));
    return ecipher;
  } catch (NoSuchAlgorithmException e) {
    throw new AuthenticationException("DES encryption is not available.", e);
  } catch (InvalidKeyException e) {
    throw new AuthenticationException("Invalid key for DES encryption.", e);
  } catch (NoSuchPaddingException e) {
    throw new AuthenticationException(
      "NoPadding option for DES is not available.", e);
  }
}
org.apache.commons.httpclient.authNTLMsetupKey

Javadoc

Adds parity bits to the key.

Popular methods of NTLM

  • <init>
  • addByte
    Adds the given byte to the response.
  • addBytes
    Adds the given bytes to the response.
  • calcResp
    Takes a 21 byte array and treats it as 3 56-bit DES keys. The 8 byte plaintext is encrypted with eac
  • convertShort
    Converts a given number to a two byte array in little endian order.
  • encrypt
    Encrypt the data.
  • getCipher
    Return the cipher for the specified key.
  • getResponse
    Returns the response that has been generated after shrinking the array if required and base64 encode
  • getResponseFor
    Returns the response for the given message.
  • getType1Message
    Creates the first message (type 1 message) in the NTLM authentication sequence. This message include
  • getType3Message
    Creates the type 3 message using the given server nonce. The type 3 message includes all the informa
  • hashPassword
    Creates the LANManager and NT response for the given password using the given nonce.
  • getType3Message,
  • hashPassword,
  • parseType2Message,
  • prepareResponse,
  • setCredentialCharset

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • setContentView (Activity)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JLabel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • CodeWhisperer alternatives
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