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

libkpgp

  • Kpgp
  • Key
Public Member Functions | Protected Attributes | List of all members
Kpgp::Key Class Reference

#include <kpgpkey.h>

Public Member Functions

 Key (const KeyID &keyid=KeyID(), const QString &uid=QString(), const bool secret=false)
 
 ~Key ()
 
void addSubkey (const KeyID &keyID, const bool secret=false)
 
void addSubkey (const Subkey *subkey)
 
void addUserID (const QString &uid, const Validity validity=KPGP_VALIDITY_UNKNOWN, const bool revoked=false, const bool invalid=false)
 
void addUserID (const UserID *userID)
 
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
 
Validity keyTrust () const
 
Validity keyTrust (const QString &uid) 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
 

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
 

Detailed Description

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

Definition at line 506 of file kpgpkey.h.

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
keyidKey ID for this Key
uidUID for this key (user ID)
secretIs this key secret?

Definition at line 87 of file kpgpkey.cpp.

Kpgp::Key::~Key ( )

Definition at line 107 of file kpgpkey.cpp.

Member Function Documentation

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 222 of file kpgpkey.cpp.

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

Adds the given subkey to the key.

Definition at line 836 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 200 of file kpgpkey.cpp.

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

Adds the given user ID to the key.

Definition at line 830 of file kpgpkey.h.

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

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

Definition at line 722 of file kpgpkey.h.

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

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

Definition at line 712 of file kpgpkey.h.

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

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

Definition at line 717 of file kpgpkey.h.

void Kpgp::Key::clear ( )

Clears/resets all key data.

Definition at line 117 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 168 of file kpgpkey.cpp.

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

Returns the creation date of the primary subkey.

Definition at line 822 of file kpgpkey.h.

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

Returns true if the key has been disabled.

Definition at line 702 of file kpgpkey.h.

EncryptPref Kpgp::Key::encryptionPreference ( )
inline

Returns the encryption preference for this key.

Definition at line 767 of file kpgpkey.h.

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

Returns true if the key has expired.

Definition at line 697 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 230 of file kpgpkey.cpp.

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

Returns true if the key is invalid.

Definition at line 707 of file kpgpkey.h.

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

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

Definition at line 817 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 180 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 187 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 194 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 137 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 151 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 209 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 797 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 787 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 777 of file kpgpkey.h.

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

Returns true if the key has been revoked.

Definition at line 692 of file kpgpkey.h.

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

Returns true if the key is a secret key.

Definition at line 687 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 762 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 752 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 757 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 742 of file kpgpkey.h.

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

Sets the encryption preference for this key to encrPref .

Definition at line 772 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 737 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 252 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 747 of file kpgpkey.h.

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

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

Parameters
revokedWhether the key is revoked or not
See also
revoked()

Definition at line 732 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
secretWhether this key is secret or not
See also
secret()

Definition at line 727 of file kpgpkey.h.

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

Returns the list of subkeys.

Definition at line 812 of file kpgpkey.h.

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

Returns the list of userIDs.

Definition at line 807 of file kpgpkey.h.

Member Data Documentation

bool Kpgp::Key::mCanCertify
protected

Definition at line 679 of file kpgpkey.h.

bool Kpgp::Key::mCanEncrypt
protected

Definition at line 677 of file kpgpkey.h.

bool Kpgp::Key::mCanSign
protected

Definition at line 678 of file kpgpkey.h.

bool Kpgp::Key::mDisabled
protected

Definition at line 675 of file kpgpkey.h.

EncryptPref Kpgp::Key::mEncryptPref
protected

Definition at line 681 of file kpgpkey.h.

bool Kpgp::Key::mExpired
protected

Definition at line 674 of file kpgpkey.h.

bool Kpgp::Key::mInvalid
protected

Definition at line 676 of file kpgpkey.h.

bool Kpgp::Key::mRevoked
protected

Definition at line 673 of file kpgpkey.h.

bool Kpgp::Key::mSecret
protected

Definition at line 671 of file kpgpkey.h.

SubkeyList Kpgp::Key::mSubkeys
protected

Definition at line 683 of file kpgpkey.h.

UserIDList Kpgp::Key::mUserIDs
protected

Definition at line 684 of file kpgpkey.h.


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

KDE's Doxygen guidelines are available online.

libkpgp

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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