Module org.eclipse.jgit.ssh.apache
Class OpenSshSigningKeyDatabase
java.lang.Object
org.eclipse.jgit.internal.signing.ssh.OpenSshSigningKeyDatabase
- All Implemented Interfaces:
CachingSigningKeyDatabase,SigningKeyDatabase
A
CachingSigningKeyDatabase using the OpenSSH allowed signers file
and the OpenSSH key revocation list.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDiscards any cached data.intRetrieves the current cache size.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.voidsetCacheSize(int size) Sets the cache size to use.
-
Constructor Details
-
OpenSshSigningKeyDatabase
public OpenSshSigningKeyDatabase()
-
-
Method Details
-
isRevoked
public boolean isRevoked(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key) throws IOException Description copied from interface:SigningKeyDatabaseDetermines whether the gives key has been revoked.- Specified by:
isRevokedin interfaceSigningKeyDatabase- 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
public String isAllowed(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key, String namespace, org.eclipse.jgit.lib.PersonIdent ident) throws IOException, VerificationException Description copied from interface:SigningKeyDatabaseChecks whether the given key is allowed to be used for signing, and if allowed returns the principal.- Specified by:
isAllowedin interfaceSigningKeyDatabase- 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
-
getCacheSize
public int getCacheSize()Description copied from interface:CachingSigningKeyDatabaseRetrieves the current cache size.- Specified by:
getCacheSizein interfaceCachingSigningKeyDatabase- Returns:
- the cache size, or -1 if this database has no cache.
-
setCacheSize
public void setCacheSize(int size) Description copied from interface:CachingSigningKeyDatabaseSets the cache size to use.- Specified by:
setCacheSizein interfaceCachingSigningKeyDatabase- Parameters:
size- the cache size, ignored if this database does not have a cache.
-
clearCache
public void clearCache()Description copied from interface:CachingSigningKeyDatabaseDiscards any cached data. A no-op if the database has no cache.- Specified by:
clearCachein interfaceCachingSigningKeyDatabase
-