mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +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() {
|
||||
StringBuffer b = new StringBuffer();
|
||||
b.append("pub:").append(Utils.bytesToHexString(pub));
|
||||
if (priv != null) {
|
||||
b.append(" priv:").append(Utils.bytesToHexString(priv.toByteArray()));
|
||||
}
|
||||
if (creationTimeSeconds != 0) {
|
||||
b.append(" timestamp:" + creationTimeSeconds);
|
||||
}
|
||||
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
|
||||
* the RIPEMD-160 hash of the public key and is not the public key itself (which is too large to be convenient).
|
||||
|
Loading…
Reference in New Issue
Block a user