Loading...
Searching...
No Matches
BinaryNinja::Enterprise::LicenseCheckout Class Reference

RAII object for holding an Enterprise floating license in a scope. More...

Detailed Description

RAII object for holding an Enterprise floating license in a scope.

Automatically releases the license when destroyed.

Example:

using namespace BinaryNinja;
assert(Enterprise::AuthenticateWithCredentials("username", "password", true));
{
Ref<BinaryView> bv = Load("/bin/ls", true, {}, options);
printf("%llx\n", bv->GetStart());
// License is released at end of scope
}
RAII object for holding an Enterprise floating license in a scope.
Definition enterprise.h:231
Definition binaryninjaapi.h:239
bool Connect()
Perform initial connect to the server, pulling signing key and time limit.
Definition enterprise.cpp:82
bool AuthenticateWithCredentials(const std::string &username, const std::string &password, bool remember)
Authenticate to the Enterprise server with username and password.
Definition enterprise.cpp:39
Definition binaryninjaapi.h:67
Ref< BinaryView > Load(const std::string &filename, bool updateAnalysis=true, const std::string &options="{}", std::function< bool(size_t, size_t)> progress={})
OpenView opens a file on disk and returns a BinaryView, attempting to use the most relevant BinaryVie...
Definition binaryview.cpp:5470

Public Member Functions

 LicenseCheckout (int64_t duration=900)
 RAII constructor that checks out a license.
 
 ~LicenseCheckout ()
 

Constructor & Destructor Documentation

◆ LicenseCheckout()

BinaryNinja::Enterprise::LicenseCheckout::LicenseCheckout ( int64_t duration = 900)
explicit

RAII constructor that checks out a license.

License will be refreshed automatically in a background thread while checked out, in intervals of `duration` In the event of program crash, the license will expire `duration` seconds after the most recent background refresh, so you may want a smaller value like 60 if you expect your program to crash / be killed often. See class docs for example usage.

Parameters
durationDuration for refreshes and also length of each license checkout.
Exceptions
EnterpriseExceptionIf license checkout fails

◆ ~LicenseCheckout()

BinaryNinja::Enterprise::LicenseCheckout::~LicenseCheckout ( )