30 #include <ibrcommon/Logger.h>
32 #ifdef __DEVELOPMENT_ASSERTIONS__
47 : _accept_only_bab(false), _accept_only_pib(false)
57 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"auth bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
72 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"sign bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
87 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"verify signed bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
118 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 5) <<
"Bundle " << bundle.toString() <<
" successfully verified" << IBRCOMMON_LOGGER_ENDL;
126 }
catch (
const std::bad_cast&) {
136 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"verify authenticated bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
140 while (it.next(bundle.end()))
175 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"decrypt bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
184 }
catch (
const ibrcommon::Exception &ex) {
192 IBRCOMMON_LOGGER_DEBUG_TAG(
"SecurityManager", 10) <<
"encrypt bundle: " << bundle.toString() << IBRCOMMON_LOGGER_ENDL;
199 }
catch (
const ibrcommon::Exception &ex) {
static SecurityKeyManager & getInstance()
virtual ~SecurityManager()
static dtn::data::EID local
static void encrypt(dtn::data::Bundle &bundle, const dtn::security::SecurityKey &long_key, const dtn::data::EID &source)
static void auth(dtn::data::Bundle &bundle, const dtn::security::SecurityKey &key)
void verifyIntegrity(dtn::data::Bundle &bundle) const
const dtn::data::EID getSecuritySource() const
void auth(dtn::data::Bundle &bundle) const
bool isSecurityDestination(const dtn::data::Bundle &, const dtn::data::EID &) const
void sign(dtn::data::Bundle &bundle) const
static void verify(const dtn::data::Bundle &bundle, const dtn::security::SecurityKey &key)
static SecurityManager & getInstance()
void verifyAuthentication(dtn::data::Bundle &bundle) const
static const dtn::data::block_t BLOCK_TYPE
block_list::iterator iterator
dtn::security::SecurityKey get(const dtn::data::EID &ref, const dtn::security::SecurityKey::KeyType type=dtn::security::SecurityKey::KEY_UNSPEC) const
void encrypt(dtn::data::Bundle &bundle) const
static const dtn::data::block_t BLOCK_TYPE
ibrcommon::find_iterator< iterator, block_t > find_iterator
static void strip(dtn::data::Bundle &bundle, const dtn::security::SecurityKey &key)
static void verify(const dtn::data::Bundle &bundle, const SecurityKey &key)
const block_t & getType() const
static void decrypt(dtn::data::Bundle &bundle, const dtn::security::SecurityKey &long_key)
static void sign(dtn::data::Bundle &bundle, const SecurityKey &key, const dtn::data::EID &destination)
void decrypt(dtn::data::Bundle &bundle) const