Top Description Constructors Methods
org.eclipse.jgit.gpg.bc.internal

public Class BouncyCastleGpgSigner

extends Object
implements Signer
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.lib.Signer
Imports
java.io.ByteArrayOutputStream, .IOException, java.net.URISyntaxException, java.security.NoSuchAlgorithmException, .NoSuchProviderException, java.util.Iterator, org.bouncycastle.bcpg.ArmoredOutputStream, .BCPGOutputStream, .HashAlgorithmTags, org.bouncycastle.openpgp.PGPException, .PGPPrivateKey, .PGPPublicKey, .PGPSecretKey, .PGPSignature, .PGPSignatureGenerator, .PGPSignatureSubpacketGenerator, org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder, .JcePBESecretKeyDecryptorBuilder, org.eclipse.jgit.annotations.Nullable, org.eclipse.jgit.api.errors.CanceledException, .JGitInternalException, .UnsupportedSigningFormatException, org.eclipse.jgit.errors.UnsupportedCredentialItem, org.eclipse.jgit.lib.GpgConfig, .GpgSignature, .PersonIdent, .Repository, .Signer, org.eclipse.jgit.transport.CredentialsProvider, org.eclipse.jgit.util.StringUtils

GPG Signer using the BouncyCastle library.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canLocateSigningKey(Repository
the current Repository
repository
,
GpgConfig
GPG settings from the git config
config
,
PersonIdent
the signing identity (to help with key lookup in case signing key is not specified)
committer
,
String
if non-null overrides the signing key from the config
signingKey
,
CredentialsProvider
provider to use when querying for signing key credentials (eg. passphrase)
credentialsProvider
)

Implements org.eclipse.jgit.lib.Signer.canLocateSigningKey.

Indicates if a signing key is available for the specified committer and/or signing key.

pack-priv static String
private BouncyCastleGpgKey
locateSigningKey(String gpgSigningKey, PersonIdent committer, BouncyCastleGpgKeyPassphrasePrompt passphrasePrompt)

public GpgSignature
sign(Repository
Repository the signature is created in
repository
,
GpgConfig
GPG settings from the git config
config
,
byte[]
the data to sign
data
,
PersonIdent
the signing identity (to help with key lookup in case signing key is not specified)
committer
,
String
if non-null overrides the signing key from the config
signingKey
,
CredentialsProvider
provider to use when querying for signing key credentials (eg. passphrase)
credentialsProvider
)

Implements org.eclipse.jgit.lib.Signer.sign.

Signs arbitrary data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BouncyCastleGpgSignerback to summary
public BouncyCastleGpgSigner()

Method Detail

canLocateSigningKeyback to summary
public boolean canLocateSigningKey(Repository repository, GpgConfig config, PersonIdent committer, String signingKey, CredentialsProvider credentialsProvider) throws CanceledException

Implements org.eclipse.jgit.lib.Signer.canLocateSigningKey.

Doc from org.eclipse.jgit.lib.Signer.canLocateSigningKey.

Indicates if a signing key is available for the specified committer and/or signing key.

Parameters
repository:Repository

the current Repository

config:GpgConfig

GPG settings from the git config

committer:PersonIdent

the signing identity (to help with key lookup in case signing key is not specified)

signingKey:String

if non-null overrides the signing key from the config

credentialsProvider:CredentialsProvider

provider to use when querying for signing key credentials (eg. passphrase)

Returns:boolean

true if a signing key is available, false otherwise

Annotations
@Override
Exceptions
CanceledException:
when signing was canceled (eg., user aborted when entering passphrase)
extractSignerIdback to summary
pack-priv static String extractSignerId(String pgpUserId)
locateSigningKeyback to summary
private BouncyCastleGpgKey locateSigningKey(String gpgSigningKey, PersonIdent committer, BouncyCastleGpgKeyPassphrasePrompt passphrasePrompt) throws CanceledException, UnsupportedCredentialItem, IOException, NoSuchAlgorithmException, NoSuchProviderException, PGPException, URISyntaxException
signback to summary
public GpgSignature sign(Repository repository, GpgConfig config, byte[] data, PersonIdent committer, String signingKey, CredentialsProvider credentialsProvider) throws CanceledException, IOException, UnsupportedSigningFormatException

Implements org.eclipse.jgit.lib.Signer.sign.

Doc from org.eclipse.jgit.lib.Signer.sign.

Signs arbitrary data.

Parameters
repository:Repository

Repository the signature is created in

config:GpgConfig

GPG settings from the git config

data:byte[]

the data to sign

committer:PersonIdent

the signing identity (to help with key lookup in case signing key is not specified)

signingKey:String

if non-null overrides the signing key from the config

credentialsProvider:CredentialsProvider

provider to use when querying for signing key credentials (eg. passphrase)

Returns:GpgSignature

the signature for data

Annotations
@Override
Exceptions
CanceledException:
when signing was canceled (eg., user aborted when entering passphrase)
IOException:
if an I/O error occurs
UnsupportedSigningFormatException:
if a config is given and the wanted key format is not supported