mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-13 02:35:52 +00:00
Remove private key from ECKey.toString and put it in toStringWithPrivate
This commit is contained in:
parent
812ca60b9b
commit
feb85a13d3
@ -181,15 +181,21 @@ public class ECKey implements Serializable {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer b = new StringBuffer();
|
StringBuffer b = new StringBuffer();
|
||||||
b.append("pub:").append(Utils.bytesToHexString(pub));
|
b.append("pub:").append(Utils.bytesToHexString(pub));
|
||||||
if (priv != null) {
|
|
||||||
b.append(" priv:").append(Utils.bytesToHexString(priv.toByteArray()));
|
|
||||||
}
|
|
||||||
if (creationTimeSeconds != 0) {
|
if (creationTimeSeconds != 0) {
|
||||||
b.append(" timestamp:" + creationTimeSeconds);
|
b.append(" timestamp:" + creationTimeSeconds);
|
||||||
}
|
}
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toStringWithPrivate() {
|
||||||
|
StringBuffer b = new StringBuffer();
|
||||||
|
b.append(toString());
|
||||||
|
if (priv != null) {
|
||||||
|
b.append(" priv:").append(Utils.bytesToHexString(priv.toByteArray()));
|
||||||
|
}
|
||||||
|
return b.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the address that corresponds to the public part of this ECKey. Note that an address is derived from
|
* Returns the address that corresponds to the public part of this ECKey. Note that an address is derived from
|
||||||
* the RIPEMD-160 hash of the public key and is not the public key itself (which is too large to be convenient).
|
* the RIPEMD-160 hash of the public key and is not the public key itself (which is too large to be convenient).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user