Qt Cryptographic Architecture
|
Go to the documentation of this file.
38 #include <QStringList>
40 #include <QSharedData>
41 #include <QSharedDataPointer>
94 class CertificateCollection;
99 class KeyStoreManager;
151 QCA_EXPORT
void init();
219 QCA_EXPORT
bool isSupported(
const char *features,
const QString &provider = QString());
229 QCA_EXPORT
bool isSupported(
const QStringList &features,
const QString &provider = QString());
423 QCA_EXPORT
void setProperty(
const QString &name,
const QVariant &value);
432 QCA_EXPORT QVariant
getProperty(
const QString &name);
442 QCA_EXPORT
void setProviderConfig(
const QString &name,
const QVariantMap &config);
481 QCA_EXPORT Logger *
logger();
493 #define QCA_logTextMessage(message, severity) \
495 QCA::Logger::Severity s = severity; \
496 QCA::Logger *l = QCA::logger (); \
497 if (s <= l->level ()) { \
498 l->logTextMessage (message, s); \
512 #define QCA_logBinaryMessage(blob, severity) \
514 QCA::Logger::Severity s = severity; \
515 QCA::Logger *l = QCA::logger (); \
516 if (s <= l->level ()) { \
517 l->logBinaryMessage (blob, s); \
571 QCA_EXPORT
void setAppName(
const QString &name);
593 QCA_EXPORT QString
arrayToHex(
const QByteArray &array);
620 QCA_EXPORT QByteArray
hexToArray(
const QString &hexString);
646 QCA_EXPORT QByteArray
base64ToArray(
const QString &base64String);
709 : _min( min ), _max(max), _multiple( multiple )
731 const int _min, _max, _multiple;
786 virtual int version()
const;
818 virtual QString name()
const = 0;
835 virtual QStringList features()
const = 0;
847 virtual QString credit()
const;
875 virtual Context *createContext(
const QString &type) = 0;
901 virtual QVariantMap defaultConfig()
const;
912 virtual void configChanged(
const QVariantMap &config);
938 QString type()
const;
943 virtual Context *clone()
const = 0;
953 bool sameProvider(
const Context *c)
const;
1044 virtual void clear() = 0;
1100 virtual void clear() = 0;
1121 virtual bool ok()
const = 0;
1170 QString type()
const;
1213 void change(
const QString &type,
const QString &provider);
1234 Algorithm(
const QString &type,
const QString &provider);
1238 QSharedDataPointer<Private> d;
1284 bool isWeakDESKey();
1449 bool isNull()
const;
1459 Source source()
const;
1468 PasswordStyle passwordStyle()
const;
1490 QString fileName()
const;
1510 void setPasswordKeyStore(PasswordStyle pstyle,
const KeyStoreInfo &keyStoreInfo,
const KeyStoreEntry &keyStoreEntry,
void *ptr);
1523 void setPasswordData(PasswordStyle pstyle,
const QString &fileName,
void *ptr);
1540 QSharedDataPointer<Private> d;
1589 void submitPassword(
int id,
const SecureArray &password);
1600 void tokenOkay(
int id);
1611 void reject(
int id);
1623 void eventReady(
int id,
const QCA::Event &context);
1629 friend class Private;
1690 void waitForResponse();
1700 bool accepted()
const;
1715 void responseReady();
1721 friend class Private;
1768 void waitForResponse();
1775 bool accepted()
const;
1784 void responseReady();
1790 friend class Private;
Source
Source of the event
Definition: qca_core.h:1401
QCA_EXPORT void unloadAllPlugins()
Unload the current plugins.
Definition: qca_support.h:954
Definition: qca_core.h:1375
Direction
Direction settings for symmetric algorithms.
Definition: qca_core.h:140
QCA_EXPORT bool haveSecureMemory()
Test if secure storage memory is available.
Definition: qca_keystore.h:140
@ StylePassword
User should be prompted for a "Password".
Definition: qca_core.h:1417
Definition: qca_keystore.h:623
@ Practical
mlock and drop root if available, else mmap
Definition: qca_core.h:129
Definition: qca_core.h:749
QCA_EXPORT CertificateCollection systemStore()
Get system-wide root Certificate Authority (CA) certificates.
QCA_EXPORT Provider * findProvider(const QString &name)
Return the named provider, or 0 if not found.
QCA_EXPORT void scanForPlugins()
Scan for new plugins.
Definition: qca_core.h:1734
MemoryMode
Mode settings for memory allocation.
Definition: qca_core.h:127
QCA_EXPORT void init()
Initialise QCA.
QCA_EXPORT QStringList defaultFeatures()
Generate a list of the built in features.
Definition: qca_core.h:1560
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.
QCA_EXPORT void setProperty(const QString &name, const QVariant &value)
Set a global property.
@ KeyStore
KeyStore generated the event.
Definition: qca_core.h:1403
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:48
@ Encode
Operate in the "forward" direction; for example, encrypting.
Definition: qca_core.h:142
Definition: qca_core.h:1148
@ Decode
Operate in the "reverse" direction; for example, decrypting.
Definition: qca_core.h:143
Definition: qca_core.h:1248
QCA_EXPORT int qcaPatchVersion()
The current version of QCA.
@ StylePassphrase
User should be prompted for a "Passphrase".
Definition: qca_core.h:1418
QCA_EXPORT QString arrayToBase64(const QByteArray &array)
Convert a byte array to printable base64 representation.
QCA_EXPORT void appendPluginDiagnosticText(const QString &text)
Add plugin diagnostic text.
@ LockingKeepPrivileges
mlock, retaining root privileges
Definition: qca_core.h:131
Definition: qca_core.h:1294
QCA_EXPORT void saveProviderConfig(const QString &name)
Save provider configuration to persistent storage.
QCA_EXPORT QByteArray hexToArray(const QString &hexString)
Convert a QString containing a hexadecimal representation of a byte array into a QByteArray.
QCA_EXPORT int qcaMajorVersion()
The current version of QCA.
QCA_EXPORT QString globalRandomProvider()
Return the name of the global random number provider.
QCA_EXPORT QStringList supportedFeatures()
Generate a list of all the supported features in plugins, and in built in capabilities.
@ Password
Asking for a password, PIN or passphrase.
Definition: qca_core.h:1385
QCA_EXPORT QStringList pluginPaths()
Retrieve plugin paths.
QCA_EXPORT QVariantMap getProviderConfig(const QString &name)
Retrieve provider configuration.
const QCA_EXPORT char * qcaVersionStr()
The current version of QCA.
QCA_EXPORT QByteArray base64ToArray(const QString &base64String)
Convert a QString containing a base64 representation of a byte array into a QByteArray.
QCA_EXPORT QString appName()
Get the application name that will be used by SASL server mode.
int minimum() const
Obtain the minimum length for the key, in bytes.
Definition: qca_core.h:715
Context(Provider *parent, const QString &type)
Standard constructor.
QCA_EXPORT Logger * logger()
Return a reference to the QCA Logger, which is used for diagnostics and error recording.
Definition: qca_tools.h:316
QCA_EXPORT bool haveSystemStore()
Test if QCA can access the root CA certificates.
int multiple() const
Return the number of bytes that the key must be a multiple of.
Definition: qca_core.h:728
Definition: qca_core.h:1642
QCA_EXPORT QVariant getProperty(const QString &name)
Retrieve a global property.
QCA_EXPORT QString pluginDiagnosticText()
Retrieve plugin diagnostic text.
PasswordStyle
password variation
Definition: qca_core.h:1415
QCA_EXPORT void setProviderPriority(const QString &name, int priority)
Change the priority of a specified provider.
QCA_EXPORT bool unloadProvider(const QString &name)
Unload specified provider.
QCA_EXPORT Provider * defaultProvider()
Return the default provider.
Definition: qca_core.h:1092
QCA_EXPORT QString arrayToHex(const QByteArray &array)
Convert a byte array to printable hexadecimal representation.
QCA_EXPORT void setProviderConfig(const QString &name, const QVariantMap &config)
Set provider configuration.
Definition: qca_core.h:659
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
Test if a capability (algorithm) is available.
QCA_EXPORT void deinit()
Clean up routine.
KeyLength(int min, int max, int multiple)
Construct a KeyLength object.
Definition: qca_core.h:708
Definition: qca_tools.h:90
Type
Type of event
Definition: qca_core.h:1383
QCA_EXPORT int qcaVersion()
The current version of QCA.
QCA_EXPORT bool haveSecureRandom()
Test if secure random is available.
QList< Provider * > ProviderList
Convenience representation for the plugin providers.
Definition: qca_core.h:100
Definition: qca_core.h:1331
Definition: qca_core.h:994
Definition: qca_core.h:697
Definition: qca_core.h:1036
QCA_EXPORT void setGlobalRandomProvider(const QString &provider)
Change the global random number provider.
QCA_EXPORT int qcaMinorVersion()
The current version of QCA.
int maximum() const
Obtain the maximum length for the key, in bytes.
Definition: qca_core.h:720
@ Locking
mlock and drop root
Definition: qca_core.h:130
QCA_EXPORT void clearPluginDiagnosticText()
Clear plugin diagnostic text.
QCA_EXPORT ProviderList providers()
Return a list of the current providers.
QCA_EXPORT void setAppName(const QString &name)
Set the application name that will be used by SASL server mode.