KContacts::Key Class

class KContacts::Key

A class to store an encryption key. More...

Header: #include <KContacts/Key>
CMake: find_package(KF6 REQUIRED COMPONENTS Contacts)
target_link_libraries(mytarget PRIVATE KF6::Contacts)

Public Types

List
enum Type { X509, PGP, Custom }
TypeList

Public Functions

Key(const QString &text = QString(), KContacts::Key::Type type = PGP)
QByteArray binaryData() const
QString customTypeString() const
QString id() const
bool isBinary() const
void setBinaryData(const QByteArray &data)
void setCustomTypeString(const QString &type)
void setId(const QString &identifier)
void setTextData(const QString &data)
void setType(KContacts::Key::Type type)
QString textData() const
QString toString() const
KContacts::Key::Type type() const
bool operator!=(const KContacts::Key &other) const
KContacts::Key &operator=(const KContacts::Key &other)
bool operator==(const KContacts::Key &other) const

Static Public Members

QString typeLabel(KContacts::Key::Type type)
KContacts::Key::TypeList typeList()
QDataStream &operator<<(QDataStream &stream, const KContacts::Key &key)
QDataStream &operator>>(QDataStream &stream, KContacts::Key &key)

Detailed Description

Member Type Documentation

Key::List

List of keys.

enum Key::Type

Key types

ConstantValueDescription
KContacts::Key::X5090X509 key
KContacts::Key::PGP1Pretty Good Privacy key
KContacts::Key::Custom2Custom or IANA conform key

Key::TypeList

List of key types.

Member Function Documentation

[explicit] Key::Key(const QString &text = QString(), KContacts::Key::Type type = PGP)

Creates a new key.

text The text data.

type The key type, see Types.

QByteArray Key::binaryData() const

Returns the binary data.

See also setBinaryData().

QString Key::customTypeString() const

Returns the custom type string.

See also setCustomTypeString().

QString Key::id() const

Returns the unique identifier.

See also setId().

bool Key::isBinary() const

Returns whether the key contains binary or text data.

void Key::setBinaryData(const QByteArray &data)

Sets binary data.

See also binaryData().

void Key::setCustomTypeString(const QString &type)

Sets custom type string.

See also customTypeString().

void Key::setId(const QString &identifier)

Sets the unique identifier.

See also id().

void Key::setTextData(const QString &data)

Sets text data.

See also textData().

void Key::setType(KContacts::Key::Type type)

Sets the type.

type The type of the key

See also type() and Type.

QString Key::textData() const

Returns the text data.

See also setTextData().

QString Key::toString() const

Returns a string representation of the key.

KContacts::Key::Type Key::type() const

Returns the type, see Type.

See also setType().

[static] QString Key::typeLabel(KContacts::Key::Type type)

Returns a translated label for a given key type.

[static] KContacts::Key::TypeList Key::typeList()

Returns a list of all available key types.

bool Key::operator!=(const KContacts::Key &other) const

Not-equal operator.

KContacts::Key &Key::operator=(const KContacts::Key &other)

Assignment operator.

other The Key instance to assign to this

bool Key::operator==(const KContacts::Key &other) const

Equality operator.

Related Non-Members

QDataStream &operator<<(QDataStream &stream, const KContacts::Key &key)

Serializes the key object into the stream.

QDataStream &operator>>(QDataStream &stream, KContacts::Key &key)

Initializes the key object from the stream.