Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

Sailfish Secrets

API Documentation
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Public Types
  • Properties
  • Public Functions
  • Reimplemented Public Functions
  • Signals
  • Detailed Description

CreateCollectionRequest Class

(Sailfish::Secrets::CreateCollectionRequest)

Allows a client request that the system secrets service create a collection for secrets storage More...

Header: #include <Secrets/createcollectionrequest.h>
Inherits: Sailfish::Secrets::Request
  • List of all members, including inherited members

Public Types

enum CollectionLockType { DeviceLock, CustomLock }

Properties

  • accessControlMode : Sailfish::Secrets::SecretManager::AccessControlMode
  • authenticationPluginName : QString
  • collectionLockType : CollectionLockType
  • collectionName : QString
  • customLockUnlockSemantic : Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic
  • deviceLockUnlockSemantic : Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic
  • encryptionPluginName : QString
  • storagePluginName : QString
  • userInteractionMode : Sailfish::Secrets::SecretManager::UserInteractionMode
  • 3 properties inherited from Sailfish::Secrets::Request

Public Functions

CreateCollectionRequest(QObject *parent = Q_NULLPTR)
~CreateCollectionRequest()
Sailfish::Secrets::SecretManager::AccessControlMode accessControlMode() const
QString authenticationPluginName() const
CollectionLockType collectionLockType() const
QString collectionName() const
Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic customLockUnlockSemantic() const
Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic deviceLockUnlockSemantic() const
QString encryptionPluginName() const
void setAccessControlMode(Sailfish::Secrets::SecretManager::AccessControlMode mode)
void setAuthenticationPluginName(const QString &pluginName)
void setCollectionLockType(CollectionLockType type)
void setCollectionName(const QString &name)
void setCustomLockUnlockSemantic(Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic semantic)
void setDeviceLockUnlockSemantic(Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic semantic)
void setEncryptionPluginName(const QString &pluginName)
void setStoragePluginName(const QString &pluginName)
void setUserInteractionMode(Sailfish::Secrets::SecretManager::UserInteractionMode mode)
QString storagePluginName() const
Sailfish::Secrets::SecretManager::UserInteractionMode userInteractionMode() const

Reimplemented Public Functions

virtual Sailfish::Secrets::SecretManager *manager() const
virtual Sailfish::Secrets::Result result() const
virtual void setManager(Sailfish::Secrets::SecretManager *manager)
virtual void startRequest()
virtual Sailfish::Secrets::Request::Status status() const
virtual void waitForFinished()
  • 6 public functions inherited from Sailfish::Secrets::Request

Signals

void accessControlModeChanged()
void authenticationPluginNameChanged()
void collectionLockTypeChanged()
void collectionNameChanged()
void customLockUnlockSemanticChanged()
void deviceLockUnlockSemanticChanged()
void encryptionPluginNameChanged()
void storagePluginNameChanged()
void userInteractionModeChanged()
  • 3 signals inherited from Sailfish::Secrets::Request

Detailed Description

Allows a client request that the system secrets service create a collection for secrets storage

This class allows clients to request the Secrets service to create a collection with the particular collectionName(), which will be stored by the storage plugin identified by its storagePluginName().

The collection may be either a device-lock protected collection or a custom-lock protected collection, and different unlock semantics may apply in each case. Creating a custom-lock collection will also require an authentication flow to be specified so that the user can enter an appropriate lock-code or pass-phrase. In either case, secrets stored in the collection will be encrypted with a key derived from the appropriate authentication code, by the encryption plugin identified by its encryptionPluginName().

If the storagePluginName() and encryptionPluginName() are specified to be the same plugin, then that plugin is assumed to be an EncryptedStoragePlugin which performs block-level encryption of the entire collection, instead of per-value encryption of individual secrets.

An accessControlMode() may also be specified for the collection, which will be enforced by the system secrets service, in order to allow or prevent other applications from reading the secret.

An example of creating a device-lock protected, block-level encrypted collection is as follows:

 Sailfish::Secrets::SecretManager sm;
 Sailfish::Secrets::CreateCollectionRequest ccr;
 ccr.setManager(&sm);
 ccr.setCollectionName(QLatin1String("ExampleCollection"));
 ccr.setAccessControlMode(Sailfish::Secrets::SecretManager::OwnerOnlyMode);
 ccr.setCollectionLockType(Sailfish::Secrets::CreateCollectionRequest::DeviceLock);
 ccr.setDeviceLockUnlockSemantic(Sailfish::Secrets::SecretManager::DeviceLockKeepUnlocked);
 ccr.setStoragePluginName(Sailfish::Secrets::SecretManager::DefaultEncryptedStoragePluginName);
 ccr.setEncryptionPluginName(Sailfish::Secrets::SecretManager::DefaultEncryptedStoragePluginName);
 ccr.startRequest(); // status() will change to Finished when complete

Member Type Documentation

enum CreateCollectionRequest::CollectionLockType

Property Documentation

accessControlMode : Sailfish::Secrets::SecretManager::AccessControlMode

Access functions:

Sailfish::Secrets::SecretManager::AccessControlMode accessControlMode() const
void setAccessControlMode(Sailfish::Secrets::SecretManager::AccessControlMode mode)

Notifier signal:

void accessControlModeChanged()

authenticationPluginName : QString

Access functions:

QString authenticationPluginName() const
void setAuthenticationPluginName(const QString &pluginName)

Notifier signal:

void authenticationPluginNameChanged()

collectionLockType : CollectionLockType

Access functions:

CollectionLockType collectionLockType() const
void setCollectionLockType(CollectionLockType type)

Notifier signal:

void collectionLockTypeChanged()

collectionName : QString

Access functions:

QString collectionName() const
void setCollectionName(const QString &name)

Notifier signal:

void collectionNameChanged()

customLockUnlockSemantic : Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic

Access functions:

Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic customLockUnlockSemantic() const
void setCustomLockUnlockSemantic(Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic semantic)

Notifier signal:

void customLockUnlockSemanticChanged()

deviceLockUnlockSemantic : Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic

Access functions:

Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic deviceLockUnlockSemantic() const
void setDeviceLockUnlockSemantic(Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic semantic)

Notifier signal:

void deviceLockUnlockSemanticChanged()

encryptionPluginName : QString

Access functions:

QString encryptionPluginName() const
void setEncryptionPluginName(const QString &pluginName)

Notifier signal:

void encryptionPluginNameChanged()

storagePluginName : QString

Access functions:

QString storagePluginName() const
void setStoragePluginName(const QString &pluginName)

Notifier signal:

void storagePluginNameChanged()

userInteractionMode : Sailfish::Secrets::SecretManager::UserInteractionMode

Access functions:

Sailfish::Secrets::SecretManager::UserInteractionMode userInteractionMode() const
void setUserInteractionMode(Sailfish::Secrets::SecretManager::UserInteractionMode mode)

Notifier signal:

void userInteractionModeChanged()

Member Function Documentation

CreateCollectionRequest::CreateCollectionRequest(QObject *parent = Q_NULLPTR)

Constructs a new CreateCollectionRequest object with the given parent.

CreateCollectionRequest::~CreateCollectionRequest()

Destroys the CreateCollectionRequest

Sailfish::Secrets::SecretManager::AccessControlMode CreateCollectionRequest::accessControlMode() const

Returns the access control mode which will be enforced for the collection

Note: Getter function for property accessControlMode.

See also setAccessControlMode().

QString CreateCollectionRequest::authenticationPluginName() const

Returns the name of the authentication plugin which the client wishes to use to authenticate the user (in order to unlock the collection)

Note: Getter function for property authenticationPluginName.

See also setAuthenticationPluginName().

CollectionLockType CreateCollectionRequest::collectionLockType() const

Returns the type of lock which will be applied to the created collection.

A collection whose lock type is CreateCollectionRequest::DeviceLock will use the device-lock code for its security, whereas a collection whose lock type is CreateCollectionRequest::CustomLock will use a separate pass phrase, PIN code, or other authentication method.

Note: Getter function for property collectionLockType.

See also setCollectionLockType().

QString CreateCollectionRequest::collectionName() const

Returns the name of the collection which the client wishes create

Note: Getter function for property collectionName.

See also setCollectionName().

Sailfish::Secrets::SecretManager::CustomLockUnlockSemantic CreateCollectionRequest::customLockUnlockSemantic() const

Returns the unlock semantic which will apply to the collection if it is protected by a custom lock.

Note: Getter function for property customLockUnlockSemantic.

See also setCustomLockUnlockSemantic().

Sailfish::Secrets::SecretManager::DeviceLockUnlockSemantic CreateCollectionRequest::deviceLockUnlockSemantic() const

Returns the unlock semantic which will apply to the collection if it is protected by the device lock.

Note: Getter function for property deviceLockUnlockSemantic.

See also setDeviceLockUnlockSemantic().

QString CreateCollectionRequest::encryptionPluginName() const

Returns the name of the encryption plugin which the client wishes to use to encrypt secrets stored in the collection

Note: When storagePluginName is the same as encryptionPluginName, then it is assumed that the user means an EncryptedStoragePlugin.

Note: Getter function for property encryptionPluginName.

See also setEncryptionPluginName().

[virtual] Sailfish::Secrets::SecretManager *CreateCollectionRequest::manager() const

See also setManager().

[virtual] Sailfish::Secrets::Result CreateCollectionRequest::result() const

void CreateCollectionRequest::setAuthenticationPluginName(const QString &pluginName)

Sets the name of the authentication plugin which the client wishes to use to authenticate the user (in order to unlock the collection) to pluginName

Note: this will only apply to collections whose collectionLockType() is CreateCollectionRequest::CustomLock.

Note: Setter function for property authenticationPluginName.

See also authenticationPluginName().

void CreateCollectionRequest::setCollectionLockType(CollectionLockType type)

Sets the type of lock which will be applied to the created collection to type

Note: Setter function for property collectionLockType.

See also collectionLockType().

void CreateCollectionRequest::setCollectionName(const QString &name)

Sets the name of the collection which the client wishes to create to name

Note: Setter function for property collectionName.

See also collectionName().

void CreateCollectionRequest::setEncryptionPluginName(const QString &pluginName)

Sets the name of the encryption plugin which the client wishes to use to encrypt secrets stored in the collection to pluginName

Note: Setter function for property encryptionPluginName.

See also encryptionPluginName().

[virtual] void CreateCollectionRequest::setManager(Sailfish::Secrets::SecretManager *manager)

See also manager().

void CreateCollectionRequest::setStoragePluginName(const QString &pluginName)

Sets the name of the storage plugin which the client wishes to use to create the collection to pluginName

Note: Setter function for property storagePluginName.

See also storagePluginName().

[virtual] void CreateCollectionRequest::startRequest()

[virtual] Sailfish::Secrets::Request::Status CreateCollectionRequest::status() const

QString CreateCollectionRequest::storagePluginName() const

Returns the name of the storage plugin which the client wishes to use to create the collection

Note: When storagePluginName is the same as encryptionPluginName, then it is assumed that the user means an EncryptedStoragePlugin.

Note: Getter function for property storagePluginName.

See also setStoragePluginName().

Sailfish::Secrets::SecretManager::UserInteractionMode CreateCollectionRequest::userInteractionMode() const

Returns the user interaction mode required when creating the collection (e.g. if a custom lock code must be requested from the user)

Note: Getter function for property userInteractionMode.

See also setUserInteractionMode().

[virtual] void CreateCollectionRequest::waitForFinished()

  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn