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

public Class BouncyCastleGpgSignatureVerifier

extends Object
implements SignatureVerifier
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.lib.SignatureVerifier
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.text.MessageFormat, java.time.Instant, java.util.Date, .List, .Locale, org.bouncycastle.bcpg.sig.IssuerFingerprint, org.bouncycastle.openpgp.PGPCompressedData, .PGPException, .PGPPublicKey, .PGPSignature, .PGPSignatureList, .PGPSignatureSubpacketVector, .PGPUtil, org.bouncycastle.openpgp.jcajce.JcaPGPObjectFactory, org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider, org.bouncycastle.util.encoders.Hex, org.eclipse.jgit.api.errors.JGitInternalException, org.eclipse.jgit.lib.GpgConfig, .Repository, .SignatureVerifier, org.eclipse.jgit.util.LRUMap, .StringUtils

A SignatureVerifier to verify GPG signatures using BouncyCastle.

Field Summary

Modifier and TypeField and Description
private LRUMap<String, Object>
private LRUMap<String, Object>
private static final String
private static final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.eclipse.jgit.lib.SignatureVerifier.clear.

A SignatureVerifier may cache public keys to speed up verifying signatures on multiple objects.

public String
getName()

Implements org.eclipse.jgit.lib.SignatureVerifier.getName.

Retrieves the name of this verifier.

private SignatureVerifier.TrustLevel
parseGpgTrustPacket(byte[] packet)

pack-priv static PGPSignature
public SignatureVerifier.SignatureVerification
verify(Repository
the Repository the data comes from.
repository
,
GpgConfig config, byte[]
the signature is for
data
,
byte[]
the ASCII-armored signature
signatureData
)

Implements org.eclipse.jgit.lib.SignatureVerifier.verify.

Verifies a given signature for given data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byFingerprintback to summary
private LRUMap<String, Object> byFingerprint
bySignerback to summary
private LRUMap<String, Object> bySigner
NAMEback to summary
private static final String NAME
NO_KEYback to summary
private static final Object NO_KEY

Constructor Detail

BouncyCastleGpgSignatureVerifierback to summary
public BouncyCastleGpgSignatureVerifier()

Method Detail

clearback to summary
public void clear()

Implements org.eclipse.jgit.lib.SignatureVerifier.clear.

Doc from org.eclipse.jgit.lib.SignatureVerifier.clear.

A SignatureVerifier may cache public keys to speed up verifying signatures on multiple objects. This clears this cache, if any.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.eclipse.jgit.lib.SignatureVerifier.getName.

Doc from org.eclipse.jgit.lib.SignatureVerifier.getName.

Retrieves the name of this verifier. This should be a short string identifying the engine that verified the signature, like "gpg" if GPG is used, or "bc" for a BouncyCastle implementation.

Returns:String

the name

Annotations
@Override
parseGpgTrustPacketback to summary
private SignatureVerifier.TrustLevel parseGpgTrustPacket(byte[] packet)
parseSignatureback to summary
pack-priv static PGPSignature parseSignature(InputStream in) throws IOException, PGPException
verifyback to summary
public SignatureVerifier.SignatureVerification verify(Repository repository, GpgConfig config, byte[] data, byte[] signatureData) throws IOException

Implements org.eclipse.jgit.lib.SignatureVerifier.verify.

Doc from org.eclipse.jgit.lib.SignatureVerifier.verify.

Verifies a given signature for given data.

Parameters
repository:Repository

the Repository the data comes from.

config:GpgConfig

the GpgConfig

data:byte[]

the signature is for

signatureData:byte[]

the ASCII-armored signature

Returns:SignatureVerifier.SignatureVerification

a SignatureVerification describing the outcome

Annotations
@Override
Exceptions
IOException:
if the signature cannot be parsed