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 Crypto

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

  • Properties
  • Public Functions
  • Reimplemented Public Functions
  • Detailed Description

DsaKeyPairGenerationParameters Class

(Sailfish::Crypto::DsaKeyPairGenerationParameters)

Encapsulates parameters related to the generation of an asymmetric cryptographic key pair based on the DSA algorithm More...

Header: #include <Crypto/keypairgenerationparameters.h>
Inherits: KeyPairGenerationParameters
  • List of all members, including inherited members

Properties

  • base : QByteArray
  • generateFamilyParameters : bool
  • modulus : QByteArray
  • modulusLength : int
  • primeFactor : QByteArray
  • primeFactorLength : int
  • 2 properties inherited from Sailfish::Crypto::KeyPairGenerationParameters

Public Functions

DsaKeyPairGenerationParameters()
DsaKeyPairGenerationParameters(const KeyPairGenerationParameters &other)
~DsaKeyPairGenerationParameters()
QByteArray base() const
bool generateFamilyParameters() const
QByteArray modulus() const
int modulusLength() const
QByteArray primeFactor() const
int primeFactorLength() const
void setBase(const QByteArray &g)
void setGenerateFamilyParameters(bool generate)
void setModulus(const QByteArray &p)
void setModulusLength(int length)
void setPrimeFactor(const QByteArray &q)
void setPrimeFactorLength(int length)
DsaKeyPairGenerationParameters &operator=(const DsaKeyPairGenerationParameters &other)

Reimplemented Public Functions

virtual bool isValid() const
  • 7 public functions inherited from Sailfish::Crypto::KeyPairGenerationParameters

Detailed Description

Encapsulates parameters related to the generation of an asymmetric cryptographic key pair based on the DSA algorithm

This class encapsulates a variety of parameters which will affect how the crypto plugin generates a key pair. Usually, an instance of this class will be used when performing a GenerateStoredKeyRequest.

An example of parameters to generate a 3072-bit DSA key pair using the key family parameters specified in FIPS-186-3 follows:

 Sailfish::Crypto::DsaKeyPairGenerationParameters dsakpgParams;
 dsakpgParams.setModulusLength(3072);
 dsakpgParams.setPrimeFactorLength(256);
 dsakpgParams.setGenerateFamilyParameters(false);

Alternatively, the algorithm parameters may be specified explicitly via setting the modulus(), primeFactor() and base() values:

 Sailfish::Crypto::DsaKeyPairGenerationParameters dsakpgParams;
 dsakpgParams.setModulus(modulusData);
 dsakpgParams.setPrimeFactor(primeFactorData);
 dsakpgParams.setBase(baseData);

Property Documentation

base : QByteArray

Access functions:

QByteArray base() const
void setBase(const QByteArray &g)

generateFamilyParameters : bool

Access functions:

bool generateFamilyParameters() const
void setGenerateFamilyParameters(bool generate)

modulus : QByteArray

Access functions:

QByteArray modulus() const
void setModulus(const QByteArray &p)

modulusLength : int

Access functions:

int modulusLength() const
void setModulusLength(int length)

primeFactor : QByteArray

Access functions:

QByteArray primeFactor() const
void setPrimeFactor(const QByteArray &q)

primeFactorLength : int

Access functions:

int primeFactorLength() const
void setPrimeFactorLength(int length)

Member Function Documentation

DsaKeyPairGenerationParameters::DsaKeyPairGenerationParameters()

Constructs a new DsaKeyPairGenerationParameters instance

DsaKeyPairGenerationParameters::DsaKeyPairGenerationParameters(const KeyPairGenerationParameters &other)

Constructs a copy of the other instance

DsaKeyPairGenerationParameters::~DsaKeyPairGenerationParameters()

Destroys the instance

QByteArray DsaKeyPairGenerationParameters::base() const

Returns the base generator to be used when generating the key pair

The base is also known as the generator G.

Note: Getter function for property base.

See also setBase().

bool DsaKeyPairGenerationParameters::generateFamilyParameters() const

Returns true if the key should be generated using randomly-generated key family parameters

The individual parameters (modulus (prime p), prime factor (subprime q), and base (generator g)) define the key family. In order for the algorithm to work, both parties need to use the same parameters in order for their (randomly generated public and private) keys to belong to the same family (and thus work).

If this value is true, the client wants the plugin to generate a key pair using randomly generated key family parameters; otherwise, the client wants the plugin to generate a key pair using the standard key family values specified in FIPS 186-3.

This value is only meaningful if the client has provided a modulusLength() and primeFactorLength(), and is ignored if the client has instead provided a modulus(), primeFactor() and base().

Note: Getter function for property generateFamilyParameters.

See also setGenerateFamilyParameters().

[virtual] bool DsaKeyPairGenerationParameters::isValid() const

Reimplemented from KeyPairGenerationParameters::isValid().

Returns true if the parameters contains either a valid modulus, prime factor, and base, or alternatively a valid modulus length and prime factor length.

QByteArray DsaKeyPairGenerationParameters::modulus() const

Returns the modulus to be used when generating the key pair

The modulus is also known as the large prime P.

Note: Getter function for property modulus.

See also setModulus().

int DsaKeyPairGenerationParameters::modulusLength() const

Returns the modulus length of the DSA key pair to be generated

This defines the security size of the output key.

Note that this parameter is only meaningful if the client has not provided explicit values for the modulus(), primeFactor() and base().

Note: Getter function for property modulusLength.

See also setModulusLength().

QByteArray DsaKeyPairGenerationParameters::primeFactor() const

Returns the prime factor to be used when generating the key pair

The prime factor is also known as the small prime Q.

Note: Getter function for property primeFactor.

See also setPrimeFactor().

int DsaKeyPairGenerationParameters::primeFactorLength() const

Returns the prime factor length of the DSA key pair to be generated

This is the length (in bits) of the prime-factor (q). Note that FIPS 186-3 specifies some standard prime factor lengths for certain modulus lengths, along with standardised key family parameters.

Note that this parameter is only meaningful if the client has not provided explicit values for the modulus(), primeFactor() and base().

Note: Getter function for property primeFactorLength.

See also setPrimeFactorLength().

void DsaKeyPairGenerationParameters::setBase(const QByteArray &g)

Sets the base generator to be used when generating the key pair to g

Note: Setter function for property base.

See also base().

void DsaKeyPairGenerationParameters::setGenerateFamilyParameters(bool generate)

Sets whether the key should be generated using randomly-generated key family parameters to generate

Note: Setter function for property generateFamilyParameters.

See also generateFamilyParameters().

void DsaKeyPairGenerationParameters::setModulus(const QByteArray &p)

Sets the modulus to be used when generating the key pair to p

Note: Setter function for property modulus.

See also modulus().

void DsaKeyPairGenerationParameters::setModulusLength(int length)

Sets the modulus length of the DSA key pair to be generated to length

Note: Setter function for property modulusLength.

See also modulusLength().

void DsaKeyPairGenerationParameters::setPrimeFactor(const QByteArray &q)

Sets the prime factor to be used when generating the key pair to q

Note: Setter function for property primeFactor.

See also primeFactor().

void DsaKeyPairGenerationParameters::setPrimeFactorLength(int length)

Sets the prime factor length of the DSA key pair to be generated to length

Note: Setter function for property primeFactorLength.

See also primeFactorLength().

DsaKeyPairGenerationParameters &DsaKeyPairGenerationParameters::operator=(const DsaKeyPairGenerationParameters &other)

Assigns the other parameters to this instance

  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn