equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
41 * |
41 * |
42 * @author Jan Luehe |
42 * @author Jan Luehe |
43 * |
43 * |
44 * |
44 * |
45 * @see DHPrivateKey |
45 * @see DHPrivateKey |
46 * @see java.security.KeyAgreement |
46 * @see javax.crypto.KeyAgreement |
47 */ |
47 */ |
48 final class DHPublicKey implements PublicKey, |
48 final class DHPublicKey implements PublicKey, |
49 javax.crypto.interfaces.DHPublicKey, Serializable { |
49 javax.crypto.interfaces.DHPublicKey, Serializable { |
50 |
50 |
51 static final long serialVersionUID = 7647557958927458271L; |
51 static final long serialVersionUID = 7647557958927458271L; |
256 return new DHParameterSpec(this.p, this.g); |
256 return new DHParameterSpec(this.p, this.g); |
257 } |
257 } |
258 } |
258 } |
259 |
259 |
260 public String toString() { |
260 public String toString() { |
261 String LINE_SEP = System.getProperty("line.separator"); |
261 String LINE_SEP = System.lineSeparator(); |
262 |
262 |
263 StringBuilder sb |
263 StringBuilder sb |
264 = new StringBuilder("SunJCE Diffie-Hellman Public Key:" |
264 = new StringBuilder("SunJCE Diffie-Hellman Public Key:" |
265 + LINE_SEP + "y:" + LINE_SEP |
265 + LINE_SEP + "y:" + LINE_SEP |
266 + Debug.toHexString(this.y) |
266 + Debug.toHexString(this.y) |