SEcube open-source SDK
Public Member Functions | Private Attributes | List of all members
se_key Class Reference

The key class is used to model a key object. A key has several properties which are kept private (id, name, owner, status, algorithm, length, generation time, activation time, expiration time). Public methods are available to retrieve the values of private properties. More...

#include <SEkey.h>

Public Member Functions

 se_key (std::string &key_id, uint32_t algo, uint32_t key_length, time_t act, time_t exp)
 
 se_key (std::string &key_id, std::string &key_name, std::string &key_owner, se_key_status key_status, uint32_t key_algo, uint32_t key_length, time_t gen, time_t act, time_t exp, time_t crypto, time_t deactivation, se_key_type key_type, time_t compr, time_t destr, time_t susp)
 
se_keyoperator= (const se_key &key)
 
std::string & get_id ()
 
se_key_status get_status ()
 
bool safer (se_key &chosen)
 
void print_key_details (std::ofstream &sekey_log)
 

Private Attributes

std::string id
 
std::string name
 
std::string owner
 
se_key_status status
 
se_key_type type
 
uint32_t algorithm
 
uint32_t length
 
time_t generation
 
time_t activation
 
time_t expiration
 
time_t deactivation
 
time_t compromise
 
time_t destruction
 
time_t suspension
 
time_t cryptoperiod
 

Detailed Description

The key class is used to model a key object. A key has several properties which are kept private (id, name, owner, status, algorithm, length, generation time, activation time, expiration time). Public methods are available to retrieve the values of private properties.

Member Function Documentation

◆ safer()

bool se_key::safer ( se_key chosen)

Determines if the current key is safer than another key.

Member Data Documentation

◆ activation

time_t se_key::activation
private

time at which the key was activated

◆ algorithm

uint32_t se_key::algorithm
private

algorithm (must be the same specified by the policy of the group owner of the key)

◆ compromise

time_t se_key::compromise
private

time at which the key was compromised (0 if it is not compromised)

◆ cryptoperiod

time_t se_key::cryptoperiod
private

time span during which a key can be used for encryption and decryption, if 0 the cryptoperiod of the owner is inherited

◆ deactivation

time_t se_key::deactivation
private

time at which the key was deactivated

◆ destruction

time_t se_key::destruction
private

time at which the key was destroyed (0 if it is not destroyed)

◆ expiration

time_t se_key::expiration
private

time at which the key expired or was supposed to expire (deactivation is always less or equal to the expiration time)

◆ generation

time_t se_key::generation
private

time at which the key was created

◆ id

std::string se_key::id
private

id of the key

◆ length

uint32_t se_key::length
private

given the algorithm, the length of the key (expressed in bits) is automatically determined

◆ name

std::string se_key::name
private

label of the key

◆ owner

std::string se_key::owner
private

the owner of a key is always a group

◆ status

se_key_status se_key::status
private

status (i.e. preactive)

◆ suspension

time_t se_key::suspension
private

last time at which the key was suspended (0 if it is not suspended)

◆ type

se_key_type se_key::type
private

the type of the key (i.e. symmetric data encryption)


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