|
|
|
@ -203,6 +203,19 @@ public class PushCertificate {
|
|
|
|
|
* @since 4.1 |
|
|
|
|
*/ |
|
|
|
|
public String toText() { |
|
|
|
|
return toStringBuilder().toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return original text payload plus signature; the final output will be |
|
|
|
|
* valid as input to {@link PushCertificateParser#fromString(String)}. |
|
|
|
|
* @since 4.1 |
|
|
|
|
*/ |
|
|
|
|
public String toTextWithSignature() { |
|
|
|
|
return toStringBuilder().append(signature).toString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private StringBuilder toStringBuilder() { |
|
|
|
|
StringBuilder sb = new StringBuilder() |
|
|
|
|
.append(VERSION).append(' ').append(version).append('\n') |
|
|
|
|
.append(PUSHER).append(' ').append(getPusher()) |
|
|
|
@ -215,7 +228,7 @@ public class PushCertificate {
|
|
|
|
|
.append(' ').append(cmd.getNewId().name()) |
|
|
|
|
.append(' ').append(cmd.getRefName()).append('\n'); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
return sb; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -256,6 +269,6 @@ public class PushCertificate {
|
|
|
|
|
@Override |
|
|
|
|
public String toString() { |
|
|
|
|
return getClass().getSimpleName() + '[' |
|
|
|
|
+ toText() + signature + ']'; |
|
|
|
|
+ toTextWithSignature() + ']'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|