Qt Cryptographic Architecture: QCA::KeyStoreListContext Class Reference

# QCA::KeyStoreListContext Class Reference
[QCA provider API]

KeyStore provider. More...

`#include <QtCrypto>`

Inheritance diagram for QCA::KeyStoreListContext:

Collaboration diagram for QCA::KeyStoreListContext:

[legend]

List of all members.

## Signals
void | busyEnd ()
void | busyStart ()
void | diagnosticText (const QString &str)
void | storeUpdated (int id)
void | updated ()
## Public Member Functions
virtual KeyStoreEntryContext * | entry (int id, const QString &entryId)
virtual QList < KeyStoreEntryContext * > | entryList (int id)=0
virtual KeyStoreEntryContext * | entryPassive (const QString &serialized)
virtual QList < KeyStoreEntry::Type > | entryTypes (int id) const =0
virtual bool | isReadOnly (int id) const
| KeyStoreListContext (Provider *p)
virtual QList< int > | keyStores ()=0
virtual QString | name (int id) const =0
virtual bool | removeEntry (int id, const QString &entryId)
virtual void | setUpdatesEnabled (bool enabled)
virtual void | start ()
virtual QString | storeId (int id) const =0
virtual KeyStore::Type | type (int id) const =0
virtual QString | writeEntry (int id, const PGPKey &key)
virtual QString | writeEntry (int id, const CRL &crl)
virtual QString | writeEntry (int id, const Certificate &cert)
virtual QString | writeEntry (int id, const KeyBundle &kb)

## Detailed Description

KeyStore provider.

Note:
  This class is part of the provider plugin interface and should not be used directly by applications. You probably want KeyStore instead.

## Constructor & Destructor Documentation

QCA::KeyStoreListContext::KeyStoreListContext | ( | Provider * | p | ) | `[inline]`

Standard constructor.

Parameters:

  | p | the Provider associated with this context

## Member Function Documentation

void QCA::KeyStoreListContext::busyEnd | ( |  | ) | `[signal]`

Emit this to leave the busy state.

When this object is first started with start(), it is assumed to be in the busy state. You must emit busyEnd() at some point, or QCA will never ask you about keystores.

void QCA::KeyStoreListContext::busyStart | ( |  | ) | `[signal]`

Emit this when the provider is busy looking for keystores.

The provider goes into a busy state when it has reason to believe there are keystores present, but it still needs to check or query some devices to see for sure.

For example, if a smart card is inserted, then the provider may immediately go into a busy state upon detecting the insert. However, it may take some seconds before the smart card information can be queried and reported by the provider. Once the card is queried successfully, the provider would leave the busy state and report the new keystore.

When this object is first started with start(), it is assumed to be in the busy state, so there is no need to emit this signal at the beginning.

void QCA::KeyStoreListContext::diagnosticText | ( | const QString & | str | ) | `[signal]`

Emitted when there is diagnostic text to report.

Parameters:

  | str | the diagnostic text

virtual KeyStoreEntryContext* QCA::KeyStoreListContext::entry | ( | int | id,
|  | const QString & | entryId |
| ) |  |  | `[virtual]`

Returns a single entry in the store, if the entry id is already known.

If the entry does not exist, the function returns 0.

The caller is responsible for deleting the returned entry object.

Parameters:

  | id | the id for the store context
  | entryId | the entry to retrieve

virtual QList<KeyStoreEntryContext*> QCA::KeyStoreListContext::entryList | ( | int | id | ) | `[pure virtual]`

Returns the entries of the store, or an empty list if the integer context id is invalid.

The caller is responsible for deleting the returned entry objects.

Parameters:

  | id | the id for the store context

virtual KeyStoreEntryContext* QCA::KeyStoreListContext::entryPassive | ( | const QString & | serialized | ) | `[virtual]`

Returns a single entry, created from the serialization string of a previous entry (using KeyStoreEntryContext::serialize()).

If the serialization string cannot be parsed by this provider, or the entry cannot otherwise be created, the function returns 0.

The caller is responsible for deleting the returned entry object.

This function must be thread-safe.

Parameters:

  | serialized | the serialized data to create the entry from

virtual QList<KeyStoreEntry::Type> QCA::KeyStoreListContext::entryTypes | ( | int | id | ) | const`[pure virtual]`

Returns the types supported by the store, or an empty list if the integer context id is invalid.

This function should return all supported types, even if the store doesn't actually contain entries for all of the types.

Parameters:

  | id | the id for the store context

virtual bool QCA::KeyStoreListContext::isReadOnly | ( | int | id | ) | const`[virtual]`

Returns true if the store is read-only.

If the integer context id is invalid, this function should return true.

Parameters:

  | id | the id for the store context

virtual QList<int> QCA::KeyStoreListContext::keyStores | ( |  | ) | `[pure virtual]`

Returns a list of integer context ids, each representing a keystore instance.

If a keystore becomes unavailable and then later becomes available again (for example, if a smart card is removed and then the same one is inserted again), the integer context id must be different than last time.

virtual QString QCA::KeyStoreListContext::name | ( | int | id | ) | const`[pure virtual]`

Returns the friendly name of the store, or an empty string if the integer context id is invalid.

Parameters:

  | id | the id for the store context

virtual bool QCA::KeyStoreListContext::removeEntry | ( | int | id,
|  | const QString & | entryId |
| ) |  |  | `[virtual]`

Remove an entry from the store.

Returns true if the entry is successfully removed, otherwise false.

Parameters:

  | id | the id for the store context
  | entryId | the entry to remove from the store

virtual void QCA::KeyStoreListContext::setUpdatesEnabled | ( | bool | enabled | ) | `[virtual]`

Enables or disables update events.

The updated() and storeUpdated() signals might not be emitted if updates are not enabled.

Parameters:

  | enabled | whether update notifications are enabled (true) or disabled (false)

virtual void QCA::KeyStoreListContext::start | ( |  | ) | `[virtual]`

Starts the keystore provider.

virtual QString QCA::KeyStoreListContext::storeId | ( | int | id | ) | const`[pure virtual]`

Returns the string id of the store, or an empty string if the integer context id is invalid.

The string id of the store should be unique to a single store, and it should persist between availability/unavailability. For example, a smart card that is removed and inserted again should have the same string id (despite having a new integer context id).

Parameters:

  | id | the id for the store context

void QCA::KeyStoreListContext::storeUpdated | ( | int | id | ) | `[signal]`

Indicates that the entry list of a keystore has changed (entries added, removed, or modified).

Parameters:

  | id | the id of the key store that has changed

virtual KeyStore::Type QCA::KeyStoreListContext::type | ( | int | id | ) | const`[pure virtual]`

Returns the type of the specified store, or -1 if the integer context id is invalid.

Parameters:

  | id | the id for the store context

void QCA::KeyStoreListContext::updated | ( |  | ) | `[signal]`

Indicates the list of keystores has changed, and that QCA should call keyStores() to obtain the latest list.

virtual QString QCA::KeyStoreListContext::writeEntry | ( | int | id,
|  | const PGPKey & | key |
| ) |  |  | `[virtual]`

Write a PGPKey to the store.

Returns the entry id of the new item, or an empty string if there was an error writing the item.

Parameters:

  | id | the id for the store context
  | key | the PGP key to add to the store

virtual QString QCA::KeyStoreListContext::writeEntry | ( | int | id,
|  | const CRL & | crl |
| ) |  |  | `[virtual]`

Write a CRL to the store.

Returns the entry id of the new item, or an empty string if there was an error writing the item.

Parameters:

  | id | the id for the store context
  | crl | the revocation list to add to the store

virtual QString QCA::KeyStoreListContext::writeEntry | ( | int | id,
|  | const Certificate & | cert |
| ) |  |  | `[virtual]`

Write a Certificate to the store.

Returns the entry id of the new item, or an empty string if there was an error writing the item.

Parameters:

  | id | the id for the store context
  | cert | the certificate to add to the store

virtual QString QCA::KeyStoreListContext::writeEntry | ( | int | id,
|  | const KeyBundle & | kb |
| ) |  |  | `[virtual]`

Write a KeyBundle to the store.

Returns the entry id of the new item, or an empty string if there was an error writing the item.

Parameters:

  | id | the id for the store context
  | kb | the key bundle to add to the store

The documentation for this class was generated from the following file:

- qcaprovider.h