IBR-DTN  1.0.0
dtn::security::SecurityManager Class Reference

#include <SecurityManager.h>

Collaboration diagram for dtn::security::SecurityManager:
Collaboration graph

Classes

class  KeyMissingException
 

Public Member Functions

void sign (dtn::data::Bundle &bundle) const throw (KeyMissingException)
 
void auth (dtn::data::Bundle &bundle) const throw (KeyMissingException)
 
void verifyAuthentication (dtn::data::Bundle &bundle) const throw (VerificationFailedException)
 
void verifyIntegrity (dtn::data::Bundle &bundle) const throw (VerificationFailedException)
 
void decrypt (dtn::data::Bundle &bundle) const throw (DecryptException, KeyMissingException)
 
void encrypt (dtn::data::Bundle &bundle) const throw (EncryptException, KeyMissingException)
 

Static Public Member Functions

static SecurityManagergetInstance ()
 

Protected Member Functions

 SecurityManager ()
 
virtual ~SecurityManager ()
 

Detailed Description

Decrypts or encrypts and signs or verifies bundles, which go in or out. The rules are read from the configuration and the keys needed for operation must be in the same directory as the configuration or be retrievable from the net.

Definition at line 41 of file SecurityManager.h.

Constructor & Destructor Documentation

dtn::security::SecurityManager::SecurityManager ( )
protected

need a list of nodes, their security blocks type and the key for private and public keys

Definition at line 46 of file SecurityManager.cpp.

dtn::security::SecurityManager::~SecurityManager ( )
protectedvirtual

Definition at line 51 of file SecurityManager.cpp.

Member Function Documentation

void dtn::security::SecurityManager::decrypt ( dtn::data::Bundle bundle) const
throw (DecryptException,
KeyMissingException
)

This method decrypts encrypted payload of a bundle. It is necessary to remove all integrity or auth block before the payload can decrypted.

Parameters
bundle

Definition at line 168 of file SecurityManager.cpp.

References dtn::security::PayloadConfidentialBlock::BLOCK_TYPE, dtn::security::PayloadConfidentialBlock::decrypt(), dtn::data::PrimaryBlock::DTNSEC_STATUS_CONFIDENTIAL, dtn::security::SecurityKeyManager::get(), dtn::security::SecurityKeyManager::getInstance(), dtn::security::SecurityKey::KEY_PRIVATE, and dtn::core::BundleCore::local.

Referenced by dtn::core::BundleCore::processBlocks().

Here is the call graph for this function:

void dtn::security::SecurityManager::encrypt ( dtn::data::Bundle bundle) const
throw (EncryptException,
KeyMissingException
)

This method encrypts the payload of a given bundle. If the bundle already contains integrity or auth block a EcryptException is thrown.

Parameters
bundle

Definition at line 189 of file SecurityManager.cpp.

References dtn::security::PayloadConfidentialBlock::encrypt(), dtn::security::SecurityKeyManager::get(), dtn::security::SecurityKeyManager::getInstance(), dtn::security::SecurityKey::KEY_PUBLIC, and dtn::core::BundleCore::local.

Referenced by dtn::core::BundleCore::inject().

Here is the call graph for this function:

SecurityManager & dtn::security::SecurityManager::getInstance ( )
static

Returns a singleton instance of this class.

Returns
a reference to this class singleton

Definition at line 40 of file SecurityManager.cpp.

Referenced by dtn::core::SecurityFilter::filter(), dtn::core::BundleCore::inject(), and dtn::core::BundleCore::processBlocks().

void dtn::security::SecurityManager::sign ( dtn::data::Bundle bundle) const
throw (KeyMissingException
)

This method signs the bundle with the own private key. If no key is available a KeyMissingException is thrown.

Parameters
bundleA bundle to sign.

Definition at line 70 of file SecurityManager.cpp.

References dtn::security::SecurityKeyManager::get(), dtn::security::SecurityKeyManager::getInstance(), dtn::security::SecurityKey::KEY_PRIVATE, dtn::core::BundleCore::local, and dtn::security::PayloadIntegrityBlock::sign().

Referenced by dtn::core::BundleCore::inject().

Here is the call graph for this function:

void dtn::security::SecurityManager::verifyAuthentication ( dtn::data::Bundle bundle) const
throw (VerificationFailedException
)

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