QCA::PGPKey

Search for usage in LXR

#include <QtCrypto>

Inheritance diagram for QCA::PGPKey:

Public Member Functions

 PGPKey ()
 
 PGPKey (const PGPKey &from)
 
 PGPKey (const QString &fileName)
 
QDateTime creationDate () const
 
QDateTime expirationDate () const
 
QString fingerprint () const
 
bool inKeyring () const
 
bool isNull () const
 
bool isSecret () const
 
bool isTrusted () const
 
QString keyId () const
 
PGPKeyoperator= (const PGPKey &from)
 
QString primaryUserId () const
 
QByteArray toArray () const
 
bool toFile (const QString &fileName) const
 
QString toString () const
 
QStringList userIds () const
 
- Public Member Functions inherited from QCA::Algorithm
 Algorithm (const Algorithm &from)
 
void change (const QString &type, const QString &provider)
 
void change (Provider::Context *c)
 
Provider::Contextcontext ()
 
const Provider::Contextcontext () const
 
Algorithmoperator= (const Algorithm &from)
 
Providerprovider () const
 
Provider::ContexttakeContext ()
 
QString type () const
 

Static Public Member Functions

static PGPKey fromArray (const QByteArray &a, ConvertResult *result=nullptr, const QString &provider=QString())
 
static PGPKey fromFile (const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
 
static PGPKey fromString (const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
 

Additional Inherited Members

- Protected Member Functions inherited from QCA::Algorithm
 Algorithm ()
 
 Algorithm (const QString &type, const QString &provider)
 

Detailed Description

Pretty Good Privacy key.

This holds either a reference to an item in a real PGP keyring, or a standalone item created using the from*() functions.

Note that with the latter method, the key is of no use besides being informational. The key must be in a keyring (that is, inKeyring() == true) to actually do crypto with it.

Definition at line 2406 of file qca_cert.h.

Constructor & Destructor Documentation

◆ PGPKey() [1/3]

QCA::PGPKey::PGPKey ( )

Create an empty PGP key.

◆ PGPKey() [2/3]

QCA::PGPKey::PGPKey ( const QString & fileName)

Create a PGP key from an encoded file.

Parameters
fileNamethe name (and path, if required) of the file that the PGP key is to be loaded from.
See also
fromFile for a version that allows better error checking / validation
toFile for a method to write out the key.

◆ PGPKey() [3/3]

QCA::PGPKey::PGPKey ( const PGPKey & from)

Standard copy constructor.

Parameters
fromthe PGPKey to use as the source

Member Function Documentation

◆ creationDate()

QDateTime QCA::PGPKey::creationDate ( ) const

The creation date for the key.

◆ expirationDate()

QDateTime QCA::PGPKey::expirationDate ( ) const

The expiration date for the key.

◆ fingerprint()

QString QCA::PGPKey::fingerprint ( ) const

The key fingerpint.

This will return the PGP fingerprint as a string. It comprises 40 hex digits, without spaces.

◆ fromArray()

static PGPKey QCA::PGPKey::fromArray ( const QByteArray & a,
ConvertResult * result = nullptr,
const QString & provider = QString() )
static

Import the key from an array.

Parameters
athe array to import from
resultif not null, this will be set to the result of the import process
providerthe provider to use, if a particular provider is required

◆ fromFile()

static PGPKey QCA::PGPKey::fromFile ( const QString & fileName,
ConvertResult * result = nullptr,
const QString & provider = QString() )
static

Import the key from a file.

Parameters
fileNamestring containing the name of the file to import from
resultif not null, this will be set to the result of the import process
providerthe provider to use, if a particular provider is required

◆ fromString()

static PGPKey QCA::PGPKey::fromString ( const QString & s,
ConvertResult * result = nullptr,
const QString & provider = QString() )
static

Import the key from a string.

Parameters
sthe string to import from
resultif not null, this will be set to the result of the import process
providerthe provider to use, if a particular provider is required

◆ inKeyring()

bool QCA::PGPKey::inKeyring ( ) const

Test if this key is in a keyring.

Returns
true if the key is in a keyring
Note
keys that are not in a keyring cannot be used for encryption, decryption, signing or verification

◆ isNull()

bool QCA::PGPKey::isNull ( ) const

Test if the PGP key is empty (null)

Returns
true if the PGP key is null

◆ isSecret()

bool QCA::PGPKey::isSecret ( ) const

Test if the PGP key is the secret key.

Returns
true if the PGP key is the secret key

◆ isTrusted()

bool QCA::PGPKey::isTrusted ( ) const

Test if the key is trusted.

Returns
true if the key is trusted

◆ keyId()

QString QCA::PGPKey::keyId ( ) const

The Key identification for the PGP key.

◆ operator=()

PGPKey & QCA::PGPKey::operator= ( const PGPKey & from)

Standard assignment operator.

Parameters
fromthe PGPKey to use as the source

◆ primaryUserId()

QString QCA::PGPKey::primaryUserId ( ) const

The primary user identification for the key.

◆ toArray()

QByteArray QCA::PGPKey::toArray ( ) const

Export the key to an array.

This will export the key in a binary format (that is, not in an "ascii armoured" form).

See also
fromArray for a static import method.
toString for an "ascii armoured" export method.

◆ toFile()

bool QCA::PGPKey::toFile ( const QString & fileName) const

Export the key to a file.

Parameters
fileNamethe name of the file to save the key to

◆ toString()

QString QCA::PGPKey::toString ( ) const

Export the key to a string.

This will export the key in an "ascii armoured" form.

See also
fromString for a static import method.
toArray for a binary format export method.

◆ userIds()

QStringList QCA::PGPKey::userIds ( ) const

The list of all user identifications associated with the key.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:09:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.