1 #ifndef ENCRYPTIONEXTENSION_HH
2 #define ENCRYPTIONEXTENSION_HH
4 #include "configobject.hh"
12 Q_CLASSINFO(
"IdPrefix",
"key")
27 virtual QString
toHex()
const;
30 const QByteArray &
key()
const;
49 Q_CLASSINFO(
"description",
"A basic DMR encryption key.")
50 Q_CLASSINFO(
"longDescription",
51 "This is a variable sized pre-shared key that can be used to encrypt/decrypt traffic "
52 "on DMR channels. Encryption is forbidden in HAM radio context!")
74 Q_CLASSINFO(
"description",
"An enhanced DMR encryption key.")
75 Q_CLASSINFO(
"longDescription",
76 "This is a 40bit pre-shared RC4 key, that can be used to encrypt/decrypt traffic on "
77 "DMR channels. Encryption is forbidden in HAM radio context!")
103 Q_CLASSINFO(
"description",
"An AES (advanced) DMR encryption key.")
104 Q_CLASSINFO(
"longDescription",
105 "This is a variable sized (usually 128-256bit) pre-shared key that can be used to "
106 "encrypt/decrypt traffic on DMR channels. Encryption is forbidden in HAM radio "
140 int add(
ConfigObject *obj,
int row=-1,
bool unique=
true);
Represents an AES (enhanced) encryption key.
Definition: encryptionextension.hh:100
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: encryptionextension.cc:191
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition: encryptionextension.cc:202
Represents a DMR (basic) encryption key.
Definition: encryptionextension.hh:47
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: encryptionextension.cc:71
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition: encryptionextension.cc:82
Parse context for config objects.
Definition: configobject.hh:48
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
virtual ConfigItem * clone() const =0
Clones this item.
List class for config objects.
Definition: configobject.hh:349
Base class of all labeled and named objects.
Definition: configobject.hh:199
Base class of all encryption keys.
Definition: encryptionextension.hh:10
QString key
The key representation as a hex string.
Definition: encryptionextension.hh:15
void clear()
Clears the config object.
Definition: encryptionextension.cc:15
virtual bool setKey(const QByteArray &key, const ErrorStack &err=ErrorStack())
Sets the binary key.
Definition: encryptionextension.cc:35
virtual QString toHex() const
Converts a key to a hex string.
Definition: encryptionextension.cc:25
EncryptionKey(QObject *parent=nullptr)
Hidden constructor.
Definition: encryptionextension.cc:8
QByteArray _key
Holds the key data.
Definition: encryptionextension.hh:37
virtual bool fromHex(const QString &hex, const ErrorStack &err=ErrorStack())
Creates a key from the given hex-string.
Definition: encryptionextension.cc:20
The list of encryption keys.
Definition: encryptionextension.hh:133
Represents an (enhanced) RC4 encryption key.
Definition: encryptionextension.hh:72
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition: encryptionextension.cc:147
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: encryptionextension.cc:136
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41