Top Description Inners Fields Constructors Methods
org.eclipse.jgit.transport

public Class PushCertificate

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.transport.PushCertificateParser.NONCE, .PushCertificateParser.PUSHEE, .PushCertificateParser.PUSHER, .PushCertificateParser.VERSION

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 and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PushCertificate.NonceStatus

Verification result of the nonce returned during push.

Field Summary

Modifier and TypeField and Description
private final List<ReceiveCommand>
private final String
private final PushCertificate.NonceStatus
private final String
private final PushCertificateIdent
private final String
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
PushCertificate(String version, PushCertificateIdent pusher, String pushee, String nonce, PushCertificate.NonceStatus nonceStatus, List<ReceiveCommand> commands, String signature)

Method Summary

Modifier and TypeMethod and Description
private static boolean
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public List<ReceiveCommand>

Returns:

the list of commands as one string to be feed into the signature verifier.
getCommands
()

Get the list of commands as one string to be feed into the signature verifier.

public String

Returns:

the raw nonce value that was presented by the pusher.
getNonce
()

Get the raw nonce value that was presented by the pusher.

public PushCertificate.NonceStatus

Returns:

verification status of the nonce embedded in the certificate.
getNonceStatus
()

Get verification status of the nonce embedded in the certificate.

public String

Returns:

URL of the repository the push was originally sent to.
getPushee
()

Get URL of the repository the push was originally sent to.

public String

Returns:

the raw line that signed the cert, as a string.
getPusher
()

Get the raw line that signed the cert, as a string.

public PushCertificateIdent

Returns:

identity of the pusher who signed the cert.
getPusherIdent
()

Get identity of the pusher who signed the cert.

public String

Returns:

the raw signature, consisting of the lines received between the lines "----BEGIN GPG SIGNATURE-----\n" and "----END GPG SIGNATURE-----\n", inclusive.
getSignature
()

Get the raw signature

public String

Returns:

the certificate version string.
getVersion
()

Get the certificate version string.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private StringBuilder
public String

Returns:

text payload of the certificate for the signature verifier.
toText
()

Get text payload of the certificate for the signature verifier.

public String

Returns:

original text payload plus signature; the final output will be valid as input to org.eclipse.jgit.transport.PushCertificateParser#fromString(String).
toTextWithSignature
()

Get original text payload plus signature

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

commandsback to summary
private final List<ReceiveCommand> commands
nonceback to summary
private final String nonce
nonceStatusback to summary
private final PushCertificate.NonceStatus nonceStatus
pusheeback to summary
private final String pushee
pusherback to summary
private final PushCertificateIdent pusher
signatureback to summary
private final String signature
versionback to summary
private final String version

Constructor Detail

PushCertificateback to summary
pack-priv PushCertificate(String version, PushCertificateIdent pusher, String pushee, String nonce, PushCertificate.NonceStatus nonceStatus, List<ReceiveCommand> commands, String signature)

Method Detail

commandsEqualback to summary
private static boolean commandsEqual(PushCertificate c1, PushCertificate c2)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCommandsback to summary
public List<ReceiveCommand> getCommands()

Get the list of commands as one string to be feed into the signature verifier.

Returns:List<ReceiveCommand>

the list of commands as one string to be feed into the signature verifier.

Since
4.1
getNonceback to summary
public String getNonce()

Get the raw nonce value that was presented by the pusher.

Returns:String

the raw nonce value that was presented by the pusher.

Since
4.1
getNonceStatusback to summary
public PushCertificate.NonceStatus getNonceStatus()

Get verification status of the nonce embedded in the certificate.

Returns:PushCertificate.NonceStatus

verification status of the nonce embedded in the certificate.

Since
4.0
getPusheeback to summary
public String getPushee()

Get URL of the repository the push was originally sent to.

Returns:String

URL of the repository the push was originally sent to.

Since
4.0
getPusherback to summary
public String getPusher()

Get the raw line that signed the cert, as a string.

Returns:String

the raw line that signed the cert, as a string.

Since
4.0
getPusherIdentback to summary
public PushCertificateIdent getPusherIdent()

Get identity of the pusher who signed the cert.

Returns:PushCertificateIdent

identity of the pusher who signed the cert.

Since
4.1
getSignatureback to summary
public String getSignature()

Get the raw signature

Returns:String

the raw signature, consisting of the lines received between the lines "----BEGIN GPG SIGNATURE-----\n" and "----END GPG SIGNATURE-----\n", inclusive.

Since
4.0
getVersionback to summary
public String getVersion()

Get the certificate version string.

Returns:String

the certificate version string.

Since
4.1
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toStringBuilderback to summary
private StringBuilder toStringBuilder()
toTextback to summary
public String toText()

Get text payload of the certificate for the signature verifier.

Returns:String

text payload of the certificate for the signature verifier.

Since
4.1
toTextWithSignatureback to summary
public String toTextWithSignature()

Get original text payload plus signature

Returns:String

original text payload plus signature; the final output will be valid as input to org.eclipse.jgit.transport.PushCertificateParser#fromString(String).

Since
4.1
org.eclipse.jgit.transport back to summary

public final Enum PushCertificate.NonceStatus

extends Enum<PushCertificate.NonceStatus>
Class Inheritance

Verification result of the nonce returned during push.

Field Summary

Modifier and TypeField and Description
public static final PushCertificate.NonceStatus
BAD

Nonce is invalid and did not match server's expectations.

public static final PushCertificate.NonceStatus
MISSING

Nonce is required, but was not sent by client.

public static final PushCertificate.NonceStatus
OK

Received nonce matches sent nonce, or is valid within the accepted slop window.

public static final PushCertificate.NonceStatus
SLOP

Received nonce is valid, but outside the accepted slop window.

public static final PushCertificate.NonceStatus
UNSOLICITED

Nonce was not expected, yet client sent one anyway.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PushCertificate.NonceStatus
public static PushCertificate.NonceStatus[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BADback to summary
public static final PushCertificate.NonceStatus BAD

Nonce is invalid and did not match server's expectations.

MISSINGback to summary
public static final PushCertificate.NonceStatus MISSING

Nonce is required, but was not sent by client.

OKback to summary
public static final PushCertificate.NonceStatus OK

Received nonce matches sent nonce, or is valid within the accepted slop window.

SLOPback to summary
public static final PushCertificate.NonceStatus SLOP

Received nonce is valid, but outside the accepted slop window.

UNSOLICITEDback to summary
public static final PushCertificate.NonceStatus UNSOLICITED

Nonce was not expected, yet client sent one anyway.

Constructor Detail

NonceStatusback to summary
private NonceStatus()

Method Detail

valueOfback to summary
public static PushCertificate.NonceStatus valueOf(String name)
valuesback to summary
public static PushCertificate.NonceStatus[] values()