Package org.eclipse.jgit.transport
Class PushCertificate
- java.lang.Object
-
- org.eclipse.jgit.transport.PushCertificate
-
public class PushCertificate extends java.lang.Object
The required information to verify the push.A valid certificate will not return null from any getter methods; callers may assume that any null value indicates a missing or invalid certificate.
- Since:
- 4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PushCertificate.NonceStatus
Verification result of the nonce returned during push.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ReceiveCommand>
commands
private java.lang.String
nonce
private PushCertificate.NonceStatus
nonceStatus
private java.lang.String
pushee
private PushCertificateIdent
pusher
private java.lang.String
signature
private java.lang.String
version
-
Constructor Summary
Constructors Constructor Description PushCertificate(java.lang.String version, PushCertificateIdent pusher, java.lang.String pushee, java.lang.String nonce, PushCertificate.NonceStatus nonceStatus, java.util.List<ReceiveCommand> commands, java.lang.String signature)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
commandsEqual(PushCertificate c1, PushCertificate c2)
boolean
equals(java.lang.Object o)
java.util.List<ReceiveCommand>
getCommands()
Get the list of commands as one string to be feed into the signature verifier.java.lang.String
getNonce()
Get the raw nonce value that was presented by the pusher.PushCertificate.NonceStatus
getNonceStatus()
Get verification status of the nonce embedded in the certificate.java.lang.String
getPushee()
Get URL of the repository the push was originally sent to.java.lang.String
getPusher()
Get the raw line that signed the cert, as a string.PushCertificateIdent
getPusherIdent()
Get identity of the pusher who signed the cert.java.lang.String
getSignature()
Get the raw signaturejava.lang.String
getVersion()
Get the certificate version string.int
hashCode()
java.lang.String
toString()
private java.lang.StringBuilder
toStringBuilder()
java.lang.String
toText()
Get text payload of the certificate for the signature verifier.java.lang.String
toTextWithSignature()
Get original text payload plus signature
-
-
-
Field Detail
-
version
private final java.lang.String version
-
pusher
private final PushCertificateIdent pusher
-
pushee
private final java.lang.String pushee
-
nonce
private final java.lang.String nonce
-
nonceStatus
private final PushCertificate.NonceStatus nonceStatus
-
commands
private final java.util.List<ReceiveCommand> commands
-
signature
private final java.lang.String signature
-
-
Constructor Detail
-
PushCertificate
PushCertificate(java.lang.String version, PushCertificateIdent pusher, java.lang.String pushee, java.lang.String nonce, PushCertificate.NonceStatus nonceStatus, java.util.List<ReceiveCommand> commands, java.lang.String signature)
-
-
Method Detail
-
getVersion
public java.lang.String getVersion()
Get the certificate version string.- Returns:
- the certificate version string.
- Since:
- 4.1
-
getPusher
public java.lang.String getPusher()
Get the raw line that signed the cert, as a string.- Returns:
- the raw line that signed the cert, as a string.
- Since:
- 4.0
-
getPusherIdent
public PushCertificateIdent getPusherIdent()
Get identity of the pusher who signed the cert.- Returns:
- identity of the pusher who signed the cert.
- Since:
- 4.1
-
getPushee
public java.lang.String getPushee()
Get URL of the repository the push was originally sent to.- Returns:
- URL of the repository the push was originally sent to.
- Since:
- 4.0
-
getNonce
public java.lang.String getNonce()
Get the raw nonce value that was presented by the pusher.- Returns:
- the raw nonce value that was presented by the pusher.
- Since:
- 4.1
-
getNonceStatus
public PushCertificate.NonceStatus getNonceStatus()
Get verification status of the nonce embedded in the certificate.- Returns:
- verification status of the nonce embedded in the certificate.
- Since:
- 4.0
-
getCommands
public java.util.List<ReceiveCommand> getCommands()
Get the list of commands as one string to be feed into the signature verifier.- Returns:
- the list of commands as one string to be feed into the signature verifier.
- Since:
- 4.1
-
getSignature
public java.lang.String getSignature()
Get the raw signature- Returns:
- the raw signature, consisting of the lines received between the
lines
"----BEGIN GPG SIGNATURE-----\n"
and"----END GPG SIGNATURE-----\n
", inclusive. - Since:
- 4.0
-
toText
public java.lang.String toText()
Get text payload of the certificate for the signature verifier.- Returns:
- text payload of the certificate for the signature verifier.
- Since:
- 4.1
-
toTextWithSignature
public java.lang.String toTextWithSignature()
Get original text payload plus signature- Returns:
- original text payload plus signature; the final output will be
valid as input to
PushCertificateParser.fromString(String)
. - Since:
- 4.1
-
toStringBuilder
private java.lang.StringBuilder toStringBuilder()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
commandsEqual
private static boolean commandsEqual(PushCertificate c1, PushCertificate c2)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-