IBR-DTNSuite  0.12
dtn::security::SecurityCertificateManager Class Reference

This class is a manager to handle certificates. More...

#include <SecurityCertificateManager.h>

Inheritance diagram for dtn::security::SecurityCertificateManager:
Inheritance graph
Collaboration diagram for dtn::security::SecurityCertificateManager:
Collaboration graph

Public Member Functions

 SecurityCertificateManager ()
 
virtual ~SecurityCertificateManager ()
 
virtual void onConfigurationChanged (const dtn::daemon::Configuration &conf) throw ()
 
bool isInitialized ()
 checks if this class has already been initialized with a certificate and private key More...
 
const X509 * getCert () const
 retrieve the saved certificate More...
 
const EVP_PKEY * getPrivateKey () const
 retrieve the saved private key More...
 
const ibrcommon::FilegetTrustedCAPath () const
 retrieve the saved directory holding trusted certificates More...
 
virtual void componentUp () throw ()
 
virtual void componentDown () throw ()
 
virtual const std::string getName () const
 
- Public Member Functions inherited from dtn::daemon::IntegratedComponent
 IntegratedComponent ()
 
virtual ~IntegratedComponent ()
 
virtual void initialize () throw ()
 
virtual void startup () throw ()
 
virtual void terminate () throw ()
 
- Public Member Functions inherited from dtn::daemon::Component
virtual ~Component ()=0
 

Static Public Member Functions

static void validateSubject (X509 *certificate, const std::string &cn) throw (SecurityCertificateException)
 Validates if the CommonName in the given X509 certificate corresponds to the given EID. More...
 

Detailed Description

This class is a manager to handle certificates.

Definition at line 53 of file SecurityCertificateManager.h.

Constructor & Destructor Documentation

dtn::security::SecurityCertificateManager::SecurityCertificateManager ( )

Definition at line 36 of file SecurityCertificateManager.cpp.

dtn::security::SecurityCertificateManager::~SecurityCertificateManager ( )
virtual

Definition at line 41 of file SecurityCertificateManager.cpp.

Member Function Documentation

void dtn::security::SecurityCertificateManager::componentDown ( )
throw (
)
virtual

Implements dtn::daemon::IntegratedComponent.

Definition at line 130 of file SecurityCertificateManager.cpp.

void dtn::security::SecurityCertificateManager::componentUp ( )
throw (
)
virtual
const X509 * dtn::security::SecurityCertificateManager::getCert ( ) const

retrieve the saved certificate

Returns
The certificate.
Warning
Check isInitialized() first, before calling this function

Definition at line 49 of file SecurityCertificateManager.cpp.

const std::string dtn::security::SecurityCertificateManager::getName ( ) const
virtual

Return an identifier for this component

Returns

Implements dtn::daemon::Component.

Definition at line 136 of file SecurityCertificateManager.cpp.

const EVP_PKEY * dtn::security::SecurityCertificateManager::getPrivateKey ( ) const

retrieve the saved private key

Returns
The private key as an EVP_PKEY pointer (OpenSSL).
Warning
Check isInitialized() first, before calling this function

Definition at line 54 of file SecurityCertificateManager.cpp.

const ibrcommon::File & dtn::security::SecurityCertificateManager::getTrustedCAPath ( ) const

retrieve the saved directory holding trusted certificates

Returns
The directory

Definition at line 59 of file SecurityCertificateManager.cpp.

bool dtn::security::SecurityCertificateManager::isInitialized ( )

checks if this class has already been initialized with a certificate and private key

Returns
true if it is initialized, false otherwise

Definition at line 44 of file SecurityCertificateManager.cpp.

void dtn::security::SecurityCertificateManager::onConfigurationChanged ( const dtn::daemon::Configuration conf)
throw (
)
virtual

Listen for changes of the configuration

Implements dtn::daemon::Configuration::OnChangeListener.

Definition at line 64 of file SecurityCertificateManager.cpp.

References ibrcommon::LogLevel::error, ibrcommon::File::getPath(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, and ibrcommon::File::isDirectory().

Referenced by componentUp().

Here is the call graph for this function:

void dtn::security::SecurityCertificateManager::validateSubject ( X509 *  certificate,
const std::string &  cn 
)
throw (SecurityCertificateException
)
static

Validates if the CommonName in the given X509 certificate corresponds to the given EID.

Parameters
certificateThe Certificate.
eidThe EID of the sender.
Returns
returns true if the EID fits, false otherwise

Definition at line 142 of file SecurityCertificateManager.cpp.

References ibrcommon::LogLevel::error, IBRCOMMON_LOGGER_ENDL, and IBRCOMMON_LOGGER_TAG.

Referenced by dtn::net::TCPConnection::initiateExtendedHandshake().


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