9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @author Gary Ellison 27 * @bug 4170635 28 * @summary Verify equals()/hashCode() contract honored 29 * @run main/othervm/policy=Allow.policy DerInputBufferEqualsHashCode 30 */ 31 32 import java.io.*; 33 import sun.security.util.*; 34 import sun.security.x509.*; 35 import java.lang.reflect.*; 36 37 38 public class DerInputBufferEqualsHashCode { 39 40 public static void main(String[] args) throws Exception { 41 42 String name1 = "CN=eve s. dropper"; 43 DerOutputStream deros; 44 byte[] ba; 45 // encode 46 X500Name dn1 = new X500Name(name1); 47 48 deros = new DerOutputStream(); | 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @author Gary Ellison 27 * @bug 4170635 28 * @summary Verify equals()/hashCode() contract honored 29 * @modules java.base/sun.security.util 30 * java.base/sun.security.x509 31 * @run main/othervm/policy=Allow.policy DerInputBufferEqualsHashCode 32 */ 33 34 import java.io.*; 35 import sun.security.util.*; 36 import sun.security.x509.*; 37 import java.lang.reflect.*; 38 39 40 public class DerInputBufferEqualsHashCode { 41 42 public static void main(String[] args) throws Exception { 43 44 String name1 = "CN=eve s. dropper"; 45 DerOutputStream deros; 46 byte[] ba; 47 // encode 48 X500Name dn1 = new X500Name(name1); 49 50 deros = new DerOutputStream(); |