Class CryptoProviders
java.lang.Object
ghidra.formats.gfilesystem.crypto.CryptoProviders
Registry of
crypto providers
and session creator
.-
Method Summary
Modifier and TypeMethodDescriptionReturns theCachedPasswordProvider
.<T extends CryptoProvider>
TgetCryptoProviderInstance
(Class<T> providerClass) Returns the previously registered matchingCryptoProvider
instance.static CryptoProviders
Fetch the globalCryptoProviders
singleton instance.Creates a newCryptoSession
.void
registerCryptoProvider
(CryptoProvider provider) Adds aCryptoProvider
to this registry.void
unregisterCryptoProvider
(CryptoProvider provider) Removes aCryptoProvider
from this registry.
-
Method Details
-
getInstance
Fetch the globalCryptoProviders
singleton instance.- Returns:
- shared
CryptoProviders
singleton instance
-
registerCryptoProvider
Adds aCryptoProvider
to this registry.TODO: do we need provider priority ordering?
- Parameters:
provider
-CryptoProvider
-
unregisterCryptoProvider
Removes aCryptoProvider
from this registry.- Parameters:
provider
-CryptoProvider
to remove
-
getCachedCryptoProvider
Returns theCachedPasswordProvider
.(Used by GUI actions to manage the cache)
- Returns:
- cached crypto provider instance
-
getCryptoProviderInstance
Returns the previously registered matchingCryptoProvider
instance.- Type Parameters:
T
- CryptoProvider type- Parameters:
providerClass
-CryptoProvider
class- Returns:
- previously registered CryptoProvider instance, or null if not found
-
newSession
Creates a newCryptoSession
.TODO: to truly be effective when multiple files are being opened (ie. batch import), nested sessions need to be implemented.
- Returns:
- new
CryptoSession
instance
-