BinaryNinja::SecretsProvider Class Referenceabstract

Detailed Description

Class for storing secrets (e.g.

tokens) in a system-specific manner

Public Member Functions

virtual bool HasData (const std::string &key)=0
 Check if data for a specific key exists, but do not retrieve it. More...
 
virtual std::optional< std::string > GetData (const std::string &key)=0
 Retrieve data for the given key, if it exists. More...
 
virtual bool StoreData (const std::string &key, const std::string &data)=0
 Store data with the given key. More...
 
virtual bool DeleteData (const std::string &key)=0
 Delete stored data with the given key. More...
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNSecretsProvider * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 

Static Public Member Functions

static std::vector< Ref< SecretsProvider > > GetList ()
 Retrieve the list of providers. More...
 
static Ref< SecretsProviderGetByName (const std::string &name)
 Retrieve a provider by name. More...
 
static void Register (SecretsProvider *provider)
 Register a new provider. More...
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
static BNSecretsProvider * GetObject (StaticCoreRefCountObject *obj)
 

Protected Member Functions

 SecretsProvider (const std::string &name)
 
 SecretsProvider (BNSecretsProvider *provider)
 

Static Protected Member Functions

static bool HasDataCallback (void *ctxt, const char *key)
 
static char * GetDataCallback (void *ctxt, const char *key)
 
static bool StoreDataCallback (void *ctxt, const char *key, const char *data)
 
static bool DeleteDataCallback (void *ctxt, const char *key)
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
std::atomic< int > m_refs
 
BNSecretsProvider * m_object
 

Constructor & Destructor Documentation

◆ SecretsProvider() [1/2]

SecretsProvider::SecretsProvider ( const std::string &  name)
protected

◆ SecretsProvider() [2/2]

SecretsProvider::SecretsProvider ( BNSecretsProvider *  provider)
protected

Member Function Documentation

◆ DeleteData()

virtual bool BinaryNinja::SecretsProvider::DeleteData ( const std::string &  key)
pure virtual

Delete stored data with the given key.

Parameters
keyKey for data
Returns
True if it was deleted

Implemented in BinaryNinja::CoreSecretsProvider.

◆ DeleteDataCallback()

bool SecretsProvider::DeleteDataCallback ( void *  ctxt,
const char *  key 
)
staticprotected

◆ GetByName()

Ref< SecretsProvider > SecretsProvider::GetByName ( const std::string &  name)
static

Retrieve a provider by name.

Parameters
nameName of provider
Returns
Provider object, if one with the given name is regestered, or nullptr if not

◆ GetData()

virtual std::optional< std::string > BinaryNinja::SecretsProvider::GetData ( const std::string &  key)
pure virtual

Retrieve data for the given key, if it exists.

Parameters
keyKey for data
Returns
Optional with data, if it exists, or empty optional if it does not exist or otherwise could not be retrieved.

Implemented in BinaryNinja::CoreSecretsProvider.

◆ GetDataCallback()

char * SecretsProvider::GetDataCallback ( void *  ctxt,
const char *  key 
)
staticprotected

◆ GetList()

std::vector< Ref< SecretsProvider > > SecretsProvider::GetList ( )
static

Retrieve the list of providers.

Returns
A list of registered providers

◆ HasData()

virtual bool BinaryNinja::SecretsProvider::HasData ( const std::string &  key)
pure virtual

Check if data for a specific key exists, but do not retrieve it.

Parameters
keyKey for data
Returns
True if data exists

Implemented in BinaryNinja::CoreSecretsProvider.

◆ HasDataCallback()

bool SecretsProvider::HasDataCallback ( void *  ctxt,
const char *  key 
)
staticprotected

◆ Register()

void SecretsProvider::Register ( SecretsProvider provider)
static

Register a new provider.

Parameters
providerNew provider to register

◆ StoreData()

virtual bool BinaryNinja::SecretsProvider::StoreData ( const std::string &  key,
const std::string &  data 
)
pure virtual

Store data with the given key.

Parameters
keyKey for data
dataData to store
Returns
True if the data was stored

Implemented in BinaryNinja::CoreSecretsProvider.

◆ StoreDataCallback()

bool SecretsProvider::StoreDataCallback ( void *  ctxt,
const char *  key,
const char *  data 
)
staticprotected

The documentation for this class was generated from the following files: