Class OpenSshSigningKeyDatabase

java.lang.Object
org.eclipse.jgit.internal.signing.ssh.OpenSshSigningKeyDatabase
All Implemented Interfaces:
CachingSigningKeyDatabase, SigningKeyDatabase

public class OpenSshSigningKeyDatabase extends Object implements CachingSigningKeyDatabase
A CachingSigningKeyDatabase using the OpenSSH allowed signers file and the OpenSSH key revocation list.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Discards any cached data.
    int
    Retrieves 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.
    boolean
    isRevoked(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key)
    Determines whether the gives key has been revoked.
    void
    setCacheSize(int size)
    Sets the cache size to use.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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: SigningKeyDatabase
      Determines whether the gives key has been revoked.
      Specified by:
      isRevoked in interface SigningKeyDatabase
      Parameters:
      repository - Repository the key is being used in
      config - GpgConfig to use
      key - PublicKey to check
      Returns:
      true if the key has been revoked, false otherwise
      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: SigningKeyDatabase
      Checks whether the given key is allowed to be used for signing, and if allowed returns the principal.
      Specified by:
      isAllowed in interface SigningKeyDatabase
      Parameters:
      repository - Repository the key is being used in
      config - GpgConfig to use
      key - PublicKey to check
      namespace - of the signature
      ident - optional PersonIdent giving a signer's e-mail address and a signature time
      Returns:
      null if 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 occurred
      VerificationException - 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: CachingSigningKeyDatabase
      Retrieves the current cache size.
      Specified by:
      getCacheSize in interface CachingSigningKeyDatabase
      Returns:
      the cache size, or -1 if this database has no cache.
    • setCacheSize

      public void setCacheSize(int size)
      Description copied from interface: CachingSigningKeyDatabase
      Sets the cache size to use.
      Specified by:
      setCacheSize in interface CachingSigningKeyDatabase
      Parameters:
      size - the cache size, ignored if this database does not have a cache.
    • clearCache

      public void clearCache()
      Description copied from interface: CachingSigningKeyDatabase
      Discards any cached data. A no-op if the database has no cache.
      Specified by:
      clearCache in interface CachingSigningKeyDatabase