Data: SPK log tweaks

This commit is contained in:
zzz
2018-10-13 10:35:30 +00:00
parent 0a99784221
commit 4c970fa0aa
2 changed files with 7 additions and 4 deletions

View File

@ -94,14 +94,14 @@ public class SigningPrivateKey extends SimpleDataStructure {
@Override
public String toString() {
StringBuilder buf = new StringBuilder(64);
buf.append('[').append(getClass().getSimpleName()).append(' ').append(_type).append(": ");
buf.append("[SigningPrivateKey ").append(_type).append(": ");
int length = length();
if (_data == null) {
buf.append("null");
} else if (length <= 32) {
buf.append(toBase64());
} else {
buf.append("size: ").append(Integer.toString(length));
buf.append("size: ").append(length);
}
buf.append(']');
return buf.toString();

View File

@ -202,11 +202,14 @@ public class SigningPublicKey extends SimpleDataStructure {
@Override
public String toString() {
StringBuilder buf = new StringBuilder(64);
buf.append('[').append(getClass().getSimpleName()).append(' ').append(_type).append(": ");
buf.append("[SigningPublicKey ").append((_type != null) ? _type.toString() : "unknown type").append(' ');
int length = length();
if (_data == null) {
buf.append("null");
} else if (length <= 32) {
buf.append(toBase64());
} else {
buf.append("size: ").append(Integer.toString(length()));
buf.append("size: ").append(length);
}
buf.append(']');
return buf.toString();