diff --git a/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java b/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java index 1653a239960915d4015972561916f8fea5a9085b..cb50886f6eb172dea8d944032e0de54f3353bff3 100644 --- a/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java +++ b/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -279,22 +279,6 @@ javax.crypto.interfaces.DHPrivateKey, Serializable { return new DHParameterSpec(this.p, this.g); } - public String toString() { - String LINE_SEP = System.getProperty("line.separator"); - - StringBuffer strbuf - = new StringBuffer("SunJCE Diffie-Hellman Private Key:" - + LINE_SEP + "x:" + LINE_SEP - + Debug.toHexString(this.x) - + LINE_SEP + "p:" + LINE_SEP - + Debug.toHexString(this.p) - + LINE_SEP + "g:" + LINE_SEP - + Debug.toHexString(this.g)); - if (this.l != 0) - strbuf.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); - return strbuf.toString(); - } - private void parseKeyBits() throws InvalidKeyException { try { DerInputStream in = new DerInputStream(this.key); diff --git a/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java b/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java index 3bc90ce8071331a0550b3e21dd6a23f3ff345ce1..b974c3ca86cc4b505e04efd6c2ebd98436c9a00f 100644 --- a/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java +++ b/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, 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 @@ -152,12 +152,4 @@ public final class ECPrivateKeyImpl extends PKCS8Key implements ECPrivateKey { throw new InvalidKeyException("Invalid EC private key", e); } } - - // return a string representation of this key for debugging - public String toString() { - return "Sun EC private key, " + params.getCurve().getField().getFieldSize() - + " bits\n private value: " - + s + "\n parameters: " + params; - } - } diff --git a/src/share/classes/sun/security/jgss/GSSCredentialImpl.java b/src/share/classes/sun/security/jgss/GSSCredentialImpl.java index 584e1784c8ac1d3906ced0bf3cd4c13006f9146a..65f6847fd3e87649a8b401b841fd94600c4d70c3 100644 --- a/src/share/classes/sun/security/jgss/GSSCredentialImpl.java +++ b/src/share/classes/sun/security/jgss/GSSCredentialImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, 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 @@ -651,7 +651,7 @@ public class GSSCredentialImpl implements ExtendedGSSCredential { buffer.append(element.isAcceptorCredential() ? " Accept" : ""); buffer.append(" ["); - buffer.append(element.toString()); + buffer.append(element.getClass()); buffer.append(']'); } catch (GSSException e) { // skip to next element diff --git a/src/share/classes/sun/security/pkcs/PKCS8Key.java b/src/share/classes/sun/security/pkcs/PKCS8Key.java index c53b421da6643b92b47c6ef894be7eef966099b6..59512f11b6e97fa80d42f75bc74addc31f01a90c 100644 --- a/src/share/classes/sun/security/pkcs/PKCS8Key.java +++ b/src/share/classes/sun/security/pkcs/PKCS8Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, 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 @@ -304,17 +304,6 @@ public class PKCS8Key implements PrivateKey { return encodedKey.clone(); } - /* - * Returns a printable representation of the key - */ - public String toString () - { - HexDumpEncoder encoder = new HexDumpEncoder (); - - return "algorithm = " + algid.toString () - + ", unparsed keybits = \n" + encoder.encodeBuffer (key); - } - /** * Initialize an PKCS8Key object from an input stream. The data * on that input stream must be encoded using DER, obeying the diff --git a/src/share/classes/sun/security/pkcs11/P11Key.java b/src/share/classes/sun/security/pkcs11/P11Key.java index dd0ec5f7ee1768078f56138fb6d1c03323b250d4..e85d27efbb31051aa9a5df12d90eb2a36ecc9c87 100644 --- a/src/share/classes/sun/security/pkcs11/P11Key.java +++ b/src/share/classes/sun/security/pkcs11/P11Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -552,27 +552,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return coeff; } - public String toString() { - fetchValues(); - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("\n modulus: "); - sb.append(n); - sb.append("\n public exponent: "); - sb.append(e); - sb.append("\n private exponent: "); - sb.append(d); - sb.append("\n prime p: "); - sb.append(p); - sb.append("\n prime q: "); - sb.append(q); - sb.append("\n prime exponent p: "); - sb.append(pe); - sb.append("\n prime exponent q: "); - sb.append(qe); - sb.append("\n crt coefficient: "); - sb.append(coeff); - return sb.toString(); - } } // RSA non-CRT private key @@ -628,15 +607,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return d; } - public String toString() { - fetchValues(); - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("\n modulus: "); - sb.append(n); - sb.append("\n private exponent: "); - sb.append(d); - return sb.toString(); - } } private static final class P11RSAPublicKey extends P11Key @@ -812,11 +782,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() + "\n x: " + x + "\n p: " + params.getP() - + "\n q: " + params.getQ() + "\n g: " + params.getG(); - } } private static final class P11DHPrivateKey extends P11Key @@ -876,11 +841,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() + "\n x: " + x + "\n p: " + params.getP() - + "\n g: " + params.getG(); - } } private static final class P11DHPublicKey extends P11Key @@ -1001,12 +961,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() - + "\n private value: " + s - + "\n parameters: " + params; - } } private static final class P11ECPublicKey extends P11Key diff --git a/src/share/classes/sun/security/provider/DSAPrivateKey.java b/src/share/classes/sun/security/provider/DSAPrivateKey.java index b521e3d2fbd0505333dd50b3bb569d4fc4c3ac8c..97e7ef8d7da588c1d3c07b32bb7bfd5805f6609c 100644 --- a/src/share/classes/sun/security/provider/DSAPrivateKey.java +++ b/src/share/classes/sun/security/provider/DSAPrivateKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, 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 @@ -142,11 +142,6 @@ implements java.security.interfaces.DSAPrivateKey, Serializable { } } - public String toString() { - return "Sun DSA Private Key \nparameters:" + algid + "\nx: " + - Debug.toHexString(x) + "\n"; - } - protected void parseKeyBits() throws InvalidKeyException { try { DerInputStream in = new DerInputStream(key); diff --git a/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java index b289ef2efaaf14d02aec4a21da2880a1093ddc0a..7e68c427e52f91cb5fbb47122aff28a7c516ae86 100644 --- a/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java +++ b/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -225,29 +225,4 @@ public final class RSAPrivateCrtKeyImpl } return b; } - - // return a string representation of this key for debugging - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Sun RSA private CRT key, "); - sb.append(n.bitLength()); - sb.append(" bits\n modulus: "); - sb.append(n); - sb.append("\n public exponent: "); - sb.append(e); - sb.append("\n private exponent: "); - sb.append(d); - sb.append("\n prime p: "); - sb.append(p); - sb.append("\n prime q: "); - sb.append(q); - sb.append("\n prime exponent p: "); - sb.append(pe); - sb.append("\n prime exponent q: "); - sb.append(qe); - sb.append("\n crt coefficient: "); - sb.append(coeff); - return sb.toString(); - } - } diff --git a/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java index f9a7c340bf4b5a477638c9c5760422e5f486d185..1a7df130463c77a0e9ee4a9718eedb06fd6e7c07 100644 --- a/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java +++ b/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -98,11 +98,4 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey { public BigInteger getPrivateExponent() { return d; } - - // return a string representation of this key for debugging - public String toString() { - return "Sun RSA private key, " + n.bitLength() + " bits\n modulus: " - + n + "\n private exponent: " + d; - } - }