Package jcifs.ntlmssp

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


            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

       
    }

    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

   
    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

Related Classes of jcifs.ntlmssp.Type1Message

Copyright © 2018 www.massapicom. 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.