37 #include <QStringList>
39 #include <QSharedData>
40 #include <QSharedDataPointer>
93 class CertificateCollection;
98 class KeyStoreManager;
150 QCA_EXPORT
void init();
218 QCA_EXPORT
bool isSupported(
const char *features,
const QString &provider = QString());
228 QCA_EXPORT
bool isSupported(
const QStringList &features,
const QString &provider = QString());
422 QCA_EXPORT
void setProperty(
const QString &name,
const QVariant &value);
431 QCA_EXPORT QVariant
getProperty(
const QString &name);
441 QCA_EXPORT
void setProviderConfig(
const QString &name,
const QVariantMap &config);
480 QCA_EXPORT Logger *
logger();
492 #define QCA_logTextMessage(message, severity) \
494 register QCA::Logger::Severity s = severity; \
495 register QCA::Logger *l = QCA::logger (); \
496 if (s <= l->level ()) { \
497 l->logTextMessage (message, s); \
511 #define QCA_logBinaryMessage(blob, severity) \
513 register QCA::Logger::Severity s = severity; \
514 register QCA::Logger *l = QCA::logger (); \
515 if (s <= l->level ()) { \
516 l->logBinaryMessage (blob, s); \
570 QCA_EXPORT
void setAppName(
const QString &name);
592 QCA_EXPORT QString
arrayToHex(
const QByteArray &array);
619 QCA_EXPORT QByteArray
hexToArray(
const QString &hexString);
682 : _min( min ), _max(max), _multiple( multiple )
704 const int _min, _max, _multiple;
759 virtual int version()
const;
791 virtual QString name()
const = 0;
808 virtual QStringList features()
const = 0;
820 virtual QString credit()
const;
848 virtual Context *createContext(
const QString &type) = 0;
874 virtual QVariantMap defaultConfig()
const;
885 virtual void configChanged(
const QVariantMap &config);
911 QString type()
const;
916 virtual Context *clone()
const = 0;
926 bool sameProvider(
const Context *c)
const;
936 Context(
Provider *parent,
const QString &type);
943 Context(
const Context &from);
947 Context & operator=(
const Context &from);
1017 virtual void clear() = 0;
1073 virtual void clear() = 0;
1094 virtual bool ok()
const = 0;
1143 QString type()
const;
1186 void change(
const QString &type,
const QString &provider);
1207 Algorithm(
const QString &type,
const QString &provider);
1211 QSharedDataPointer<Private> d;
1257 bool isWeakDESKey();
1385 bool isNull()
const;
1395 Source source()
const;
1404 PasswordStyle passwordStyle()
const;
1426 QString fileName()
const;
1446 void setPasswordKeyStore(PasswordStyle pstyle,
const KeyStoreInfo &keyStoreInfo,
const KeyStoreEntry &keyStoreEntry,
void *ptr);
1459 void setPasswordData(PasswordStyle pstyle,
const QString &fileName,
void *ptr);
1476 QSharedDataPointer<Private> d;
1525 void submitPassword(
int id,
const SecureArray &password);
1536 void tokenOkay(
int id);
1547 void reject(
int id);
1559 void eventReady(
int id,
const QCA::Event &context);
1565 friend class Private;
1626 void waitForResponse();
1636 bool accepted()
const;
1651 void responseReady();
1657 friend class Private;
1704 void waitForResponse();
1711 bool accepted()
const;
1720 void responseReady();
1726 friend class Private;
An asynchronous event.
Definition: qca_core.h:1311
QCA_EXPORT Logger * logger()
Return a reference to the QCA Logger, which is used for diagnostics and error recording.
General superclass for an algorithm.
Definition: qca_core.h:1121
QCA_EXPORT void setProviderConfig(const QString &name, const QVariantMap &config)
Set provider configuration.
QCA_EXPORT void appendPluginDiagnosticText(const QString &text)
Add plugin diagnostic text.
QCA_EXPORT void deinit()
Clean up routine.
A simple logging system.
Definition: qca_support.h:954
QCA_EXPORT QStringList supportedFeatures()
Generate a list of all the supported features in plugins, and in built in capabilities.
QCA_EXPORT bool haveSecureRandom()
Test if secure random is available.
QCA_EXPORT void clearPluginDiagnosticText()
Clear plugin diagnostic text.
KeyLength(int min, int max, int multiple)
Construct a KeyLength object.
Definition: qca_core.h:681
Header file with QCA version.
QCA_EXPORT QString pluginDiagnosticText()
Retrieve plugin diagnostic text.
User password / passphrase / PIN handler.
Definition: qca_core.h:1578
QCA_EXPORT void setProviderPriority(const QString &name, int priority)
Change the priority of a specified provider.
Source
Source of the event
Definition: qca_core.h:1337
QCA_EXPORT void scanForPlugins()
Scan for new plugins.
Algorithm provider.
Definition: qca_core.h:722
Key store information, outside of a KeyStore object.
Definition: qca_keystore.h:623
Interface class for password / passphrase / PIN and token handlers.
Definition: qca_core.h:1496
QCA_EXPORT bool haveSystemStore()
Test if QCA can access the root CA certificates.
Header file for "support" classes used in QCA.
QCA_EXPORT void setAppName(const QString &name)
Set the application name that will be used by SASL server mode.
Asking for a password, PIN or passphrase.
Definition: qca_core.h:1321
QCA_EXPORT ProviderList providers()
Return a list of the current providers.
int maximum() const
Obtain the maximum length for the key, in bytes.
Definition: qca_core.h:693
QCA_EXPORT void unloadAllPlugins()
Unload the current plugins.
QCA_EXPORT QVariantMap getProviderConfig(const QString &name)
Retrieve provider configuration.
QCA_EXPORT const char * qcaVersionStr()
The current version of QCA.
QList< Provider * > ProviderList
Convenience representation for the plugin providers.
Definition: qca_core.h:99
General superclass for buffered computation algorithms.
Definition: qca_core.h:1009
Container for keys for symmetric encryption algorithms.
Definition: qca_core.h:1221
QCA_EXPORT bool unloadProvider(const QString &name)
Unload specified provider.
Simple container for acceptable key lengths.
Definition: qca_core.h:670
QCA_EXPORT Provider * defaultProvider()
Return the default provider.
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
Test if a capability (algorithm) is available.
User should be prompted for a "Passphrase".
Definition: qca_core.h:1354
PasswordStyle
password variation
Definition: qca_core.h:1351
Preprocessor magic to allow export of library symbols.
QCA_EXPORT QStringList defaultFeatures()
Generate a list of the built in features.
mlock and drop root
Definition: qca_core.h:129
QCA_EXPORT bool insertProvider(Provider *p, int priority=0)
Add a provider to the current list of providers.
QCA_EXPORT int providerPriority(const QString &name)
Return the priority of a specified provider.
Container for initialisation vectors and nonces.
Definition: qca_core.h:1267
int multiple() const
Return the number of bytes that the key must be a multiple of.
Definition: qca_core.h:701
mlock and drop root if available, else mmap
Definition: qca_core.h:128
Direction
Direction settings for symmetric algorithms.
Definition: qca_core.h:139
KeyStore generated the event.
Definition: qca_core.h:1339
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:47
QCA_EXPORT QStringList pluginPaths()
Retrieve plugin paths.
Type
Type of event
Definition: qca_core.h:1319
Base class to use for primitive provider contexts.
Definition: qca_core.h:967
Single entry in a KeyStore.
Definition: qca_keystore.h:140
QCA_EXPORT Provider * findProvider(const QString &name)
Return the named provider, or 0 if not found.
QCA_EXPORT CertificateCollection systemStore()
Get system-wide root Certificate Authority (CA) certificates.
int minimum() const
Obtain the minimum length for the key, in bytes.
Definition: qca_core.h:688
QCA_EXPORT QString arrayToHex(const QByteArray &array)
Convert a byte array to printable hexadecimal representation.
QCA_EXPORT void init()
Initialise QCA.
Secure array of bytes.
Definition: qca_tools.h:316
QCA_EXPORT QByteArray hexToArray(const QString &hexString)
Convert a QString containing a hexadecimal representation of a byte array into a QByteArray.
QCA_EXPORT int qcaVersion()
The current version of QCA.
User should be prompted for a "Password".
Definition: qca_core.h:1353
QCA_EXPORT int qcaMinorVersion()
The current version of QCA.
QCA_EXPORT void setGlobalRandomProvider(const QString &provider)
Change the global random number provider.
Operate in the "forward" direction; for example, encrypting.
Definition: qca_core.h:141
General superclass for filtering transformation algorithms.
Definition: qca_core.h:1065
Operate in the "reverse" direction; for example, decrypting.
Definition: qca_core.h:142
mlock, retaining root privileges
Definition: qca_core.h:130
User token handler.
Definition: qca_core.h:1670
Convenience method for initialising and cleaning up QCA.
Definition: qca_core.h:632
MemoryMode
Mode settings for memory allocation.
Definition: qca_core.h:126
QCA_EXPORT int qcaMajorVersion()
The current version of QCA.
QCA_EXPORT void saveProviderConfig(const QString &name)
Save provider configuration to persistent storage.
QCA_EXPORT QString globalRandomProvider()
Return the name of the global random number provider.
Internal context class used for the plugin.
QCA_EXPORT void setProperty(const QString &name, const QVariant &value)
Set a global property.
QCA_EXPORT QVariant getProperty(const QString &name)
Retrieve a global property.
QCA_EXPORT bool haveSecureMemory()
Test if secure storage memory is available.
QCA_EXPORT int qcaPatchVersion()
The current version of QCA.
Array of bytes that may be optionally secured.
Definition: qca_tools.h:90
QCA_EXPORT QString appName()
Get the application name that will be used by SASL server mode.