KContacts::Key

#include <key.h>

Public Types

typedef QVector< KeyList
 
enum  Type { X509, PGP, Custom }
 
typedef QList< TypeTypeList
 

Public Member Functions

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

Static Public Member Functions

static QString typeLabel (Type type)
 
static TypeList typeList ()
 

Friends

KCONTACTS_EXPORT QDataStreamoperator<< (QDataStream &, const Key &)
 
KCONTACTS_EXPORT QDataStreamoperator>> (QDataStream &, Key &)
 

Detailed Description

A class to store an encryption key.

Definition at line 20 of file key.h.

Member Typedef Documentation

List of keys.

Definition at line 29 of file key.h.

List of key types.

Definition at line 43 of file key.h.

Member Enumeration Documentation

Key types.

Enumerator
X509 

X509 key.

PGP 

Pretty Good Privacy key.

Custom 

Custom or IANA conform key.

Definition at line 34 of file key.h.

Constructor & Destructor Documentation

Key::Key ( const QString text = QString(),
Type  type = PGP 
)
explicit

Creates a new key.

Parameters
textThe text data.
typeThe key type, see Types.

Definition at line 46 of file key.cpp.

Key::Key ( const Key other)

Copy constructor.

Definition at line 54 of file key.cpp.

Key::~Key ( )

Destroys the key.

Definition at line 59 of file key.cpp.

Member Function Documentation

QByteArray Key::binaryData ( ) const

Returns the binary data.

Definition at line 124 of file key.cpp.

QString Key::customTypeString ( ) const

Returns the custom type string.

Definition at line 160 of file key.cpp.

QString Key::id ( ) const

Returns the unique identifier.

Definition at line 113 of file key.cpp.

bool Key::isBinary ( ) const

Returns whether the key contains binary or text data.

Definition at line 140 of file key.cpp.

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

Not-equal operator.

Definition at line 94 of file key.cpp.

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

Assignment operator.

Parameters
otherThe Key instance to assign to this

Definition at line 99 of file key.cpp.

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

Equality operator.

Definition at line 63 of file key.cpp.

void Key::setBinaryData ( const QByteArray data)

Sets binary data.

Definition at line 118 of file key.cpp.

void Key::setCustomTypeString ( const QString type)

Sets custom type string.

Definition at line 150 of file key.cpp.

void Key::setId ( const QString identifier)

Sets the unique identifier.

Definition at line 108 of file key.cpp.

void Key::setTextData ( const QString data)

Sets text data.

Definition at line 129 of file key.cpp.

void Key::setType ( Type  type)

Sets the type.

Parameters
typeThe type of the key
See also
Type

Definition at line 145 of file key.cpp.

QString Key::textData ( ) const

Returns the text data.

Definition at line 135 of file key.cpp.

QString Key::toString ( ) const

Returns a string representation of the key.

Definition at line 165 of file key.cpp.

Key::Type Key::type ( ) const

Returns the type, see Type.

Definition at line 155 of file key.cpp.

QString Key::typeLabel ( Type  type)
static

Returns a translated label for a given key type.

Definition at line 197 of file key.cpp.

Key::TypeList Key::typeList ( )
static

Returns a list of all available key types.

Definition at line 186 of file key.cpp.

Friends And Related Function Documentation

KCONTACTS_EXPORT QDataStream& operator<< ( QDataStream ,
const Key  
)
friend

Serializes the key object into the stream.

KCONTACTS_EXPORT QDataStream& operator>> ( QDataStream ,
Key  
)
friend

Initializes the key object from the stream.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 3 2020 22:54:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.