The QKD key is an elementary class of QKDNetSim. More...
#include "qkd-key.h"
Inheritance diagram for ns3::QKDKey:
Collaboration diagram for ns3::QKDKey:Public Types | |
| enum | QKDKeyState_e { INIT , READY , SERVED , USED , OBSOLETE , RESTORED , RESERVED } |
| QKD Key States. More... | |
Public Member Functions | |
| 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< QKDKey > | Copy () 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< Object > | GetObject () 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< Object > | GetObject (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. | |
| SimpleRefCount & | operator= (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. | |
Static Public Member Functions | |
| 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 | |
| ns3::TracedCallback< const std::string &, const std::string & > | m_stateTransitionTrace |
The StateTransition trace source. | |
Protected Attributes | |
| std::string | m_id |
| std::string | m_key |
| uint64_t | m_size |
Private Attributes | |
| uint64_t | m_internalID |
| std::string | m_moduleId |
| id of QKD module that generated key | |
| QKDKeyState_e | m_state |
| state of the key | |
| Time | m_timestamp |
Static Private Attributes | |
| static uint64_t | m_globalUid = 0 |
Additional Inherited Members | |
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. | |
Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
The QKD key is an elementary class of QKDNetSim.
Introspection did not find any typical Config paths.
It is used to describe the key that is established in the QKD process.
@noteIn the QKD process, keys are stored as blocks. Later, some part of the block is taken and used for encryption, while others remain in the buffer. Operations regarding QKD Key management(merge, split and other) are under construction. Each QKDKey is identified using a unique 32 long character identifier. The key is also marked with the timestamp of its origin, its length, and the condition in which the key is located. QKDKey can be found in one of the following states: INIT - the call for the establishment of the key record is initiated READY - the key is successfully created and stored SERVED - the key is served for usage on request USED - the key is used for cryptographic operations(under construction) OBSOLETE - the key validity has expired(under construction) RESTORED - the key is restored for further usage(under construction)
No Attributes are defined for this type.
Size of this type is 208 bytes (on a 64-bit architecture).
| ns3::QKDKey::QKDKey | ( | uint64_t | keySize | ) |
Create an empty QKD key of a key size.
Definition at line 58 of file qkd-key.cc.
References ns3::Create(), GenerateRandomString(), GetStateString(), m_globalUid, m_id, m_internalID, m_key, m_size, m_timestamp, ns3::Simulator::Now(), NS_LOG_FUNCTION, READY, and SwitchToState().
Here is the call graph for this function:| ns3::QKDKey::QKDKey | ( | std::string | keyId, |
| uint64_t | keyIdnum, | ||
| uint64_t | keySize | ||
| ) |
Create an empty QKD key of a key size.
Definition at line 89 of file qkd-key.cc.
References ns3::Create(), GenerateRandomString(), m_globalUid, m_id, m_internalID, m_key, m_size, m_timestamp, ns3::Simulator::Now(), NS_LOG_FUNCTION, READY, and SwitchToState().
Here is the call graph for this function:| ns3::QKDKey::QKDKey | ( | std::string | keyId, |
| uint64_t | keyIdnum, | ||
| std::string | key | ||
| ) |
Definition at line 113 of file qkd-key.cc.
References ns3::Create(), m_globalUid, m_id, m_internalID, m_key, m_size, m_timestamp, ns3::Simulator::Now(), NS_LOG_FUNCTION, READY, and SwitchToState().
Here is the call graph for this function:| ns3::QKDKey::QKDKey | ( | std::string | keyId, |
| std::string | key | ||
| ) |
Definition at line 134 of file qkd-key.cc.
References m_key, m_size, m_timestamp, ns3::Simulator::Now(), READY, and SwitchToState().
Here is the call graph for this function:| std::string ns3::QKDKey::ConsumeKeyString | ( | ) |
Return the raw key in std::string format and switch to SERVED state.
Definition at line 212 of file qkd-key.cc.
References m_id, m_key, NS_LOG_FUNCTION, SERVED, and SwitchToState().
Here is the call graph for this function:Help function - Copy key.
Definition at line 45 of file qkd-key.cc.
References ns3::Create().
Here is the call graph for this function:| std::string ns3::QKDKey::GenerateRandomString | ( | const int | len | ) |
Return random string.
| len | length of string to generate |
Definition at line 271 of file qkd-key.cc.
References ns3::Create(), m_internalID, and NS_LOG_FUNCTION.
Referenced by QKDKey(), and QKDKey().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string ns3::QKDKey::GetId | ( | ) | const |
Definition at line 175 of file qkd-key.cc.
References m_id.
| uint8_t * ns3::QKDKey::GetKey | ( | ) |
Return key in byte* which is necessery for encryption or authentication Convert key from std::String to byte*.
Definition at line 227 of file qkd-key.cc.
References ns3::Create(), m_id, m_key, NS_LOG_FUNCTION, SERVED, and SwitchToState().
Here is the call graph for this function:| std::string ns3::QKDKey::GetKeyBinary | ( | ) |
Return key in bits which is necessery for encryption or authentication.
Definition at line 162 of file qkd-key.cc.
References ns3::Create(), m_key, and NS_LOG_FUNCTION.
Here is the call graph for this function:| std::string ns3::QKDKey::GetKeyString | ( | ) |
Get QKD key.
Definition at line 147 of file qkd-key.cc.
References m_key, and NS_LOG_FUNCTION.
| Time ns3::QKDKey::GetKeyTimestamp | ( | ) |
Get timestamp of the key.
Definition at line 350 of file qkd-key.cc.
References m_timestamp.
| std::string ns3::QKDKey::GetModuleId | ( | ) |
Returns the id of the QKD module that generated key.
Definition at line 362 of file qkd-key.cc.
References m_moduleId.
| uint64_t ns3::QKDKey::GetSize | ( | ) | const |
Get the size of the key.
Definition at line 187 of file qkd-key.cc.
References m_id, m_size, and NS_LOG_FUNCTION.
| uint64_t ns3::QKDKey::GetSizeInBits | ( | ) | const |
Get the size of the key in bits.
Definition at line 194 of file qkd-key.cc.
References m_id, m_size, and NS_LOG_FUNCTION.
| QKDKey::QKDKeyState_e ns3::QKDKey::GetState | ( | ) | const |
Returns the current state of the key.
Definition at line 288 of file qkd-key.cc.
References m_state.
| std::string ns3::QKDKey::GetStateString | ( | ) | const |
Returns the current state of the key in string format.
Definition at line 330 of file qkd-key.cc.
References GetStateString(), and m_state.
Referenced by QKDKey(), GetStateString(), and SwitchToState().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the given state in string format.
| state | An arbitrary state of a key. |
Definition at line 296 of file qkd-key.cc.
References INIT, NS_FATAL_ERROR, OBSOLETE, READY, RESERVED, RESTORED, SERVED, and USED.
|
static |
Get the TypeId.
Definition at line 30 of file qkd-key.cc.
References m_stateTransitionTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
Here is the call graph for this function:| void ns3::QKDKey::MarkReady | ( | ) |
Definition at line 237 of file qkd-key.cc.
References m_id, m_key, m_state, NS_LOG_FUNCTION, READY, and SwitchToState().
Here is the call graph for this function:| void ns3::QKDKey::MarkReserved | ( | ) |
Definition at line 265 of file qkd-key.cc.
References m_id, m_key, m_state, NS_LOG_FUNCTION, RESERVED, and SwitchToState().
Here is the call graph for this function:| void ns3::QKDKey::MarkRestored | ( | ) |
Definition at line 257 of file qkd-key.cc.
References m_id, m_key, m_state, NS_LOG_FUNCTION, RESTORED, and SwitchToState().
Here is the call graph for this function:| void ns3::QKDKey::MarkServed | ( | ) |
Definition at line 243 of file qkd-key.cc.
References m_id, m_key, m_state, NS_LOG_FUNCTION, SERVED, and SwitchToState().
Here is the call graph for this function:| void ns3::QKDKey::MarkUsed | ( | ) |
Definition at line 250 of file qkd-key.cc.
References m_id, m_key, m_state, NS_LOG_FUNCTION, SwitchToState(), and USED.
Here is the call graph for this function:| void ns3::QKDKey::SetId | ( | std::string | value | ) |
Definition at line 181 of file qkd-key.cc.
References m_id, and ns3::value().
Here is the call graph for this function:| void ns3::QKDKey::SetModuleId | ( | std::string | moduleId | ) |
Save details about the QKD module that generated key.
| QKDModuleId. |
Definition at line 356 of file qkd-key.cc.
References ns3::Create(), and m_moduleId.
Here is the call graph for this function:| void ns3::QKDKey::SetSize | ( | uint64_t | value | ) |
Set the size of the key.
| uint64_t |
Definition at line 201 of file qkd-key.cc.
References m_id, m_size, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::value().
Here is the call graph for this function:| void ns3::QKDKey::SetValue | ( | std::string | value | ) |
Definition at line 154 of file qkd-key.cc.
References m_key, m_size, NS_LOG_FUNCTION, and ns3::value().
Here is the call graph for this function:| void ns3::QKDKey::SwitchToState | ( | QKDKey::QKDKeyState_e | state | ) |
Change the state of the key.
Fires the StateTransition trace source.
| state | The new state. |
Definition at line 336 of file qkd-key.cc.
References ns3::Create(), GetStateString(), m_state, m_stateTransitionTrace, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by QKDKey(), QKDKey(), QKDKey(), QKDKey(), ConsumeKeyString(), GetKey(), MarkReady(), MarkReserved(), MarkRestored(), MarkServed(), and MarkUsed().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string ns3::QKDKey::ToString | ( | ) |
Return the raw key in std::string format.
Definition at line 220 of file qkd-key.cc.
References m_id, m_key, and NS_LOG_FUNCTION.
|
staticprivate |
|
protected |
Definition at line 220 of file qkd-key.h.
Referenced by QKDKey(), QKDKey(), QKDKey(), ConsumeKeyString(), GetId(), GetKey(), GetSize(), GetSizeInBits(), MarkReady(), MarkReserved(), MarkRestored(), MarkServed(), MarkUsed(), SetId(), SetSize(), and ToString().
|
private |
|
protected |
Definition at line 221 of file qkd-key.h.
Referenced by QKDKey(), QKDKey(), QKDKey(), QKDKey(), ConsumeKeyString(), GetKey(), GetKeyBinary(), GetKeyString(), MarkReady(), MarkReserved(), MarkRestored(), MarkServed(), MarkUsed(), SetValue(), and ToString().
|
private |
id of QKD module that generated key
Definition at line 228 of file qkd-key.h.
Referenced by GetModuleId(), and SetModuleId().
|
protected |
Definition at line 222 of file qkd-key.h.
Referenced by QKDKey(), QKDKey(), QKDKey(), QKDKey(), GetSize(), GetSizeInBits(), SetSize(), and SetValue().
|
private |
state of the key
Definition at line 227 of file qkd-key.h.
Referenced by GetState(), GetStateString(), MarkReady(), MarkReserved(), MarkRestored(), MarkServed(), MarkUsed(), and SwitchToState().
| ns3::TracedCallback<const std::string &, const std::string &> ns3::QKDKey::m_stateTransitionTrace |
The StateTransition trace source.
Definition at line 217 of file qkd-key.h.
Referenced by GetTypeId(), and SwitchToState().
|
private |