8144995: Move sun.misc.HexDumpEncoder to sun.security.util
Reviewed-by: psandoz, mchung
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/BlockCipherParamsCore.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/BlockCipherParamsCore.java Mon Dec 14 19:24:33 2015 +0000
@@ -27,7 +27,7 @@
import java.io.*;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.spec.IvParameterSpec;
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCMParameters.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCMParameters.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.spec.GCMParameterSpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEParameters.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEParameters.java Mon Dec 14 19:24:33 2015 +0000
@@ -31,7 +31,7 @@
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.spec.PBEParameterSpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEParameterSpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Parameters.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/RC2Parameters.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import javax.crypto.spec.RC2ParameterSpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java Mon Dec 14 19:24:33 2015 +0000
@@ -118,7 +118,7 @@
public void debug(byte[] bytes) {
if (DEBUG) {
try {
- new sun.misc.HexDumpEncoder().encodeBuffer(bytes, System.out);
+ new sun.security.util.HexDumpEncoder().encodeBuffer(bytes, System.out);
} catch (IOException ioe) {
// Impossible
}
--- a/jdk/src/java.base/share/classes/java/security/cert/PolicyQualifierInfo.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/security/cert/PolicyQualifierInfo.java Mon Dec 14 19:24:33 2015 +0000
@@ -27,7 +27,7 @@
import java.io.IOException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.DerValue;
/**
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Mon Dec 14 19:24:33 2015 +0000
@@ -31,7 +31,7 @@
import java.util.*;
import javax.security.auth.x500.X500Principal;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.Debug;
import sun.security.util.DerInputStream;
import sun.security.util.DerValue;
--- a/jdk/src/java.base/share/classes/sun/misc/HexDumpEncoder.java Mon Dec 14 09:27:15 2015 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.misc;
-import java.io.PrintStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * This class encodes a buffer into the classic: "Hexadecimal Dump" format of
- * the past. It is useful for analyzing the contents of binary buffers.
- * The format produced is as follows:
- * <pre>
- * xxxx: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ................
- * </pre>
- * Where xxxx is the offset into the buffer in 16 byte chunks, followed
- * by ascii coded hexadecimal bytes followed by the ASCII representation of
- * the bytes or '.' if they are not valid bytes.
- *
- * @author Chuck McManis
- */
-
-public class HexDumpEncoder extends CharacterEncoder {
-
- private int offset;
- private int thisLineLength;
- private int currentByte;
- private byte thisLine[] = new byte[16];
-
- static void hexDigit(PrintStream p, byte x) {
- char c;
-
- c = (char) ((x >> 4) & 0xf);
- if (c > 9)
- c = (char) ((c-10) + 'A');
- else
- c = (char)(c + '0');
- p.write(c);
- c = (char) (x & 0xf);
- if (c > 9)
- c = (char)((c-10) + 'A');
- else
- c = (char)(c + '0');
- p.write(c);
- }
-
- protected int bytesPerAtom() {
- return (1);
- }
-
- protected int bytesPerLine() {
- return (16);
- }
-
- protected void encodeBufferPrefix(OutputStream o) throws IOException {
- offset = 0;
- super.encodeBufferPrefix(o);
- }
-
- protected void encodeLinePrefix(OutputStream o, int len) throws IOException {
- hexDigit(pStream, (byte)((offset >>> 8) & 0xff));
- hexDigit(pStream, (byte)(offset & 0xff));
- pStream.print(": ");
- currentByte = 0;
- thisLineLength = len;
- }
-
- protected void encodeAtom(OutputStream o, byte buf[], int off, int len) throws IOException {
- thisLine[currentByte] = buf[off];
- hexDigit(pStream, buf[off]);
- pStream.print(" ");
- currentByte++;
- if (currentByte == 8)
- pStream.print(" ");
- }
-
- protected void encodeLineSuffix(OutputStream o) throws IOException {
- if (thisLineLength < 16) {
- for (int i = thisLineLength; i < 16; i++) {
- pStream.print(" ");
- if (i == 7)
- pStream.print(" ");
- }
- }
- pStream.print(" ");
- for (int i = 0; i < thisLineLength; i++) {
- if ((thisLine[i] < ' ') || (thisLine[i] > 'z')) {
- pStream.print(".");
- } else {
- pStream.write(thisLine[i]);
- }
- }
- pStream.println();
- offset += thisLineLength;
- }
-
-}
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS8Key.java Mon Dec 14 19:24:33 2015 +0000
@@ -39,7 +39,7 @@
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.x509.*;
import sun.security.util.*;
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java Mon Dec 14 19:24:33 2015 +0000
@@ -38,7 +38,7 @@
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
import sun.security.util.ObjectIdentifier;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* Class supporting any PKCS9 attributes.
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java Mon Dec 14 19:24:33 2015 +0000
@@ -41,7 +41,7 @@
import sun.security.x509.AlgorithmId;
import sun.security.x509.X500Name;
import sun.security.x509.KeyUsageExtension;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* A SignerInfo, as defined in PKCS#7's signedData type.
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/SigningCertificateInfo.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/SigningCertificateInfo.java Mon Dec 14 19:24:33 2015 +0000
@@ -28,7 +28,7 @@
import java.io.IOException;
import java.util.ArrayList;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.DerInputStream;
import sun.security.util.DerValue;
import sun.security.x509.GeneralNames;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/CertId.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/CertId.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import java.security.cert.X509Certificate;
import java.util.Arrays;
import javax.security.auth.x500.X500Principal;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.x509.*;
import sun.security.util.*;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPRequest.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPRequest.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import java.util.Collections;
import java.util.List;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
import sun.security.x509.PKIXExtensions;
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java Mon Dec 14 19:24:33 2015 +0000
@@ -44,7 +44,7 @@
import java.util.Set;
import javax.security.auth.x500.X500Principal;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.action.GetIntegerAction;
import sun.security.x509.*;
import sun.security.util.*;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/CipherBox.java Mon Dec 14 19:24:33 2015 +0000
@@ -42,7 +42,7 @@
import static sun.security.ssl.CipherSuite.*;
import static sun.security.ssl.CipherSuite.CipherType.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -32,7 +32,7 @@
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import static sun.security.ssl.HandshakeMessage.*;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import static sun.security.ssl.Ciphertext.RecordType;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Debug.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,7 +29,7 @@
import java.security.AccessController;
import java.util.Locale;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import java.nio.ByteBuffer;
import sun.security.action.GetPropertyAction;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java Mon Dec 14 19:24:33 2015 +0000
@@ -41,7 +41,7 @@
import javax.crypto.spec.*;
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.internal.spec.*;
import sun.security.internal.interfaces.TlsMasterSecret;
--- a/jdk/src/java.base/share/classes/sun/security/ssl/InputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/InputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import java.util.Arrays;
import javax.net.ssl.SSLException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -32,7 +32,7 @@
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -31,7 +31,7 @@
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import static sun.security.ssl.Ciphertext.RecordType;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -32,7 +32,7 @@
import javax.net.ssl.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java Mon Dec 14 19:24:33 2015 +0000
@@ -31,7 +31,7 @@
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Mon Dec 14 19:24:33 2015 +0000
@@ -2956,7 +2956,7 @@
if (v.length == 0) {
out.println(rb.getString(".Empty.value."));
} else {
- new sun.misc.HexDumpEncoder().encodeBuffer(ext.getExtensionValue(), out);
+ new sun.security.util.HexDumpEncoder().encodeBuffer(ext.getExtensionValue(), out);
out.println();
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/util/HexDumpEncoder.java Mon Dec 14 19:24:33 2015 +0000
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package sun.security.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/**
+ * This class encodes a buffer into the classic: "Hexadecimal Dump" format of
+ * the past. It is useful for analyzing the contents of binary buffers.
+ * The format produced is as follows:
+ * <pre>
+ * xxxx: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ................
+ * </pre>
+ * Where xxxx is the offset into the buffer in 16 byte chunks, followed
+ * by ascii coded hexadecimal bytes followed by the ASCII representation of
+ * the bytes or '.' if they are not valid bytes.
+ *
+ * @author Chuck McManis
+ */
+
+public class HexDumpEncoder {
+
+ private int offset;
+ private int thisLineLength;
+ private int currentByte;
+ private byte thisLine[] = new byte[16];
+
+ static void hexDigit(PrintStream p, byte x) {
+ char c;
+
+ c = (char) ((x >> 4) & 0xf);
+ if (c > 9)
+ c = (char) ((c-10) + 'A');
+ else
+ c = (char)(c + '0');
+ p.write(c);
+ c = (char) (x & 0xf);
+ if (c > 9)
+ c = (char)((c-10) + 'A');
+ else
+ c = (char)(c + '0');
+ p.write(c);
+ }
+
+ protected int bytesPerAtom() {
+ return (1);
+ }
+
+ protected int bytesPerLine() {
+ return (16);
+ }
+
+ protected void encodeBufferPrefix(OutputStream o) throws IOException {
+ offset = 0;
+ pStream = new PrintStream(o);
+ }
+
+ protected void encodeLinePrefix(OutputStream o, int len) throws IOException {
+ hexDigit(pStream, (byte)((offset >>> 8) & 0xff));
+ hexDigit(pStream, (byte)(offset & 0xff));
+ pStream.print(": ");
+ currentByte = 0;
+ thisLineLength = len;
+ }
+
+ protected void encodeAtom(OutputStream o, byte buf[], int off, int len) throws IOException {
+ thisLine[currentByte] = buf[off];
+ hexDigit(pStream, buf[off]);
+ pStream.print(" ");
+ currentByte++;
+ if (currentByte == 8)
+ pStream.print(" ");
+ }
+
+ protected void encodeLineSuffix(OutputStream o) throws IOException {
+ if (thisLineLength < 16) {
+ for (int i = thisLineLength; i < 16; i++) {
+ pStream.print(" ");
+ if (i == 7)
+ pStream.print(" ");
+ }
+ }
+ pStream.print(" ");
+ for (int i = 0; i < thisLineLength; i++) {
+ if ((thisLine[i] < ' ') || (thisLine[i] > 'z')) {
+ pStream.print(".");
+ } else {
+ pStream.write(thisLine[i]);
+ }
+ }
+ pStream.println();
+ offset += thisLineLength;
+ }
+
+ /** Stream that understands "printing" */
+ protected PrintStream pStream;
+
+ /**
+ * This method works around the bizarre semantics of BufferedInputStream's
+ * read method.
+ */
+ protected int readFully(InputStream in, byte buffer[])
+ throws java.io.IOException {
+ for (int i = 0; i < buffer.length; i++) {
+ int q = in.read();
+ if (q == -1)
+ return i;
+ buffer[i] = (byte)q;
+ }
+ return buffer.length;
+ }
+
+ /**
+ * Encode bytes from the input stream, and write them as text characters
+ * to the output stream. This method will run until it exhausts the
+ * input stream, but does not print the line suffix for a final
+ * line that is shorter than bytesPerLine().
+ */
+ public void encode(InputStream inStream, OutputStream outStream)
+ throws IOException
+ {
+ int j;
+ int numBytes;
+ byte tmpbuffer[] = new byte[bytesPerLine()];
+
+ encodeBufferPrefix(outStream);
+
+ while (true) {
+ numBytes = readFully(inStream, tmpbuffer);
+ if (numBytes == 0) {
+ break;
+ }
+ encodeLinePrefix(outStream, numBytes);
+ for (j = 0; j < numBytes; j += bytesPerAtom()) {
+
+ if ((j + bytesPerAtom()) <= numBytes) {
+ encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
+ } else {
+ encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
+ }
+ }
+ if (numBytes < bytesPerLine()) {
+ break;
+ } else {
+ encodeLineSuffix(outStream);
+ }
+ }
+ }
+
+ /**
+ * A 'streamless' version of encode that simply takes a buffer of
+ * bytes and returns a string containing the encoded buffer.
+ */
+ public String encode(byte aBuffer[]) {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+ String retVal = null;
+ try {
+ encode(inStream, outStream);
+ // explicit ascii->unicode conversion
+ retVal = outStream.toString("ISO-8859-1");
+ } catch (Exception IOException) {
+ // This should never happen.
+ throw new Error("CharacterEncoder.encode internal error");
+ }
+ return (retVal);
+ }
+
+ /**
+ * Return a byte array from the remaining bytes in this ByteBuffer.
+ * <P>
+ * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+ * <P>
+ * To avoid an extra copy, the implementation will attempt to return the
+ * byte array backing the ByteBuffer. If this is not possible, a
+ * new byte array will be created.
+ */
+ private byte [] getBytes(ByteBuffer bb) {
+ /*
+ * This should never return a BufferOverflowException, as we're
+ * careful to allocate just the right amount.
+ */
+ byte [] buf = null;
+
+ /*
+ * If it has a usable backing byte buffer, use it. Use only
+ * if the array exactly represents the current ByteBuffer.
+ */
+ if (bb.hasArray()) {
+ byte [] tmp = bb.array();
+ if ((tmp.length == bb.capacity()) &&
+ (tmp.length == bb.remaining())) {
+ buf = tmp;
+ bb.position(bb.limit());
+ }
+ }
+
+ if (buf == null) {
+ /*
+ * This class doesn't have a concept of encode(buf, len, off),
+ * so if we have a partial buffer, we must reallocate
+ * space.
+ */
+ buf = new byte[bb.remaining()];
+
+ /*
+ * position() automatically updated
+ */
+ bb.get(buf);
+ }
+
+ return buf;
+ }
+
+ /**
+ * A 'streamless' version of encode that simply takes a ByteBuffer
+ * and returns a string containing the encoded buffer.
+ * <P>
+ * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+ */
+ public String encode(ByteBuffer aBuffer) {
+ byte [] buf = getBytes(aBuffer);
+ return encode(buf);
+ }
+
+ /**
+ * Encode bytes from the input stream, and write them as text characters
+ * to the output stream. This method will run until it exhausts the
+ * input stream. It differs from encode in that it will add the
+ * line at the end of a final line that is shorter than bytesPerLine().
+ */
+ public void encodeBuffer(InputStream inStream, OutputStream outStream)
+ throws IOException
+ {
+ int j;
+ int numBytes;
+ byte tmpbuffer[] = new byte[bytesPerLine()];
+
+ encodeBufferPrefix(outStream);
+
+ while (true) {
+ numBytes = readFully(inStream, tmpbuffer);
+ if (numBytes == 0) {
+ break;
+ }
+ encodeLinePrefix(outStream, numBytes);
+ for (j = 0; j < numBytes; j += bytesPerAtom()) {
+ if ((j + bytesPerAtom()) <= numBytes) {
+ encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
+ } else {
+ encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
+ }
+ }
+ encodeLineSuffix(outStream);
+ if (numBytes < bytesPerLine()) {
+ break;
+ }
+ }
+ }
+
+ /**
+ * Encode the buffer in <i>aBuffer</i> and write the encoded
+ * result to the OutputStream <i>aStream</i>.
+ */
+ public void encodeBuffer(byte aBuffer[], OutputStream aStream)
+ throws IOException
+ {
+ ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+ encodeBuffer(inStream, aStream);
+ }
+
+ /**
+ * A 'streamless' version of encode that simply takes a buffer of
+ * bytes and returns a string containing the encoded buffer.
+ */
+ public String encodeBuffer(byte aBuffer[]) {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+ try {
+ encodeBuffer(inStream, outStream);
+ } catch (Exception IOException) {
+ // This should never happen.
+ throw new Error("CharacterEncoder.encodeBuffer internal error");
+ }
+ return (outStream.toString());
+ }
+
+ /**
+ * Encode the <i>aBuffer</i> ByteBuffer and write the encoded
+ * result to the OutputStream <i>aStream</i>.
+ * <P>
+ * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+ */
+ public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream)
+ throws IOException
+ {
+ byte [] buf = getBytes(aBuffer);
+ encodeBuffer(buf, aStream);
+ }
+
+}
--- a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java Mon Dec 14 19:24:33 2015 +0000
@@ -443,7 +443,7 @@
if (sfAttr != null) {
- //sun.misc.HexDumpEncoder hex = new sun.misc.HexDumpEncoder();
+ //sun.security.util.HexDumpEncoder hex = new sun.security.util.HexDumpEncoder();
//hex.encodeBuffer(data, System.out);
// go through all the attributes and process *-Digest entries
--- a/jdk/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import java.security.cert.CertificateException;
import java.util.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
@@ -376,6 +376,6 @@
@Override public String toString() {
return super.toString() +
"Unparseable " + name + "extension due to\n" + why + "\n\n" +
- new sun.misc.HexDumpEncoder().encodeBuffer(getExtensionValue());
+ new HexDumpEncoder().encodeBuffer(getExtensionValue());
}
}
--- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,7 +29,7 @@
import java.lang.Integer;
import java.net.InetAddress;
import java.util.Arrays;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.BitArray;
import sun.security.util.DerOutputStream;
import sun.security.util.DerValue;
--- a/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java Mon Dec 14 19:24:33 2015 +0000
@@ -27,7 +27,7 @@
import java.io.IOException;
import java.math.BigInteger;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -35,7 +35,7 @@
import javax.security.auth.x500.X500Principal;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* <p>Abstract class for a revoked certificate in a CRL.
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -49,7 +49,7 @@
import sun.security.provider.X509Factory;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* <p>
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -41,7 +41,7 @@
import javax.security.auth.x500.X500Principal;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import java.util.Base64;
import sun.security.util.*;
import sun.security.provider.X509Factory;
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java Mon Dec 14 19:24:33 2015 +0000
@@ -32,7 +32,7 @@
import java.util.*;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509Key.java Mon Dec 14 19:24:33 2015 +0000
@@ -38,7 +38,7 @@
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.util.*;
/**
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/Ber.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/Ber.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,7 +29,7 @@
import java.io.IOException;
import java.io.ByteArrayInputStream;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* Base class that defines common fields, constants, and debug method.
--- a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -44,7 +44,7 @@
import javax.naming.ldap.LdapContext;
import javax.security.auth.x500.X500Principal;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.provider.certpath.X509CertificatePair;
import sun.security.util.Cache;
import sun.security.util.Debug;
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java Mon Dec 14 19:24:33 2015 +0000
@@ -34,7 +34,7 @@
import javax.security.auth.Destroyable;
import javax.security.auth.RefreshFailedException;
import javax.security.auth.DestroyFailedException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* This class encapsulates a Kerberos ticket and associated
--- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,7 +30,7 @@
import javax.crypto.SecretKey;
import javax.security.auth.Destroyable;
import javax.security.auth.DestroyFailedException;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.krb5.Asn1Exception;
import sun.security.krb5.PrincipalName;
import sun.security.krb5.EncryptionKey;
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java Mon Dec 14 19:24:33 2015 +0000
@@ -26,7 +26,7 @@
package sun.security.jgss.krb5;
import org.ietf.jgss.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.jgss.GSSUtil;
import sun.security.jgss.GSSCaller;
import sun.security.jgss.spi.*;
@@ -1415,7 +1415,7 @@
@Override
public String toString() {
return "Kerberos session key: etype: " + key.getEType() + "\n" +
- new sun.misc.HexDumpEncoder().encodeBuffer(key.getBytes());
+ new HexDumpEncoder().encodeBuffer(key.getBytes());
}
}
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBError.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBError.java Mon Dec 14 19:24:33 2015 +0000
@@ -227,7 +227,7 @@
} catch (Exception e) {
if (DEBUG) {
System.out.println("Unable to parse eData field of KRB-ERROR:\n" +
- new sun.misc.HexDumpEncoder().encodeBuffer(data));
+ new sun.security.util.HexDumpEncoder().encodeBuffer(data));
}
IOException ioe = new IOException(
"Unable to parse eData field of KRB-ERROR");
@@ -237,7 +237,7 @@
} else {
if (DEBUG) {
System.out.println("Unknown eData field of KRB-ERROR:\n" +
- new sun.misc.HexDumpEncoder().encodeBuffer(data));
+ new sun.security.util.HexDumpEncoder().encodeBuffer(data));
}
}
}
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java Mon Dec 14 19:24:33 2015 +0000
@@ -306,8 +306,8 @@
public static final boolean DEBUG =
java.security.AccessController.doPrivileged(
new sun.security.action.GetBooleanAction("sun.security.krb5.debug"));
- public static final sun.misc.HexDumpEncoder hexDumper =
- new sun.misc.HexDumpEncoder();
+ public static final sun.security.util.HexDumpEncoder hexDumper =
+ new sun.security.util.HexDumpEncoder();
static {
errMsgList = new Hashtable<Integer,String> ();
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java Mon Dec 14 19:24:33 2015 +0000
@@ -306,7 +306,7 @@
} else if (s2kparams.length == 0) {
sb.append("empty\n");
} else {
- sb.append(new sun.misc.HexDumpEncoder()
+ sb.append(new sun.security.util.HexDumpEncoder()
.encodeBuffer(s2kparams));
}
}
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Mon Dec 14 19:24:33 2015 +0000
@@ -40,7 +40,7 @@
import java.nio.charset.Charset;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.krb5.Confounder;
import sun.security.krb5.internal.crypto.KeyUsage;
import sun.security.krb5.KrbCryptoException;
--- a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import java.util.logging.Logger;
import java.util.logging.Level;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* The base class used by client and server implementations of SASL
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Mon Dec 14 19:24:33 2015 +0000
@@ -44,7 +44,7 @@
import sun.security.krb5.*;
import sun.security.jgss.krb5.Krb5Util;
import sun.security.krb5.Credentials;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* This {@code LoginModule} authenticates users using
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java Mon Dec 14 19:24:33 2015 +0000
@@ -64,6 +64,6 @@
public String toString() {
return "AuthorizationDataEntry: type="+type+", data=" +
data.length + " bytes:\n" +
- new sun.misc.HexDumpEncoder().encodeBuffer(data);
+ new sun.security.util.HexDumpEncoder().encodeBuffer(data);
}
}
--- a/jdk/test/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java Mon Dec 14 19:24:33 2015 +0000
@@ -25,7 +25,6 @@
* @test
* @bug 7146728
* @summary DHKeyAgreement2
- * @modules java.base/sun.misc
* @author Jan Luehe
*/
@@ -38,8 +37,6 @@
import javax.crypto.spec.*;
import javax.crypto.interfaces.*;
-import sun.misc.HexDumpEncoder;
-
/**
* This test utility executes the Diffie-Hellman key agreement protocol
* between 2 parties: Alice and Bob.
--- a/jdk/test/com/sun/jndi/ldap/Base64Test.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/com/sun/jndi/ldap/Base64Test.java Mon Dec 14 19:24:33 2015 +0000
@@ -164,7 +164,7 @@
private static void deserialize(byte[] bytes) throws Exception {
//System.out.println("\nSerialized RefAddr object: ");
- //System.out.println(new sun.misc.HexDumpEncoder().encode(bytes));
+ //System.out.println(new sun.security.util.HexDumpEncoder().encode(bytes));
ObjectInputStream objectStream =
new ObjectInputStream(new ByteArrayInputStream(bytes));
--- a/jdk/test/com/sun/security/sasl/ntlm/NTLMTest.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/com/sun/security/sasl/ntlm/NTLMTest.java Mon Dec 14 19:24:33 2015 +0000
@@ -25,13 +25,14 @@
* @test
* @bug 6911951 7150092
* @summary NTLM should be a supported Java SASL mechanism
- * @modules java.base/sun.misc
+ * @modules java.base/sun.security.util
* java.security.sasl
*/
import java.io.IOException;
import javax.security.sasl.*;
import javax.security.auth.callback.*;
import java.util.*;
+import sun.security.util.HexDumpEncoder;
public class NTLMTest {
@@ -311,7 +312,7 @@
byte[] response = (clnt.hasInitialResponse()
? clnt.evaluateChallenge(EMPTY) : EMPTY);
System.out.println("Initial:");
- new sun.misc.HexDumpEncoder().encodeBuffer(response, System.out);
+ new HexDumpEncoder().encodeBuffer(response, System.out);
byte[] challenge;
while (!clnt.isComplete() || !srv.isComplete()) {
@@ -319,12 +320,12 @@
response = null;
if (challenge != null) {
System.out.println("Challenge:");
- new sun.misc.HexDumpEncoder().encodeBuffer(challenge, System.out);
+ new HexDumpEncoder().encodeBuffer(challenge, System.out);
response = clnt.evaluateChallenge(challenge);
}
if (response != null) {
System.out.println("Response:");
- new sun.misc.HexDumpEncoder().encodeBuffer(response, System.out);
+ new HexDumpEncoder().encodeBuffer(response, System.out);
}
}
--- a/jdk/test/javax/net/ssl/DTLS/DTLSOverDatagram.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/javax/net/ssl/DTLS/DTLSOverDatagram.java Mon Dec 14 19:24:33 2015 +0000
@@ -28,6 +28,7 @@
* @test
* @bug 8043758
* @summary Datagram Transport Layer Security (DTLS)
+ * @modules java.base/sun.security.util
* @run main/othervm DTLSOverDatagram
*/
@@ -40,7 +41,7 @@
import javax.net.ssl.*;
import java.util.concurrent.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/**
* An example to show the way to use SSLEngine in datagram connections.
--- a/jdk/test/javax/net/ssl/templates/SSLExplorer.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/javax/net/ssl/templates/SSLExplorer.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,8 +29,6 @@
import javax.net.ssl.*;
import java.util.*;
-import sun.misc.HexDumpEncoder;
-
/**
* Instances of this class acts as an explorer of the network data of an
* SSL/TLS connection.
--- a/jdk/test/javax/security/auth/Subject/Subject.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/javax/security/auth/Subject/Subject.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,7 +29,6 @@
*/
package jjjjj.security.auth;
-import sun.misc.HexDumpEncoder;
import javax.management.remote.JMXPrincipal;
import javax.security.auth.kerberos.KerberosPrincipal;
import javax.security.auth.x500.X500Principal;
@@ -107,7 +106,6 @@
public static byte[] enc(Object obj) {
try {
- HexDumpEncoder hex = new HexDumpEncoder();
ByteArrayOutputStream bout;
bout = new ByteArrayOutputStream();
new ObjectOutputStream(bout).writeObject(obj);
--- a/jdk/test/sun/security/krb5/auto/MSOID2.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/krb5/auto/MSOID2.java Mon Dec 14 19:24:33 2015 +0000
@@ -30,6 +30,7 @@
*/
import sun.security.jgss.GSSUtil;
+import sun.security.util.HexDumpEncoder;
// The basic krb5 test skeleton you can copy from
public class MSOID2 {
@@ -69,7 +70,7 @@
nt[pos] = (byte)newLen;
}
t = nt;
- new sun.misc.HexDumpEncoder().encodeBuffer(t, System.out);
+ new HexDumpEncoder().encodeBuffer(t, System.out);
}
if (t != null || !s.x().isEstablished()) t = s.take(t);
if (c.x().isEstablished() && s.x().isEstablished()) break;
--- a/jdk/test/sun/security/mscapi/PublicKeyInterop.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/mscapi/PublicKeyInterop.java Mon Dec 14 19:24:33 2015 +0000
@@ -29,7 +29,7 @@
import java.util.*;
import javax.crypto.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
/*
* Confirm interoperability of RSA public keys between SunMSCAPI and SunJCE
--- a/jdk/test/sun/security/mscapi/PublicKeyInterop.sh Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/mscapi/PublicKeyInterop.sh Mon Dec 14 19:24:33 2015 +0000
@@ -25,6 +25,7 @@
# @test
# @bug 6888925
+# @modules java.base/sun.security.util
# @requires os.family == "windows"
# @run shell PublicKeyInterop.sh
# @summary SunMSCAPI's Cipher can't use RSA public keys obtained from other
--- a/jdk/test/sun/security/pkcs/pkcs7/SignerOrder.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/pkcs/pkcs7/SignerOrder.java Mon Dec 14 19:24:33 2015 +0000
@@ -40,7 +40,7 @@
import java.security.SignatureException;
import java.security.cert.X509Certificate;
import java.util.Date;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.pkcs.ContentInfo;
import sun.security.pkcs.PKCS7;
import sun.security.pkcs.SignerInfo;
--- a/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java Mon Dec 14 19:24:33 2015 +0000
@@ -43,7 +43,7 @@
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.util.Arrays;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.pkcs.PKCS8Key;
import sun.security.provider.DSAPrivateKey;
import sun.security.util.DerOutputStream;
--- a/jdk/test/sun/security/pkcs/pkcs9/UnknownAttribute.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/pkcs/pkcs9/UnknownAttribute.java Mon Dec 14 19:24:33 2015 +0000
@@ -33,7 +33,7 @@
import java.io.*;
import java.util.Arrays;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
import sun.security.pkcs.PKCS9Attribute;
import sun.security.util.DerValue;
import sun.security.util.ObjectIdentifier;
--- a/jdk/test/sun/security/x509/X500Name/NullX500Name.java Mon Dec 14 09:27:15 2015 -0800
+++ b/jdk/test/sun/security/x509/X500Name/NullX500Name.java Mon Dec 14 19:24:33 2015 +0000
@@ -32,7 +32,7 @@
import java.util.Arrays;
import sun.security.util.DerOutputStream;
import sun.security.x509.*;
-import sun.misc.HexDumpEncoder;
+import sun.security.util.HexDumpEncoder;
public class NullX500Name {