Search for usage in LXR

QCA::PKeyBase Class Referenceabstract

#include <QtCrypto>

Inheritance diagram for QCA::PKeyBase:


void finished ()

Public Member Functions

 PKeyBase (Provider *p, const QString &type)
virtual int bits () const =0
virtual bool canExport () const =0
virtual void convertToPublic ()=0
virtual bool decrypt (const SecureArray &in, SecureArray *out, EncryptionAlgorithm alg)
virtual SymmetricKey deriveKey (const PKeyBase &theirs)
virtual SecureArray encrypt (const SecureArray &in, EncryptionAlgorithm alg)
virtual QByteArray endSign ()
virtual bool endVerify (const QByteArray &sig)
virtual bool isNull () const =0
virtual bool isPrivate () const =0
virtual int maximumEncryptSize (EncryptionAlgorithm alg) const
virtual void startSign (SignatureAlgorithm alg, SignatureFormat format)
virtual void startVerify (SignatureAlgorithm alg, SignatureFormat format)
virtual PKey::Type type () const =0
virtual void update (const MemoryRegion &in)

Additional Inherited Members

- Protected Member Functions inherited from QCA::BasicContext
 BasicContext (Provider *parent, const QString &type)
 BasicContext (const BasicContext &from)

Detailed Description

Public key implementation provider base.

This class is part of the provider plugin interface and should not be used directly by applications. You probably want PKey, PublicKey, or PrivateKey instead.

Definition at line 522 of file qcaprovider.h.

Constructor & Destructor Documentation

QCA::PKeyBase::PKeyBase ( Provider p,
const QString type 

Standard constructor.

pthe Provider associated with this context
typetype of key provided by this context

Member Function Documentation

virtual int QCA::PKeyBase::bits ( ) const
pure virtual

Returns the number of bits in the key.

virtual bool QCA::PKeyBase::canExport ( ) const
pure virtual

Returns true if the components of this key are accessible and whether it can be serialized into an output format.

Private keys from a smart card device will often not be exportable.

virtual void QCA::PKeyBase::convertToPublic ( )
pure virtual

If the key is a private key, this function will convert it into a public key (all private key data includes the public data as well, which is why this is possible).

If the key is already a public key, then this function has no effect.

virtual bool QCA::PKeyBase::decrypt ( const SecureArray in,
SecureArray out,
EncryptionAlgorithm  alg 

Decrypt data.

inthe input data to decrypt
outpointer to an array to store the plaintext result
algthe encryption algorithm used to generate the input data
virtual SymmetricKey QCA::PKeyBase::deriveKey ( const PKeyBase theirs)

Compute a symmetric key based on this private key and some other public key.

Essentially for Diffie-Hellman only.

theirsthe other side (public key) to be used for key generation.
virtual SecureArray QCA::PKeyBase::encrypt ( const SecureArray in,
EncryptionAlgorithm  alg 

Encrypt data.

inthe input data to encrypt
algthe encryption algorithm to use
virtual QByteArray QCA::PKeyBase::endSign ( )

Complete a signing operation, and return the signature value.

If there is an error signing, an empty array is returned.

virtual bool QCA::PKeyBase::endVerify ( const QByteArray sig)

Complete a verify operation, and return true if successful.

If there is an error verifying, this function returns false.

sigthe signature to verify with the input data
void QCA::PKeyBase::finished ( )

Emitted when an asynchronous operation completes on this key.

Such operations will be documented that they emit this signal.

virtual bool QCA::PKeyBase::isNull ( ) const
pure virtual

Returns true if this object is not valid.

This is the default state, and the object may also become this state if a conversion or generation function fails.

virtual bool QCA::PKeyBase::isPrivate ( ) const
pure virtual

Returns true if this is a private key, otherwise false.

virtual int QCA::PKeyBase::maximumEncryptSize ( EncryptionAlgorithm  alg) const

Returns the maximum number of bytes that can be encrypted by this key.

algthe algorithm to be used for encryption
virtual void QCA::PKeyBase::startSign ( SignatureAlgorithm  alg,
SignatureFormat  format 

Begin a signing operation.

algthe signature algorithm to use
formatthe signature format to use
virtual void QCA::PKeyBase::startVerify ( SignatureAlgorithm  alg,
SignatureFormat  format 

Begin a verify operation.

algthe signature algorithm used by the input signature
formatthe signature format used by the input signature
virtual PKey::Type QCA::PKeyBase::type ( ) const
pure virtual

Returns the type of public key.

virtual void QCA::PKeyBase::update ( const MemoryRegion in)

Process the plaintext input data for either signing or verifying, whichever operation is active.

inthe input data to process

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Apr 22 2021 23:04:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.