public interface NonceGenerator
Modifier and Type | Method and Description |
---|---|
String |
createNonce(Repository db,
long timestamp) |
PushCertificate.NonceStatus |
verify(String received,
String sent,
Repository db,
boolean allowSlop,
int slop) |
String createNonce(Repository db, long timestamp) throws IllegalStateException
db
- 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
- The current time in seconds.IllegalStateException
PushCertificate.NonceStatus verify(String received, String sent, Repository db, boolean allowSlop, int slop)
received
- The nonce which was received from the serversent
- The nonce which was originally sent out to the client.db
- 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
- If the receiving backend is 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 toslop
- If `allowSlop` is true, this specifies the number of seconds
which we allow as slop.Copyright © 2016 Eclipse JGit Project. All rights reserved.