Package org.eclipse.jgit.lib
Class GpgConfig
- java.lang.Object
-
- org.eclipse.jgit.lib.GpgConfig
-
public class GpgConfig extends java.lang.Object
Typed access to GPG related configuration options.- Since:
- 5.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GpgConfig.GpgFormat
Config values for gpg.format.
-
Field Summary
Fields Modifier and Type Field Description private boolean
forceAnnotated
private GpgConfig.GpgFormat
keyFormat
private java.lang.String
program
private boolean
signAllTags
private boolean
signCommits
private java.lang.String
signingKey
-
Constructor Summary
Constructors Constructor Description GpgConfig(java.lang.String keySpec, GpgConfig.GpgFormat format, java.lang.String gpgProgram)
Create aGpgConfig
with the given parameters and defaulttrue
for signing commits andfalse
for tags.GpgConfig(Config config)
Create a new GPG config that reads the configuration from config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GpgConfig.GpgFormat
getKeyFormat()
Retrieves the config value of gpg.format.java.lang.String
getProgram()
Retrieves the value of the configured GPG program to use, as defined by gpg.openpgp.program, gpg.x509.program (depending on the definedformat
), or gpg.program.java.lang.String
getSigningKey()
Retrieves the config value of user.signingKey.boolean
isSignAllTags()
Retrieves the value of git configtag.gpgSign
.boolean
isSignAnnotated()
Retrieves the value of git configtag.forceSignAnnotated
.boolean
isSignCommits()
Retrieves the config value of commit.gpgSign.
-
-
-
Field Detail
-
keyFormat
private final GpgConfig.GpgFormat keyFormat
-
signingKey
private final java.lang.String signingKey
-
program
private final java.lang.String program
-
signCommits
private final boolean signCommits
-
signAllTags
private final boolean signAllTags
-
forceAnnotated
private final boolean forceAnnotated
-
-
Constructor Detail
-
GpgConfig
public GpgConfig(java.lang.String keySpec, GpgConfig.GpgFormat format, java.lang.String gpgProgram)
Create aGpgConfig
with the given parameters and defaulttrue
for signing commits andfalse
for tags.- Parameters:
keySpec
- to useformat
- to usegpgProgram
- to use- Since:
- 5.11
-
GpgConfig
public GpgConfig(Config config)
Create a new GPG config that reads the configuration from config.- Parameters:
config
- the config to read from
-
-
Method Detail
-
getKeyFormat
public GpgConfig.GpgFormat getKeyFormat()
Retrieves the config value of gpg.format.- Returns:
- the
GpgConfig.GpgFormat
-
getProgram
public java.lang.String getProgram()
Retrieves the value of the configured GPG program to use, as defined by gpg.openpgp.program, gpg.x509.program (depending on the definedformat
), or gpg.program.- Returns:
- the program string configured, or
null
if none - Since:
- 5.11
-
getSigningKey
public java.lang.String getSigningKey()
Retrieves the config value of user.signingKey.- Returns:
- the value of user.signingKey (may be
null
)
-
isSignCommits
public boolean isSignCommits()
Retrieves the config value of commit.gpgSign.- Returns:
- the value of commit.gpgSign (defaults to
false
)
-
isSignAllTags
public boolean isSignAllTags()
Retrieves the value of git configtag.gpgSign
.- Returns:
- the value of
tag.gpgSign
; by defaultfalse
- Since:
- 5.11
-
isSignAnnotated
public boolean isSignAnnotated()
Retrieves the value of git configtag.forceSignAnnotated
.- Returns:
- the value of
tag.forceSignAnnotated
; by defaultfalse
- Since:
- 5.11
-
-