Class CachedPasswordProvider

java.lang.Object
ghidra.formats.gfilesystem.crypto.CachedPasswordProvider
All Implemented Interfaces:
CryptoProvider, PasswordProvider

public class CachedPasswordProvider extends Object implements PasswordProvider
Caches passwords used to unlock a file.

Threadsafe.

  • Constructor Details

    • CachedPasswordProvider

      public CachedPasswordProvider()
  • Method Details

    • addPassword NEW

      public void addPassword(FSRL fsrl, Password password)
      Adds a password / file combo to the cache.
      Parameters:
      fsrl - FSRL file
      password - password to unlock the file. Specified Password is only copied, clearing is still callers responsibility
    • clearCache

      public void clearCache()
      Remove all cached information.
    • getCount

      public int getCount()
      Returns the number of items in cache
      Returns:
      number of items in cache
    • getPasswordsFor MODIFIED

      public Iterator<Password> getPasswordsFor(FSRL fsrl, String prompt, CryptoProvider.Session session)
      return type: Iterator → Iterator
      -java.util.Iterator<ghidra.formats.gfilesystem.crypto.PasswordValue> getPasswordsFor(ghidra.formats.gfilesystem.FSRL fsrl, java.lang.String prompt, ghidra.formats.gfilesystem.crypto.CryptoProvider.Session session)
      +java.util.Iterator<ghidra.framework.generic.auth.Password> getPasswordsFor(ghidra.formats.gfilesystem.FSRL fsrl, java.lang.String prompt, ghidra.formats.gfilesystem.crypto.CryptoProvider.Session session)
      Description copied from interface: PasswordProvider
      Returns a sequence of passwords (ordered by quality) that may apply to the specified file.
      Specified by:
      getPasswordsFor in interface PasswordProvider
      Parameters:
      fsrl - FSRL path to the password protected file
      prompt - optional prompt that may be displayed to a user
      session - a place to hold state values that persist across related queries
      Returns:
      Iterator of possible passwords