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

#include <SecurityKey.h>

Collaboration diagram for dtn::security::SecurityKey:
Collaboration graph

Classes

class  KeyNotFoundException
 

Public Types

enum  KeyType { KEY_UNSPEC = 0, KEY_SHARED = 1, KEY_PRIVATE = 2, KEY_PUBLIC = 3 }
 
enum  TrustLevel { NONE, LOW, MEDIUM, HIGH }
 

Public Member Functions

 SecurityKey ()
 
virtual ~SecurityKey ()
 
bool operator== (const SecurityKey &key)
 
ibrcommon::File getMetaFilename () const
 
virtual RSAgetRSA () const
 
virtual EVP_PKEY * getEVP () const
 
virtual const std::string getData () const
 
virtual const std::string getFingerprint () const
 

Static Public Member Functions

static void free (RSA *key)
 
static void free (EVP_PKEY *key)
 
static std::string getFingerprint (const ibrcommon::File &file)
 
static std::string getFingerprint (RSA *rsa)
 

Public Attributes

KeyType type
 
dtn::data::EID reference
 
dtn::data::DTNTime lastupdate
 
TrustLevel trustlevel
 
ibrcommon::File file
 
dtn::data::SDNV< unsigned int > flags
 

Friends

std::ostream & operator<< (std::ostream &stream, const SecurityKey &key)
 
std::istream & operator>> (std::istream &stream, SecurityKey &key)
 

Detailed Description

Definition at line 39 of file SecurityKey.h.

Member Enumeration Documentation

Enumerator
KEY_UNSPEC 
KEY_SHARED 
KEY_PRIVATE 
KEY_PUBLIC 

Definition at line 42 of file SecurityKey.h.

Enumerator
NONE 
LOW 
MEDIUM 
HIGH 

Definition at line 50 of file SecurityKey.h.

Constructor & Destructor Documentation

dtn::security::SecurityKey::SecurityKey ( )

Definition at line 37 of file SecurityKey.cpp.

dtn::security::SecurityKey::~SecurityKey ( )
virtual

Definition at line 41 of file SecurityKey.cpp.

Member Function Documentation

void dtn::security::SecurityKey::free ( EVP_PKEY *  key)
static

Definition at line 49 of file SecurityKey.cpp.

EVP_PKEY * dtn::security::SecurityKey::getEVP ( ) const
virtual

Definition at line 89 of file SecurityKey.cpp.

References file, KEY_PRIVATE, KEY_PUBLIC, and type.

Referenced by dtn::security::PayloadIntegrityBlock::verify().

const std::string dtn::security::SecurityKey::getFingerprint ( ) const
virtual

Definition at line 117 of file SecurityKey.cpp.

References file, free(), KEY_PRIVATE, KEY_PUBLIC, and type.

Referenced by dtn::security::QRCodeProtocol::begin(), dtn::security::KeyExchanger::finish(), dtn::daemon::NativeDaemon::getKeyInfo(), and operator==().

Here is the call graph for this function:

std::string dtn::security::SecurityKey::getFingerprint ( const ibrcommon::File &  file)
static

Definition at line 178 of file SecurityKey.cpp.

std::string dtn::security::SecurityKey::getFingerprint ( RSA rsa)
static

Definition at line 201 of file SecurityKey.cpp.

References free().

Here is the call graph for this function:

ibrcommon::File dtn::security::SecurityKey::getMetaFilename ( ) const
bool dtn::security::SecurityKey::operator== ( const SecurityKey key)

Definition at line 54 of file SecurityKey.cpp.

References getFingerprint().

Here is the call graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const SecurityKey key 
)
friend

Definition at line 103 of file SecurityKey.h.

std::istream& operator>> ( std::istream &  stream,
SecurityKey key 
)
friend

Definition at line 124 of file SecurityKey.h.

Member Data Documentation

dtn::data::SDNV<unsigned int> dtn::security::SecurityKey::flags
dtn::data::DTNTime dtn::security::SecurityKey::lastupdate

Definition at line 77 of file SecurityKey.h.

TrustLevel dtn::security::SecurityKey::trustlevel

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