KDE PIM / Developers / API Docs / libkpgp

Kpgp::Key Class Reference

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

#include <kpgpkey.h>

List of all members.

Public Member Functions

Protected Attributes


Detailed Description

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


Constructor & Destructor Documentation

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

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


Member Function Documentation

void Kpgp::Key::clear (   ) 
 

Clears/resets all key data.

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

Returns true if the key is a secret key.

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

Returns true if the key has been revoked.

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

Returns true if the key has expired.

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

Returns true if the key has been disabled.

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

Returns true if the key is invalid.

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

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

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

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

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

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

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

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

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

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

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

Sets the flag if the key has expired to expired.

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

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

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

Sets the flag if the key is invalid to invalid.

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

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

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

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

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

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

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

Returns the encryption preference for this key.

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

Sets the encryption preference for this key to encrPref.

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

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

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

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

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

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

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

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

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

Returns the creation date of the primary subkey.

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.

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

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

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.

bool Kpgp::Key::isValid (   )  const
 

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

not revoked, expired, disabled or invalid.

bool Kpgp::Key::isValidEncryptionKey (   )  const
 

Returns true if the key is a valid encryption key.

The trust is not checked.

bool Kpgp::Key::isValidSigningKey (   )  const
 

Returns true if the key is a valid signing key.

The trust is not checked.

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

Returns the list of userIDs.

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

Returns the list of subkeys.

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.

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

Adds the given user ID to the key.

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.

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.

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

Adds the given subkey to the key.

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

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

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

Sets the fingerprint of the given subkey to fpr.


The documentation for this class was generated from the following files: