Package org.eclipse.jgit.transport
Class PushCertificate
- java.lang.Object
-
- org.eclipse.jgit.transport.PushCertificate
-
public class PushCertificate extends java.lang.ObjectThe 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 classPushCertificate.NonceStatusVerification result of the nonce returned during push.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ReceiveCommand>commandsprivate java.lang.Stringnonceprivate PushCertificate.NonceStatusnonceStatusprivate java.lang.Stringpusheeprivate PushCertificateIdentpusherprivate java.lang.Stringsignatureprivate java.lang.Stringversion
-
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 booleancommandsEqual(PushCertificate c1, PushCertificate c2)booleanequals(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.StringgetNonce()Get the raw nonce value that was presented by the pusher.PushCertificate.NonceStatusgetNonceStatus()Get verification status of the nonce embedded in the certificate.java.lang.StringgetPushee()Get URL of the repository the push was originally sent to.java.lang.StringgetPusher()Get the raw line that signed the cert, as a string.PushCertificateIdentgetPusherIdent()Get identity of the pusher who signed the cert.java.lang.StringgetSignature()Get the raw signaturejava.lang.StringgetVersion()Get the certificate version string.inthashCode()java.lang.StringtoString()private java.lang.StringBuildertoStringBuilder()java.lang.StringtoText()Get text payload of the certificate for the signature verifier.java.lang.StringtoTextWithSignature()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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
commandsEqual
private static boolean commandsEqual(PushCertificate c1, PushCertificate c2)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-