jdk/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
changeset 15276 bbddb82e66ce
parent 9035 1255eb81cc2f
child 23010 6dadb192ad81
--- a/jdk/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java	Fri Jan 18 18:48:44 2013 +0000
+++ b/jdk/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java	Sat Jan 19 08:39:20 2013 +0000
@@ -33,6 +33,7 @@
 import java.net.UnknownHostException;
 import java.net.URL;
 import java.security.GeneralSecurityException;
+import java.util.Base64;
 
 import sun.net.www.HeaderParser;
 import sun.net.www.protocol.http.AuthenticationInfo;
@@ -230,7 +231,7 @@
 
     private String buildType1Msg () {
         byte[] msg = client.type1();
-        String result = "NTLM " + (new B64Encoder()).encode (msg);
+        String result = "NTLM " + Base64.getEncoder().encodeToString(msg);
         return result;
     }
 
@@ -239,18 +240,12 @@
         /* First decode the type2 message to get the server nonce */
         /* nonce is located at type2[24] for 8 bytes */
 
-        byte[] type2 = (new sun.misc.BASE64Decoder()).decodeBuffer (challenge);
+        byte[] type2 = Base64.getDecoder().decode(challenge);
         byte[] nonce = new byte[8];
         new java.util.Random().nextBytes(nonce);
         byte[] msg = client.type3(type2, nonce);
-        String result = "NTLM " + (new B64Encoder()).encode (msg);
+        String result = "NTLM " + Base64.getEncoder().encodeToString(msg);
         return result;
     }
 }
 
-class B64Encoder extends sun.misc.BASE64Encoder {
-    /* to force it to to the entire encoding in one line */
-    protected int bytesPerLine () {
-        return 1024;
-    }
-}