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 Type
    Method
    Description
    Obtains 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.
    boolean
    isRevoked(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.GpgConfig config, PublicKey key)
    Determines whether the gives key has been revoked.
    Sets the global SigningKeyDatabase.
  • Method Details

    • getInstance

      static SigningKeyDatabase getInstance()
      Obtains the current global instance.
      Returns:
      the global SigningKeyDatabase
    • setInstance

      static SigningKeyDatabase setInstance(SigningKeyDatabase database)
      Sets the global SigningKeyDatabase.
      Parameters:
      database - to set; if null a 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 - 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

      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 - 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