Module org.eclipse.jgit.ssh.apache
Package org.eclipse.jgit.signing.ssh
Interface SigningKeyDatabase
- All Known Subinterfaces:
CachingSigningKeyDatabase
- All Known Implementing Classes:
OpenSshSigningKeyDatabase
public interface SigningKeyDatabase
A database storing meta-information about signing keys and certificates.
- Since:
- 7.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic SigningKeyDatabaseObtains the current global instance.isAllowed(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key, String namespace, org.eclipse.jgit.lib.PersonIdent ident) Checks whether the given key is allowed to be used for signing, and if allowed returns the principal.booleanisRevoked(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key) Determines whether the gives key has been revoked.static SigningKeyDatabasesetInstance(SigningKeyDatabase database) Sets the globalSigningKeyDatabase.
-
Method Details
-
getInstance
Obtains the current global instance.- Returns:
- the global
SigningKeyDatabase
-
setInstance
Sets the globalSigningKeyDatabase.- Parameters:
database- to set; ifnulla default database using the OpenSSH allowed signers file and the OpenSSH revocation list mechanism is used.- Returns:
- the previously set
SigningKeyDatabase
-
isRevoked
boolean isRevoked(@NonNull org.eclipse.jgit.lib.Repository repository, @NonNull org.eclipse.jgit.lib.GpgConfig config, @NonNull PublicKey key) throws IOException Determines whether the gives key has been revoked.- Parameters:
repository-Repositorythe key is being used inconfig-GpgConfigto usekey-PublicKeyto check- Returns:
trueif the key has been revoked,falseotherwise- Throws:
IOException- if an I/O problem occurred
-
isAllowed
String isAllowed(@NonNull org.eclipse.jgit.lib.Repository repository, @NonNull org.eclipse.jgit.lib.GpgConfig config, @NonNull PublicKey key, @NonNull String namespace, org.eclipse.jgit.lib.PersonIdent ident) throws IOException, VerificationException Checks whether the given key is allowed to be used for signing, and if allowed returns the principal.- Parameters:
repository-Repositorythe key is being used inconfig-GpgConfigto usekey-PublicKeyto checknamespace- of the signatureident- optionalPersonIdentgiving a signer's e-mail address and a signature time- Returns:
nullif the database does not contain any information about the given key; the principal if it does and all checks passed- Throws:
IOException- if an I/O problem occurredVerificationException- if the database contains information about the key and the checks determined that the key is not allowed to be used for signing
-