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

#include <KeyExchangeSession.h>

Collaboration diagram for dtn::security::KeyExchangeSession:
Collaboration graph

Classes

class  SessionState
 

Public Member Functions

 KeyExchangeSession (int protocol, const dtn::data::EID &peer, unsigned int uniqueId, SessionState *state=NULL)
 
virtual ~KeyExchangeSession ()
 
dtn::data::Timestamp getExpiration () const
 
void touch ()
 
const dtn::data::EIDgetPeer () const
 
int getProtocol () const
 
unsigned int getUniqueId () const
 
const std::string & getSessionKey () const
 
dtn::security::SecurityKey getKey (const dtn::security::SecurityKey::KeyType type=dtn::security::SecurityKey::KEY_UNSPEC) const throw (SecurityKey::KeyNotFoundException)
 
void putKey (const std::string &data, const dtn::security::SecurityKey::KeyType type, const dtn::security::SecurityKey::TrustLevel trust) const
 
void clearKeys () const
 
template<class T >
T & getState ()
 

Static Public Member Functions

static std::string getSessionKey (const dtn::data::EID &peer, unsigned int uniqueId)
 

Detailed Description

Definition at line 37 of file KeyExchangeSession.h.

Constructor & Destructor Documentation

dtn::security::KeyExchangeSession::KeyExchangeSession ( int  protocol,
const dtn::data::EID peer,
unsigned int  uniqueId,
SessionState state = NULL 
)

Definition at line 38 of file KeyExchangeSession.cpp.

References dtn::utils::Clock::getMonotonicTimestamp(), and getSessionKey().

Here is the call graph for this function:

dtn::security::KeyExchangeSession::~KeyExchangeSession ( )
virtual

Definition at line 48 of file KeyExchangeSession.cpp.

References clearKeys().

Here is the call graph for this function:

Member Function Documentation

void dtn::security::KeyExchangeSession::clearKeys ( ) const
dtn::data::Timestamp dtn::security::KeyExchangeSession::getExpiration ( ) const

Returns the expiration time of this session

Definition at line 57 of file KeyExchangeSession.cpp.

Return the key stored within this session

Definition at line 97 of file KeyExchangeSession.cpp.

References dtn::security::SecurityKeyManager::get(), and dtn::security::SecurityKeyManager::getInstance().

Referenced by clearKeys(), and dtn::security::KeyExchanger::finish().

Here is the call graph for this function:

int dtn::security::KeyExchangeSession::getProtocol ( ) const

Returns the protocol ID of this session

Definition at line 82 of file KeyExchangeSession.cpp.

Referenced by putKey().

const std::string & dtn::security::KeyExchangeSession::getSessionKey ( ) const

Returns the session key

Definition at line 92 of file KeyExchangeSession.cpp.

Referenced by KeyExchangeSession().

std::string dtn::security::KeyExchangeSession::getSessionKey ( const dtn::data::EID peer,
unsigned int  uniqueId 
)
static

Generates a session key based on the peer and the unique ID

Definition at line 68 of file KeyExchangeSession.cpp.

References dtn::data::EID::getString().

Here is the call graph for this function:

template<class T >
T& dtn::security::KeyExchangeSession::getState ( )
inline

Returns the session state or throws an exception if the state does not match the requested approach

Definition at line 106 of file KeyExchangeSession.h.

Referenced by dtn::security::HashProtocol::begin(), dtn::security::JPAKEProtocol::begin(), dtn::security::DHProtocol::begin(), dtn::security::HashProtocol::step(), dtn::security::JPAKEProtocol::step(), and dtn::security::DHProtocol::step().

unsigned int dtn::security::KeyExchangeSession::getUniqueId ( ) const

Returns the unique ID of the session

Definition at line 87 of file KeyExchangeSession.cpp.

Referenced by dtn::security::KeyExchanger::finish(), putKey(), and dtn::security::KeyExchangeData::setSession().

void dtn::security::KeyExchangeSession::touch ( )

Prolong the lifetime of this session

Definition at line 62 of file KeyExchangeSession.cpp.

References dtn::utils::Clock::getMonotonicTimestamp().

Referenced by dtn::security::KeyExchanger::submit().

Here is the call graph for this function:


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