Class CryptoProviders
- java.lang.Object
-
- ghidra.formats.gfilesystem.crypto.CryptoProviders
-
public class CryptoProviders extends java.lang.Object
Registry ofcrypto providers
andsession creator
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedPasswordProvider
getCachedCryptoProvider()
Returns theCachedPasswordProvider
.<T extends CryptoProvider>
TgetCryptoProviderInstance(java.lang.Class<T> providerClass)
Returns the previously registered matchingCryptoProvider
instance.static CryptoProviders
getInstance()
Fetch the globalCryptoProviders
singleton instance.CryptoSession
newSession()
Creates a newCryptoSession
.void
registerCryptoProvider(CryptoProvider provider)
Adds aCryptoProvider
to this registry.void
unregisterCryptoProvider(CryptoProvider provider)
Removes aCryptoProvider
from this registry.
-
-
-
Method Detail
-
getInstance
public static CryptoProviders getInstance()
Fetch the globalCryptoProviders
singleton instance.- Returns:
- shared
CryptoProviders
singleton instance
-
registerCryptoProvider
public void registerCryptoProvider(CryptoProvider provider)
Adds aCryptoProvider
to this registry.TODO: do we need provider priority ordering?
- Parameters:
provider
-CryptoProvider
-
unregisterCryptoProvider
public void unregisterCryptoProvider(CryptoProvider provider)
Removes aCryptoProvider
from this registry.- Parameters:
provider
-CryptoProvider
to remove
-
getCachedCryptoProvider
public CachedPasswordProvider getCachedCryptoProvider()
Returns theCachedPasswordProvider
.(Used by GUI actions to manage the cache)
- Returns:
- cached crypto provider instance
-
getCryptoProviderInstance
public <T extends CryptoProvider> T getCryptoProviderInstance(java.lang.Class<T> providerClass)
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
public CryptoSession 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
-
-