public class HMACSHA1NonceGenerator extends Object implements NonceGenerator
Constructor and Description |
---|
HMACSHA1NonceGenerator(String seed)
Constructor for HMACSHA1NonceGenerator.
|
Modifier and Type | Method and Description |
---|---|
String |
createNonce(Repository repo,
long timestamp)
Create nonce to be signed by the pusher
|
PushCertificate.NonceStatus |
verify(String received,
String sent,
Repository db,
boolean allowSlop,
int slop)
Verify trustworthiness of the received nonce.
|
public HMACSHA1NonceGenerator(String seed) throws IllegalStateException
seed
- seed the generatorIllegalStateException
public String createNonce(Repository repo, long timestamp) throws IllegalStateException
createNonce
in interface NonceGenerator
repo
- 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
public PushCertificate.NonceStatus verify(String received, String sent, Repository db, boolean allowSlop, int slop)
verify
in interface NonceGenerator
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 © 2018 Eclipse JGit Project. All rights reserved.