QCA::Provider
#include <QtCrypto>
Classes | |
class | Context |
Public Member Functions | |
virtual void | configChanged (const QVariantMap &config) |
virtual Context * | createContext (const QString &type)=0 |
virtual QString | credit () const |
virtual QVariantMap | defaultConfig () const |
virtual void | deinit () |
virtual QStringList | features () const =0 |
virtual void | init () |
virtual QString | name () const =0 |
virtual int | qcaVersion () const =0 |
virtual int | version () const |
Detailed Description
Algorithm provider.
Provider represents a plugin provider (or as a special case, the built-in provider). This is the class you need to inherit from to create your own plugin. You don't normally need to worry about this class if you are just using existing QCA capabilities and plugins, however there is nothing stopping you from using it to obtain information about specific plugins, as shown in the example below.
- Examples
- aes-cmac.cpp, and providertest.cpp.
Definition at line 764 of file qca_core.h.
Member Function Documentation
◆ configChanged()
|
virtual |
Method to set the configuration options.
If your provider supports configuration options, you will be advised of user changes to the configuration when this method is called.
- Parameters
-
config the new configuration to be used by the provider
◆ createContext()
Routine to create a plugin context.
You need to return a pointer to an algorithm Context that corresponds with the algorithm name specified.
- Parameters
-
type the name of the algorithm required
Naturally you also need to implement the specified Context subclasses as well.
◆ credit()
|
virtual |
Optional credit text for the provider.
You might display this information in a credits or "About" dialog. Returns an empty string if the provider has no credit text. Only report credit text when absolutely required (for example, an "advertisement clause" related to licensing). Do not use it for reporting general author information.
◆ defaultConfig()
|
virtual |
Method to set up the default configuration options.
If your provider needs some configuration options, this method allows you to establish default options. The user can then change the configuration options as required, and set them using configChanged().
You need to return a QVariantMap that has configuration options as the keys, and the default configuration as the values, as shown below:
- See also
- configChanged for how to set the configuration;
◆ deinit()
|
virtual |
◆ features()
|
pure virtual |
The capabilities (algorithms) of the provider.
Typically you just return a fixed QStringList:
◆ init()
|
virtual |
Initialisation routine.
This routine will be called when your plugin is loaded, so this is a good place to do any one-off initialisation tasks. If you don't need any initialisation, just implement it as an empty routine.
◆ name()
|
pure virtual |
The name of the provider.
Typically you just return a string containing a convenient name.
- Note
- The name is used to tell if a provider is already loaded, so you need to make sure it is unique amongst the various plugins.
◆ qcaVersion()
|
pure virtual |
Target QCA version for the provider.
This is used to verify compatibility between the provider and QCA. For a provider to be used, it must supply major and minor version numbers here that are less-than or equal to the actual QCA version (the patch version number is ignored). This means an older provider may be used with a newer QCA, but a newer provider cannot be used with an older QCA.
◆ version()
|
virtual |
Version number of the plugin.
The format is the same as QCA itself. Version 1.2.3 would be represented as 0x010203.
The default returns 0 (version 0.0.0).
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:53:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.