• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kgpg

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KGpgKeyNode Class Reference

#include <KGpgKeyNode.h>

Inheritance diagram for KGpgKeyNode:
Inheritance graph
[legend]

Public Types

typedef QList< const
KGpgKeyNode * > 
ConstList
 
typedef QList< KGpgKeyNode * > List
 
- Public Types inherited from KGpgSignableNode
typedef QList< const
KGpgSignableNode * > 
const_List
 
typedef QList< KGpgSignableNode * > List
 
- Public Types inherited from KGpgNode
typedef QList< KGpgNode * > List
 

Public Slots

void expand ()
 

Signals

void expanded ()
 

Public Member Functions

 KGpgKeyNode (KGpgRootNode *parent, const KgpgCore::KgpgKey &k)
 
virtual ~KGpgKeyNode ()
 
void addRef (KGpgRefNode *node)
 
bool canEncrypt () const
 
bool compareId (const QString &other) const
 
virtual KgpgCore::KgpgKey * copyKey () const
 
void delRef (KGpgRefNode *node)
 
QString getBeautifiedFingerprint () const
 
virtual QString getComment () const
 
virtual QDateTime getCreation () const
 
virtual QString getEmail () const
 
virtual unsigned int getEncryptionKeySize () const
 
virtual QDateTime getExpiration () const
 
const QString & getFingerprint () const
 
QList< KGpgGroupMemberNode * > getGroupRefs (void) const
 
QList< KGpgGroupNode * > getGroups (void) const
 
virtual QString getId () const
 
const KgpgCore::KgpgKey * getKey () const
 
virtual KGpgKeyNode * getKeyNode (void)
 
virtual const KGpgKeyNode * getKeyNode (void) const
 
virtual QString getName () const
 
KGpgSignNode::List getSignatures (const bool subkeys) const
 
virtual QString getSignCount () const
 
virtual unsigned int getSignKeySize () const
 
KGpgSignNode::List getSignRefs (void) const
 
virtual QString getSize () const
 
virtual KgpgCore::KgpgKeyTrust getTrust () const
 
virtual KgpgCore::KgpgItemType getType () const
 
const KGpgSignableNode * getUid (const unsigned int index) const
 
virtual bool hasChildren () const
 
bool isSecret () const
 
void setKey (const KgpgCore::KgpgKey &key)
 
- Public Member Functions inherited from KGpgSignableNode
 KGpgSignableNode (KGpgExpandableNode *parent=NULL)
 
virtual ~KGpgSignableNode ()
 
KGpgSignNode::List getSignatures (void) const
 
bool operator< (const KGpgSignableNode &other) const
 
bool operator< (const KGpgSignableNode *other) const
 
- Public Member Functions inherited from KGpgExpandableNode
virtual ~KGpgExpandableNode ()
 
virtual void deleteChild (KGpgNode *child)
 
virtual KGpgNode * getChild (const int index) const
 
virtual int getChildCount ()
 
virtual int getChildIndex (KGpgNode *node) const
 
virtual const KGpgNode::List & getChildren () const
 
virtual bool wasExpanded () const
 
- Public Member Functions inherited from KGpgNode
virtual ~KGpgNode ()
 
virtual QString getNameComment () const
 
KGpgExpandableNode * getParentKeyNode () const
 
KGpgExpandableNode * toExpandableNode ()
 
const KGpgExpandableNode * toExpandableNode () const
 
KGpgGroupMemberNode * toGroupMemberNode ()
 
const KGpgGroupMemberNode * toGroupMemberNode () const
 
KGpgGroupNode * toGroupNode ()
 
const KGpgGroupNode * toGroupNode () const
 
KGpgKeyNode * toKeyNode ()
 
const KGpgKeyNode * toKeyNode () const
 
KGpgOrphanNode * toOrphanNode ()
 
const KGpgOrphanNode * toOrphanNode () const
 
KGpgRefNode * toRefNode ()
 
const KGpgRefNode * toRefNode () const
 
KGpgRootNode * toRootNode ()
 
const KGpgRootNode * toRootNode () const
 
KGpgSignableNode * toSignableNode ()
 
const KGpgSignableNode * toSignableNode () const
 
KGpgSignNode * toSignNode ()
 
const KGpgSignNode * toSignNode () const
 
KGpgSubkeyNode * toSubkeyNode ()
 
const KGpgSubkeyNode * toSubkeyNode () const
 
KGpgUatNode * toUatNode ()
 
const KGpgUatNode * toUatNode () const
 
KGpgUidNode * toUidNode ()
 
const KGpgUidNode * toUidNode () const
 

Static Public Member Functions

static KgpgCore::KgpgItemType getType (const KgpgCore::KgpgKey *k)
 

Protected Member Functions

QList< KGpgRefNode * > getRefsOfType (const KgpgCore::KgpgItemType &type) const
 
virtual void readChildren ()
 
- Protected Member Functions inherited from KGpgExpandableNode
 KGpgExpandableNode (KGpgExpandableNode *parent=NULL)
 
- Protected Member Functions inherited from KGpgNode
 KGpgNode (KGpgExpandableNode *parent)
 

Protected Attributes

QList< KGpgRefNode * > m_refs
 
- Protected Attributes inherited from KGpgExpandableNode
KGpgNode::List children
 
- Protected Attributes inherited from KGpgNode
KGpgItemModel * m_model
 
KGpgExpandableNode * m_parent
 

Detailed Description

A public key with or without corresponding secret key.

Definition at line 33 of file KGpgKeyNode.h.

Member Typedef Documentation

typedef QList<const KGpgKeyNode *> KGpgKeyNode::ConstList

Definition at line 51 of file KGpgKeyNode.h.

typedef QList<KGpgKeyNode *> KGpgKeyNode::List

Definition at line 50 of file KGpgKeyNode.h.

Constructor & Destructor Documentation

KGpgKeyNode::KGpgKeyNode ( KGpgRootNode *  parent,
const KgpgCore::KgpgKey &  k 
)
explicit

Definition at line 33 of file KGpgKeyNode.cpp.

KGpgKeyNode::~KGpgKeyNode ( )
virtual

Definition at line 40 of file KGpgKeyNode.cpp.

Member Function Documentation

void KGpgKeyNode::addRef ( KGpgRefNode *  node)

Notify this key that a KGpgRefNode now references this key.

Parameters
nodeobject that takes the reference

Definition at line 205 of file KGpgKeyNode.cpp.

bool KGpgKeyNode::canEncrypt ( ) const

return if this key can be used for encryption

Definition at line 349 of file KGpgKeyNode.cpp.

bool KGpgKeyNode::compareId ( const QString &  other) const

compare the id of this node to the given other node

Parameters
otherkey id to compare to
Returns
if ids are identical

This handles different length of the id string.

Definition at line 333 of file KGpgKeyNode.cpp.

KgpgKey * KGpgKeyNode::copyKey ( ) const
virtual

Creates a copy of the KgpgKey that belongs to this class.

Definition at line 168 of file KGpgKeyNode.cpp.

void KGpgKeyNode::delRef ( KGpgRefNode *  node)

Remove a reference to this object.

Parameters
nodenode that no longer has the reference

Note that this must not be called as reply when this object emits updated(NULL)

Definition at line 212 of file KGpgKeyNode.cpp.

void KGpgKeyNode::expand ( )
slot

read all subitems

This will read in all subitems (e.g. subkeys, signatures). When this is done the expanded() signal is emitted. The signal is emitted immediately if the key has been expanded before.

This will not update the child items in case they are already present. Use KGpgItemModel::refreshKey() instead.

Definition at line 355 of file KGpgKeyNode.cpp.

void KGpgKeyNode::expanded ( )
signal
QString KGpgKeyNode::getBeautifiedFingerprint ( ) const

Print the full key fingerprint with spaces inserted.

For display purposes you normally don't want to print the full fingerprint as is because it's too many hex characters at once. This function returns the fingerprint in the format usually used for printing this out, i.e. with a space after each fourth hex character.

Returns
the full fingerprint with spaces inserted

Definition at line 137 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getComment ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 143 of file KGpgKeyNode.cpp.

QDateTime KGpgKeyNode::getCreation ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 107 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getEmail ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 95 of file KGpgKeyNode.cpp.

unsigned int KGpgKeyNode::getEncryptionKeySize ( ) const
virtual

Returns the size of the first encryption subkey.

Returns
encryption key size in bits

Definition at line 199 of file KGpgKeyNode.cpp.

QDateTime KGpgKeyNode::getExpiration ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 101 of file KGpgKeyNode.cpp.

const QString & KGpgKeyNode::getFingerprint ( ) const

Definition at line 75 of file KGpgKeyNode.cpp.

QList< KGpgGroupMemberNode * > KGpgKeyNode::getGroupRefs ( void  ) const

returns a list of all group member nodes that reference this key

Definition at line 244 of file KGpgKeyNode.cpp.

QList< KGpgGroupNode * > KGpgKeyNode::getGroups ( void  ) const

returns a list of all groups this key is member of

Definition at line 220 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getId ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 113 of file KGpgKeyNode.cpp.

const KgpgKey * KGpgKeyNode::getKey ( ) const

Returns a reference to the key used in this object.

This allows direct access to the values of the key e.g. for KgpgKeyInfo.

Definition at line 187 of file KGpgKeyNode.cpp.

KGpgKeyNode * KGpgKeyNode::getKeyNode ( void  )
virtual

returns the key node this node belongs to

Returns
this node if the node itself is a key or it's parent otherwise

Implements KGpgSignableNode.

Definition at line 119 of file KGpgKeyNode.cpp.

const KGpgKeyNode * KGpgKeyNode::getKeyNode ( void  ) const
virtual

Implements KGpgSignableNode.

Definition at line 131 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getName ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 89 of file KGpgKeyNode.cpp.

QList< KGpgRefNode * > KGpgKeyNode::getRefsOfType ( const KgpgCore::KgpgItemType &  type) const
protected

Definition at line 231 of file KGpgKeyNode.cpp.

KGpgSignNode::List KGpgKeyNode::getSignatures ( const bool  subkeys) const

returns a list of signatures to this key

Parameters
subkeysif signatures on subkeys should be included

Definition at line 268 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getSignCount ( ) const
virtual

Return the number of signatures of the primary user id.

This is different from the number of children of this node as there is usually at least one subkey and there may also be additional user ids or attributes. This does not count the signatures to those slave objects, only the ones that are direct children of this node.

Returns
the number of signatures to the primary user id

Reimplemented from KGpgSignableNode.

Definition at line 160 of file KGpgKeyNode.cpp.

unsigned int KGpgKeyNode::getSignKeySize ( ) const
virtual

Returns the size of the signing key.

Returns
signing key size in bits

Definition at line 193 of file KGpgKeyNode.cpp.

KGpgSignNode::List KGpgKeyNode::getSignRefs ( void  ) const

returns a list of all sign nodes that reference this key

Definition at line 255 of file KGpgKeyNode.cpp.

QString KGpgKeyNode::getSize ( ) const
virtual

Returns a string describing the size of this object.

Subclasses may return a value that makes sense for whatever object they represent.

The default implementation returns an empty string.

Reimplemented from KGpgNode.

Definition at line 81 of file KGpgKeyNode.cpp.

KgpgCore::KgpgKeyTrust KGpgKeyNode::getTrust ( ) const
virtual

Reimplemented from KGpgNode.

Definition at line 69 of file KGpgKeyNode.cpp.

KgpgCore::KgpgItemType KGpgKeyNode::getType ( const KgpgCore::KgpgKey *  k)
static

Definition at line 60 of file KGpgKeyNode.cpp.

KgpgCore::KgpgItemType KGpgKeyNode::getType ( ) const
virtual

Returns the item type of this object.

Since every subclass returns a distinct value you can use the result of this function to decide which cast to take. Note that there are subclasses (KGpgKeyNode, KGpgGroupMemberNode) that can return two different values.

Implements KGpgNode.

Definition at line 48 of file KGpgKeyNode.cpp.

const KGpgSignableNode * KGpgKeyNode::getUid ( const unsigned int  index) const

get the user id or user attribute with the given number

Parameters
indexthe index of the user id to return
Returns
the requested subitem or NULL if that is not present

User ids indexes are 1-based, so 0 is not a valid index. Passing 1 as index will return the object itself, representing the primary user id.

Definition at line 306 of file KGpgKeyNode.cpp.

bool KGpgKeyNode::hasChildren ( ) const
virtual

check if there are any child nodes

The default implementation returns true if any child nodes were loaded. This may be reimplemented by child classes so they can indicate that there are child nodes before actually loading them.

This method indicates if there are children if this node is expanded. In contrast wasExpanded() will only return true if the child nodes are actually present in memory.

Reimplemented from KGpgExpandableNode.

Definition at line 54 of file KGpgKeyNode.cpp.

bool KGpgKeyNode::isSecret ( ) const

Return if this key has a private key.

Definition at line 125 of file KGpgKeyNode.cpp.

void KGpgKeyNode::readChildren ( )
protectedvirtual

reimplemented in every base class to read in the child data

This allows the child objects to delay the loading of the child objects until they are really needed to avoid time consuming operations for data never used.

Implements KGpgExpandableNode.

Definition at line 149 of file KGpgKeyNode.cpp.

void KGpgKeyNode::setKey ( const KgpgCore::KgpgKey &  key)

Replaces the current key information with the new one.

All sub-items (i.e. signatures, user ids ...) will be deleted. This must only be used when the id of both new and old key is the same.

Definition at line 174 of file KGpgKeyNode.cpp.

Member Data Documentation

QList<KGpgRefNode *> KGpgKeyNode::m_refs
protected

Definition at line 46 of file KGpgKeyNode.h.


The documentation for this class was generated from the following files:
  • KGpgKeyNode.h
  • KGpgKeyNode.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgpg

Skip menu "kgpg"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal