Class CachedPasswordProvider
- java.lang.Object
-
- ghidra.formats.gfilesystem.crypto.CachedPasswordProvider
-
- All Implemented Interfaces:
CryptoProvider
,PasswordProvider
public class CachedPasswordProvider extends java.lang.Object implements PasswordProvider
Caches passwords used to unlock a file.Threadsafe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.formats.gfilesystem.crypto.CryptoProvider
CryptoProvider.Session
-
-
Constructor Summary
Constructors Constructor Description CachedPasswordProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPassword(FSRL fsrl, PasswordValue password)
Adds a password / file combo to the cache.void
clearCache()
Remove all cached information.int
getCount()
Returns the number of items in cachejava.util.Iterator<PasswordValue>
getPasswordsFor(FSRL fsrl, java.lang.String prompt, CryptoProvider.Session session)
Returns a sequence of passwords (ordered by quality) that may apply to the specified file.
-
-
-
Method Detail
-
addPassword
public void addPassword(FSRL fsrl, PasswordValue password)
Adds a password / file combo to the cache.- Parameters:
fsrl
-FSRL
filepassword
- password to unlock the file. Specified PasswordValue 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
public java.util.Iterator<PasswordValue> getPasswordsFor(FSRL fsrl, java.lang.String prompt, 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 interfacePasswordProvider
- Parameters:
fsrl
-FSRL
path to the password protected fileprompt
- optional prompt that may be displayed to a usersession
- a place to hold state values that persist across related queries- Returns:
Iterator
of possible passwords
-
-