A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::AppKey Class Reference

The key at the application layer. More...

#include "app-key.h"

+ Inheritance diagram for ns3::AppKey:
+ Collaboration diagram for ns3::AppKey:

Public Types

enum  Type { ENCRYPTION , AUTHENTICATION }
 
- Public Types inherited from ns3::QKDKey
enum  QKDKeyState_e {
  INIT , READY , SERVED , USED ,
  OBSOLETE , RESTORED , RESERVED
}
 QKD Key States. More...
 

Public Member Functions

 AppKey (std::string id, std::string value, Type type, uint32_t lifetime)
 
 AppKey (uint32_t index, std::string value, Type type, uint32_t lifetime)
 
uint32_t GetIndex () const
 
uint32_t GetLifetime () const
 
Type GetType () const
 
void SetIndex (uint32_t index)
 
void SetLifetime (uint32_t lifetime)
 
void SetType (Type type)
 
void UseLifetime (uint32_t amount)
 
- Public Member Functions inherited from ns3::QKDKey
 QKDKey (std::string keyId, std::string key)
 
 QKDKey (std::string keyId, uint64_t keyIdnum, std::string key)
 
 QKDKey (std::string keyId, uint64_t keyIdnum, uint64_t keySize)
 Create an empty QKD key of a key size.
 
 QKDKey (uint64_t keySize)
 Create an empty QKD key of a key size.
 
std::string ConsumeKeyString ()
 Return the raw key in std::string format and switch to SERVED state.
 
Ptr< QKDKeyCopy () const
 Help function - Copy key.
 
std::string GenerateRandomString (const int len)
 Return random string.
 
std::string GetId () const
 
uint8_t * GetKey ()
 Return key in byte* which is necessery for encryption or authentication Convert key from std::String to byte*.
 
std::string GetKeyBinary ()
 Return key in bits which is necessery for encryption or authentication.
 
std::string GetKeyString ()
 Get QKD key.
 
Time GetKeyTimestamp ()
 Get timestamp of the key.
 
std::string GetModuleId ()
 Returns the id of the QKD module that generated key.
 
uint64_t GetSize () const
 Get the size of the key.
 
uint64_t GetSizeInBits () const
 Get the size of the key in bits.
 
QKDKeyState_e GetState () const
 Returns the current state of the key.
 
std::string GetStateString () const
 Returns the current state of the key in string format.
 
void MarkReady ()
 
void MarkReserved ()
 
void MarkRestored ()
 
void MarkServed ()
 
void MarkUsed ()
 
void SetId (std::string)
 
void SetModuleId (std::string)
 Save details about the QKD module that generated key.
 
void SetSize (uint64_t)
 Set the size of the key.
 
void SetValue (std::string)
 
void SwitchToState (QKDKeyState_e state)
 Change the state of the key.
 
std::string ToString ()
 Return the raw key in std::string format.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Private Attributes

uint32_t m_index
 
uint32_t m_lifetime
 
Type m_type
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::QKDKey
static std::string GetStateString (QKDKeyState_e state)
 Returns the given state in string format.
 
static TypeId GetTypeId ()
 Get the TypeId.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 
- Public Attributes inherited from ns3::QKDKey
ns3::TracedCallback< const std::string &, const std::string & > m_stateTransitionTrace
 The StateTransition trace source.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 
- Protected Attributes inherited from ns3::QKDKey
std::string m_id
 
std::string m_key
 
uint64_t m_size
 

Detailed Description

The key at the application layer.

It has lifetime and type attributes in addition to QKD key class attributes.

Definition at line 37 of file app-key.h.

Member Enumeration Documentation

◆ Type

Enumerator
ENCRYPTION 
AUTHENTICATION 

Definition at line 40 of file app-key.h.

Constructor & Destructor Documentation

◆ AppKey() [1/2]

ns3::AppKey::AppKey ( std::string  id,
std::string  value,
Type  type,
uint32_t  lifetime 
)
inline

Definition at line 46 of file app-key.h.

References m_lifetime, and m_type.

◆ AppKey() [2/2]

ns3::AppKey::AppKey ( uint32_t  index,
std::string  value,
Type  type,
uint32_t  lifetime 
)
inline

Definition at line 57 of file app-key.h.

References m_index, m_lifetime, and m_type.

Member Function Documentation

◆ GetIndex()

uint32_t ns3::AppKey::GetIndex ( ) const
inline

Definition at line 95 of file app-key.h.

References m_index.

◆ GetLifetime()

uint32_t ns3::AppKey::GetLifetime ( ) const
inline

Definition at line 68 of file app-key.h.

References m_lifetime.

◆ GetType()

Type ns3::AppKey::GetType ( ) const
inline

Definition at line 83 of file app-key.h.

References m_type.

◆ SetIndex()

void ns3::AppKey::SetIndex ( uint32_t  index)
inline

Definition at line 91 of file app-key.h.

References m_index.

◆ SetLifetime()

void ns3::AppKey::SetLifetime ( uint32_t  lifetime)
inline

Definition at line 72 of file app-key.h.

References m_lifetime.

◆ SetType()

void ns3::AppKey::SetType ( Type  type)
inline

Definition at line 87 of file app-key.h.

References m_type.

◆ UseLifetime()

void ns3::AppKey::UseLifetime ( uint32_t  amount)
inline

Definition at line 76 of file app-key.h.

References ns3::Create(), and m_lifetime.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_index

uint32_t ns3::AppKey::m_index
private

Definition at line 103 of file app-key.h.

Referenced by AppKey(), GetIndex(), and SetIndex().

◆ m_lifetime

uint32_t ns3::AppKey::m_lifetime
private

Definition at line 104 of file app-key.h.

Referenced by AppKey(), AppKey(), GetLifetime(), SetLifetime(), and UseLifetime().

◆ m_type

Type ns3::AppKey::m_type
private

Definition at line 102 of file app-key.h.

Referenced by AppKey(), AppKey(), GetType(), and SetType().


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