Top Description Methods
org.eclipse.jgit.transport

public Interface NonceGenerator

Known Direct Implementers
org.eclipse.jgit.transport.HMACSHA1NonceGenerator
Imports
org.eclipse.jgit.lib.Repository, org.eclipse.jgit.transport.PushCertificate.NonceStatus

A NonceGenerator is used to create a nonce to be sent out to the pusher who will sign the nonce to prove it is not a replay attack on the push certificate.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The nonce to be signed by the pusher
createNonce
(Repository
The repository which should be used to obtain a unique String such that the pusher cannot forge nonces by pushing to another repository at the same time as well and reusing the nonce.
db
,
long
The current time in seconds.
timestamp
)

Create nonce to be signed by the pusher

public PushCertificate.NonceStatus

Returns:

a NonceStatus indicating the trustworthiness of the received nonce.
verify
(String
The nonce which was received from the server
received
,
String
The nonce which was originally sent out to the client.
sent
,
Repository
The repository which should be used to obtain a unique String such that the pusher cannot forge nonces by pushing to another repository at the same time as well and reusing the nonce.
db
,
boolean
If the receiving backend is able to generate slop. This is the case for serving via http protocol using more than one http frontend. The client would talk to different http frontends, which may have a slight difference of time due to
allowSlop
,
int
If `allowSlop` is true, this specifies the number of seconds which we allow as slop.
slop
)

Verify trustworthiness of the received nonce.

Method Detail

createNonceback to summary
public String createNonce(Repository db, long timestamp)

Create nonce to be signed by the pusher

Parameters
db:Repository

The repository which should be used to obtain a unique String such that the pusher cannot forge nonces by pushing to another repository at the same time as well and reusing the nonce.

timestamp:long

The current time in seconds.

Returns:String

The nonce to be signed by the pusher

verifyback to summary
public PushCertificate.NonceStatus verify(String received, String sent, Repository db, boolean allowSlop, int slop)

Verify trustworthiness of the received nonce.

Parameters
received:String

The nonce which was received from the server

sent:String

The nonce which was originally sent out to the client.

db:Repository

The repository which should be used to obtain a unique String such that the pusher cannot forge nonces by pushing to another repository at the same time as well and reusing the nonce.

allowSlop:boolean

If the receiving backend is able to generate slop. This is the case for serving via http protocol using more than one http frontend. The client would talk to different http frontends, which may have a slight difference of time due to

slop:int

If `allowSlop` is true, this specifies the number of seconds which we allow as slop.

Returns:PushCertificate.NonceStatus

a NonceStatus indicating the trustworthiness of the received nonce.