• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

libkpgp

Kpgp::Key

Kpgp::Key Class Reference

#include <kpgpkey.h>

List of all members.


Detailed Description

This class is used to store information about a PGP key.

Definition at line 509 of file kpgpkey.h.


Public Member Functions

void addSubkey (const Subkey *subkey)
void addSubkey (const KeyID &keyID, const bool secret=false)
void addUserID (const UserID *userID)
void addUserID (const QString &uid, const Validity validity=KPGP_VALIDITY_UNKNOWN, const bool revoked=false, const bool invalid=false)
bool canCertify () const
bool canEncrypt () const
bool canSign () const
void clear ()
void cloneKeyTrust (const Key *key)
time_t creationDate () const
bool disabled () const
EncryptPref encryptionPreference ()
bool expired () const
Subkey * getSubkey (const KeyID &keyID)
bool invalid () const
bool isNull () const
bool isValid () const
bool isValidEncryptionKey () const
bool isValidSigningKey () const
 Key (const KeyID &keyid=KeyID(), const QString &uid=QString(), const bool secret=false)
Validity keyTrust (const QString &uid) const
Validity keyTrust () const
bool matchesUserID (const QString &str, bool cs=true)
QByteArray primaryFingerprint () const
KeyID primaryKeyID () const
QString primaryUserID () const
bool revoked () const
bool secret () const
void setCanCertify (const bool canCertify)
void setCanEncrypt (const bool canEncrypt)
void setCanSign (const bool canSign)
void setDisabled (const bool disabled)
void setEncryptionPreference (const EncryptPref encrPref)
void setExpired (const bool expired)
void setFingerprint (const KeyID &keyID, const QByteArray &fpr)
void setInvalid (const bool invalid)
void setRevoked (const bool revoked)
void setSecret (const bool secret)
const SubkeyList subkeys () const
const UserIDList userIDs () const
 ~Key ()

Protected Attributes

bool mCanCertify: 1
bool mCanEncrypt: 1
bool mCanSign: 1
bool mDisabled: 1
EncryptPref mEncryptPref
bool mExpired: 1
bool mInvalid: 1
bool mRevoked: 1
bool mSecret: 1
SubkeyList mSubkeys
UserIDList mUserIDs

Constructor & Destructor Documentation

Kpgp::Key::Key ( const KeyID &  keyid = KeyID(),
const QString &  uid = QString(),
const bool  secret = false 
) [explicit]

Constructs a new PGP key with keyid as key ID of the primary key and uid as primary user ID.

Parameters:
keyid Key ID for this Key
uid UID for this key (user ID)
secret Is this key secret?

Definition at line 86 of file kpgpkey.cpp.

Kpgp::Key::~Key (  ) 

Definition at line 106 of file kpgpkey.cpp.


Member Function Documentation

void Kpgp::Key::addSubkey ( const Subkey *  subkey  )  [inline]

Adds the given subkey to the key.

Definition at line 839 of file kpgpkey.h.

void Kpgp::Key::addSubkey ( const KeyID &  keyID,
const bool  secret = false 
)

Adds a subkey with the given values to the key if keyID isn't an empty string.

Definition at line 221 of file kpgpkey.cpp.

void Kpgp::Key::addUserID ( const UserID *  userID  )  [inline]

Adds the given user ID to the key.

Definition at line 833 of file kpgpkey.h.

void Kpgp::Key::addUserID ( const QString &  uid,
const Validity  validity = KPGP_VALIDITY_UNKNOWN,
const bool  revoked = false,
const bool  invalid = false 
)

Adds a user ID with the given values to the key if uid isn't an empty string.

Definition at line 199 of file kpgpkey.cpp.

bool Kpgp::Key::canCertify (  )  const [inline]

Returns true if the key can be used to certify keys.

Definition at line 725 of file kpgpkey.h.

bool Kpgp::Key::canEncrypt (  )  const [inline]

Returns true if the key can be used to encrypt data.

Definition at line 715 of file kpgpkey.h.

bool Kpgp::Key::canSign (  )  const [inline]

Returns true if the key can be used to sign data.

Definition at line 720 of file kpgpkey.h.

void Kpgp::Key::clear (  ) 

Clears/resets all key data.

Definition at line 116 of file kpgpkey.cpp.

void Kpgp::Key::cloneKeyTrust ( const Key *  key  ) 

Set the validity values for the user ids to the validity values of the given key.

This is useful after rereading a key without expensive trust checking.

Definition at line 167 of file kpgpkey.cpp.

time_t Kpgp::Key::creationDate (  )  const [inline]

Returns the creation date of the primary subkey.

Definition at line 825 of file kpgpkey.h.

bool Kpgp::Key::disabled (  )  const [inline]

Returns true if the key has been disabled.

Definition at line 705 of file kpgpkey.h.

EncryptPref Kpgp::Key::encryptionPreference (  )  [inline]

Returns the encryption preference for this key.

Definition at line 770 of file kpgpkey.h.

bool Kpgp::Key::expired (  )  const [inline]

Returns true if the key has expired.

Definition at line 700 of file kpgpkey.h.

Subkey * Kpgp::Key::getSubkey ( const KeyID &  keyID  ) 

Returns a pointer to the subkey with the given key ID.

Definition at line 229 of file kpgpkey.cpp.

bool Kpgp::Key::invalid (  )  const [inline]

Returns true if the key is invalid.

Definition at line 710 of file kpgpkey.h.

bool Kpgp::Key::isNull (  )  const [inline]

Returns true if there are no user IDs or no subkeys.

Definition at line 820 of file kpgpkey.h.

bool Kpgp::Key::isValid (  )  const

Returns true if the key is valid, i.e.

not revoked, expired, disabled or invalid.

Definition at line 179 of file kpgpkey.cpp.

bool Kpgp::Key::isValidEncryptionKey (  )  const

Returns true if the key is a valid encryption key.

The trust is not checked.

Definition at line 186 of file kpgpkey.cpp.

bool Kpgp::Key::isValidSigningKey (  )  const

Returns true if the key is a valid signing key.

The trust is not checked.

Definition at line 193 of file kpgpkey.cpp.

Validity Kpgp::Key::keyTrust ( const QString &  uid  )  const

Returns the trust value for the given user id of this key.

Definition at line 150 of file kpgpkey.cpp.

Validity Kpgp::Key::keyTrust (  )  const

Returns the trust value of this key.

This is the maximal trust value of any of the user ids of this key.

Definition at line 136 of file kpgpkey.cpp.

bool Kpgp::Key::matchesUserID ( const QString &  str,
bool  cs = true 
)

Returns true if the given string matches one of the user IDs.

The match is case sensitive if cs is true or case insensitive if cs is false.

Definition at line 208 of file kpgpkey.cpp.

QByteArray Kpgp::Key::primaryFingerprint (  )  const [inline]

Returns the fingerprint of the primary key or a null string if there are no subkeys.

Definition at line 800 of file kpgpkey.h.

KeyID Kpgp::Key::primaryKeyID (  )  const [inline]

Returns the key ID of the primary key or a null string if there are no subkeys.

Definition at line 790 of file kpgpkey.h.

QString Kpgp::Key::primaryUserID (  )  const [inline]

Returns the primary user ID or a null string if there are no user IDs.

Definition at line 780 of file kpgpkey.h.

bool Kpgp::Key::revoked (  )  const [inline]

Returns true if the key has been revoked.

Definition at line 695 of file kpgpkey.h.

bool Kpgp::Key::secret (  )  const [inline]

Returns true if the key is a secret key.

Definition at line 690 of file kpgpkey.h.

void Kpgp::Key::setCanCertify ( const bool  canCertify  )  [inline]

Sets the flag if the key can be used to certify keys to canCertify .

Definition at line 765 of file kpgpkey.h.

void Kpgp::Key::setCanEncrypt ( const bool  canEncrypt  )  [inline]

Sets the flag if the key can be used to encrypt data to canEncrypt .

Definition at line 755 of file kpgpkey.h.

void Kpgp::Key::setCanSign ( const bool  canSign  )  [inline]

Sets the flag if the key can be used to sign data to canSign .

Definition at line 760 of file kpgpkey.h.

void Kpgp::Key::setDisabled ( const bool  disabled  )  [inline]

Sets the flag if the key has been disabled to disabled .

Definition at line 745 of file kpgpkey.h.

void Kpgp::Key::setEncryptionPreference ( const EncryptPref  encrPref  )  [inline]

Sets the encryption preference for this key to encrPref .

Definition at line 775 of file kpgpkey.h.

void Kpgp::Key::setExpired ( const bool  expired  )  [inline]

Sets the flag if the key has expired to expired .

Definition at line 740 of file kpgpkey.h.

void Kpgp::Key::setFingerprint ( const KeyID &  keyID,
const QByteArray &  fpr 
)

Sets the fingerprint of the given subkey to fpr .

Definition at line 251 of file kpgpkey.cpp.

void Kpgp::Key::setInvalid ( const bool  invalid  )  [inline]

Sets the flag if the key is invalid to invalid .

Definition at line 750 of file kpgpkey.h.

void Kpgp::Key::setRevoked ( const bool  revoked  )  [inline]

Sets the flag if the key has been revoked to revoked .

Parameters:
revoked Whether the key is revoked or not
See also:
revoked()

Definition at line 735 of file kpgpkey.h.

void Kpgp::Key::setSecret ( const bool  secret  )  [inline]

Sets the flag if the key is a secret key to secret .

Parameters:
secret Whether this key is secret or not
See also:
secret()

Definition at line 730 of file kpgpkey.h.

const SubkeyList Kpgp::Key::subkeys (  )  const [inline]

Returns the list of subkeys.

Definition at line 815 of file kpgpkey.h.

const UserIDList Kpgp::Key::userIDs (  )  const [inline]

Returns the list of userIDs.

Definition at line 810 of file kpgpkey.h.


Member Data Documentation

bool Kpgp::Key::mCanCertify [protected]

Definition at line 682 of file kpgpkey.h.

bool Kpgp::Key::mCanEncrypt [protected]

Definition at line 680 of file kpgpkey.h.

bool Kpgp::Key::mCanSign [protected]

Definition at line 681 of file kpgpkey.h.

bool Kpgp::Key::mDisabled [protected]

Definition at line 678 of file kpgpkey.h.

EncryptPref Kpgp::Key::mEncryptPref [protected]

Definition at line 684 of file kpgpkey.h.

bool Kpgp::Key::mExpired [protected]

Definition at line 677 of file kpgpkey.h.

bool Kpgp::Key::mInvalid [protected]

Definition at line 679 of file kpgpkey.h.

bool Kpgp::Key::mRevoked [protected]

Definition at line 676 of file kpgpkey.h.

bool Kpgp::Key::mSecret [protected]

Definition at line 674 of file kpgpkey.h.

SubkeyList Kpgp::Key::mSubkeys [protected]

Definition at line 686 of file kpgpkey.h.

UserIDList Kpgp::Key::mUserIDs [protected]

Definition at line 687 of file kpgpkey.h.


The documentation for this class was generated from the following files:
  • kpgpkey.h
  • kpgpkey.cpp

libkpgp

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal