Loading...
Searching...
No Matches
Secrets Provider

Detailed Description

Classes

class  BinaryNinja::SecretsProvider
 Class for storing secrets (e.g. More...
 
class  BinaryNinja::CoreSecretsProvider
 

Class Documentation

◆ BinaryNinja::SecretsProvider

class BinaryNinja::SecretsProvider

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.
 
virtual std::optional< std::string > GetData (const std::string &key)=0
 Retrieve data for the given key, if it exists.
 
virtual bool StoreData (const std::string &key, const std::string &data)=0
 Store data with the given key.
 
virtual bool DeleteData (const std::string &key)=0
 Delete stored data with the given key.
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNSecretsProviderGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Public Member Functions

static std::vector< Ref< SecretsProvider > > GetList ()
 Retrieve the list of providers.
 
static Ref< SecretsProviderGetByName (const std::string &name)
 Retrieve a provider by name.
 
static void Register (SecretsProvider *provider)
 Register a new provider.
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
static BNSecretsProviderGetObject (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
 
BNSecretsProviderm_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

◆ HasDataCallback()

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

◆ GetDataCallback()

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

◆ StoreDataCallback()

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

◆ DeleteDataCallback()

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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ GetList()

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

Retrieve the list of providers.

Returns
A list of registered providers

◆ 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

◆ Register()

void SecretsProvider::Register ( SecretsProvider * provider)
static

Register a new provider.

Parameters
providerNew provider to register

◆ BinaryNinja::CoreSecretsProvider

class BinaryNinja::CoreSecretsProvider

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::SecretsProvider
static std::vector< Ref< SecretsProvider > > GetList ()
 Retrieve the list of providers.
 
static Ref< SecretsProviderGetByName (const std::string &name)
 Retrieve a provider by name.
 
static void Register (SecretsProvider *provider)
 Register a new provider.
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
static BNSecretsProviderGetObject (StaticCoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNSecretsProvider >
std::atomic< int > m_refs
 
BNSecretsProviderm_object
 
- Protected Member Functions inherited from BinaryNinja::SecretsProvider
 SecretsProvider (const std::string &name)
 
 SecretsProvider (BNSecretsProvider *provider)
 
- Static Protected Member Functions inherited from BinaryNinja::SecretsProvider
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)
 

Constructor & Destructor Documentation

◆ CoreSecretsProvider()

CoreSecretsProvider::CoreSecretsProvider ( BNSecretsProvider * provider)

Member Function Documentation

◆ HasData()

bool CoreSecretsProvider::HasData ( const std::string & key)
overridevirtual

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

Parameters
keyKey for data
Returns
True if data exists

Implements BinaryNinja::SecretsProvider.

◆ GetData()

std::optional< std::string > CoreSecretsProvider::GetData ( const std::string & key)
overridevirtual

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.

Implements BinaryNinja::SecretsProvider.

◆ StoreData()

bool CoreSecretsProvider::StoreData ( const std::string & key,
const std::string & data )
overridevirtual

Store data with the given key.

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

Implements BinaryNinja::SecretsProvider.

◆ DeleteData()

bool CoreSecretsProvider::DeleteData ( const std::string & key)
overridevirtual

Delete stored data with the given key.

Parameters
keyKey for data
Returns
True if it was deleted

Implements BinaryNinja::SecretsProvider.