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

public Class HMACSHA1NonceGenerator

extends Object
implements NonceGenerator
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.NonceGenerator
Static Imports
java.nio.charset.StandardCharsets.ISO_8859_1, .StandardCharsets.UTF_8

The nonce generator which was first introduced to git-core.
Since
4.0

Field Summary

Modifier and TypeField and Description
private static final String
private Mac

Constructor Summary

AccessConstructor and Description
public
HMACSHA1NonceGenerator(String
seed the generator
seed
)

Constructor for HMACSHA1NonceGenerator.

Method Summary

Modifier and TypeMethod and Description
public synchronized String
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.
repo
,
long
The current time in seconds.
timestamp
)

Implements org.eclipse.jgit.transport.NonceGenerator.createNonce.

Create nonce to be signed by the pusher

private static String
toHex(byte[] bytes)

public PushCertificate.NonceStatus
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
)

Implements org.eclipse.jgit.transport.NonceGenerator.verify.

Verify trustworthiness of the received nonce.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HEXback to summary
private static final String HEX
macback to summary
private Mac mac

Constructor Detail

HMACSHA1NonceGeneratorback to summary
public HMACSHA1NonceGenerator(String seed)

Constructor for HMACSHA1NonceGenerator.

Parameters
seed:String

seed the generator

Method Detail

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

Implements org.eclipse.jgit.transport.NonceGenerator.createNonce.

Doc from org.eclipse.jgit.transport.NonceGenerator.createNonce.

Create nonce to be signed by the pusher

Parameters
repo: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

Annotations
@Override
toHexback to summary
private static String toHex(byte[] bytes)
verifyback to summary
public PushCertificate.NonceStatus verify(String received, String sent, Repository db, boolean allowSlop, int slop)

Implements org.eclipse.jgit.transport.NonceGenerator.verify.

Doc from org.eclipse.jgit.transport.NonceGenerator.verify.

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.

Annotations
@Override