Package org.eclipse.jgit.transport
Class SignedPushConfig
java.lang.Object
org.eclipse.jgit.transport.SignedPushConfig
Configuration for server-side signed push verification.
- Since:
- 4.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private int
static final Config.SectionParser<SignedPushConfig>
Key forConfig.get(SectionParser)
.private NonceGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new config with default values disabling push verification.SignedPushConfig
(Config cfg) -
Method Summary
Modifier and TypeMethodDescriptionGet the configured seed.int
Get the configured nonce slop limit.Get theNonceGenerator
used for signed pushes.void
setCertNonceSeed
(String seed) Set the seed used by the nonce verifier.void
setCertNonceSlopLimit
(int limit) Set the nonce slop limit.void
setNonceGenerator
(NonceGenerator generator) Set theNonceGenerator
used for signed pushes.
-
Field Details
-
KEY
Key forConfig.get(SectionParser)
. -
certNonceSeed
-
certNonceSlopLimit
private int certNonceSlopLimit -
nonceGenerator
-
-
Constructor Details
-
SignedPushConfig
public SignedPushConfig()Create a new config with default values disabling push verification. -
SignedPushConfig
SignedPushConfig(Config cfg)
-
-
Method Details
-
setCertNonceSeed
Set the seed used by the nonce verifier.Setting this to a non-null value enables push certificate verification using the default
HMACSHA1NonceGenerator
implementation, if a different implementation was not set usingsetNonceGenerator(NonceGenerator)
.- Parameters:
seed
- new seed value.
-
getCertNonceSeed
Get the configured seed.- Returns:
- the configured seed.
-
setCertNonceSlopLimit
public void setCertNonceSlopLimit(int limit) Set the nonce slop limit.Old but valid nonces within this limit will be accepted.
- Parameters:
limit
- new limit in seconds.
-
getCertNonceSlopLimit
public int getCertNonceSlopLimit()Get the configured nonce slop limit.- Returns:
- the configured nonce slop limit.
-
setNonceGenerator
Set theNonceGenerator
used for signed pushes.Setting this to a non-null value enables push certificate verification. If this method is called, this implementation will be used instead of the default
HMACSHA1NonceGenerator
even ifsetCertNonceSeed(String)
was called.- Parameters:
generator
- new nonce generator.
-
getNonceGenerator
Get theNonceGenerator
used for signed pushes.If
setNonceGenerator(NonceGenerator)
was used to set a non-null implementation, that will be returned. If no custom implementation was set butsetCertNonceSeed(String)
was called, returns a newly-createdHMACSHA1NonceGenerator
.- Returns:
- the configured nonce generator.
-