Examples of Type1Message


Examples of jcifs.ntlmssp.Type1Message

  }
 
  public Type2Message negotiateType2Message(byte[] material, byte[] serverChallenge)
    throws IOException {

    Type1Message type1Message = new Type1Message(material);

    Type2Message type2Message = new Type2Message(
      type1Message.getFlags(), serverChallenge, _domain);

    if (type2Message.getFlag(
        _NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY)) {

      type2Message.setFlag(NtlmFlags.NTLMSSP_NEGOTIATE_LM_KEY, false);
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

import org.apache.http.impl.auth.NTLMEngineException;

public class JCIFSEngine implements NTLMEngine {

    public String generateType1Msg(String domain, String workstation) throws NTLMEngineException {
        Type1Message t1m = new Type1Message(Type1Message.getDefaultFlags(), domain, workstation);
        return Base64.encode(t1m.toByteArray());
    }
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

    }

    private static class JCIFSEngine implements NTLMEngine {

        public String generateType1Msg(String domain, String workstation) throws NTLMEngineException {
            Type1Message type1Message = new Type1Message(Type1Message.getDefaultFlags(), domain, workstation);
            return Base64.encode(type1Message.toByteArray());
        }
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

            }
        }
        // reconnect();
        int flags = NtlmFlags.NTLMSSP_NEGOTIATE_NTLM2 | NtlmFlags.NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NtlmFlags.NTLMSSP_NEGOTIATE_NTLM | NtlmFlags.NTLMSSP_REQUEST_TARGET | NtlmFlags.NTLMSSP_NEGOTIATE_OEM | NtlmFlags.NTLMSSP_NEGOTIATE_UNICODE;
        if (message == null) {
            message = new Type1Message(flags, null, null);
        } else {
            credentials = credentials.substring(authMethod.length()+1); // strip off the "NTLM " or "Negotiate "
            credentials = new String(Base64.decode(credentials)); // decode the base64
            String domain = credentials.substring(0, credentials.indexOf("\\"));
            String user = credentials.substring(domain.length()+1, credentials.indexOf(":"));
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

            String username, String password, String host, String domain)
            throws AuthenticationException {
               
        final String response;
        if (message == null || message.trim().equals("")) {
          Type1Message t1m = new Type1Message();
          t1m.setSuppliedDomain(domain);
          t1m.setSuppliedWorkstation(host);
         
          /*
           * Following constants provided by JCIFS library has been added to support message integrity,
           * confidentiality, session security and 128-bit encryption
           */
          t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
          t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
          t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
          t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);
         
          return EncodingUtil.getAsciiString(Base64.encodeBase64(t1m.toByteArray()));

        } else {
          try
          {
          Type2Message t2m = parseType2Message(message);
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

       
    }

    public final String getType1Message(String host, String domain)
        throws AuthenticationException {
      Type1Message t1m = new Type1Message();
      t1m.setSuppliedDomain(domain);
      t1m.setSuppliedWorkstation(host);
     
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);

     
      return EncodingUtil.getAsciiString(Base64.encodeBase64(t1m.toByteArray()));
    }
View Full Code Here

Examples of jcifs.ntlmssp.Type1Message

   
    public final String getType3Message( String username, String password, String host, String domain, String message)
        throws AuthenticationException {
    final String response;
    if (message == null || message.trim().equals("")) {
      Type1Message t1m = new Type1Message();
      t1m.setSuppliedDomain(domain);
      t1m.setSuppliedWorkstation(host);
     
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
      t1m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);

     
      return t1m.toString();
    } else {
      try
      {
      Type2Message t2m = parseType2Message(message);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.