Sailfish Crypto
API DocumentationKeyPairGenerationParameters Class
(Sailfish::Crypto::KeyPairGenerationParameters)Encapsulates parameters related to the generation of an asymmetric cryptographic key pair More...
Header: | #include <Crypto/keypairgenerationparameters.h> |
Instantiated By: | KeyPairGenerationParameters |
Inherited By: | Sailfish::Crypto::DhKeyPairGenerationParameters, Sailfish::Crypto::DsaKeyPairGenerationParameters, Sailfish::Crypto::EcKeyPairGenerationParameters, and Sailfish::Crypto::RsaKeyPairGenerationParameters |
Public Types
enum | KeyPairType { KeyPairUnknown, KeyPairCustom, KeyPairDh, KeyPairDsa, ..., LastKeyPairType } |
Properties
- customParameters : QVariantMap
- keyPairType : KeyPairType
Public Functions
KeyPairGenerationParameters() | |
KeyPairGenerationParameters(const KeyPairGenerationParameters &other) | |
virtual | ~KeyPairGenerationParameters() |
QVariantMap | customParameters() const |
virtual bool | isValid() const |
KeyPairType | keyPairType() const |
void | setCustomParameters(const QVariantMap ¶ms) |
void | setKeyPairType(KeyPairType type) |
QVariantMap | subclassParameters() const |
KeyPairGenerationParameters & | operator=(const KeyPairGenerationParameters &other) |
Detailed Description
Encapsulates parameters related to the generation of an asymmetric cryptographic key pair
This class encapsulates a variety of parameters which will affect how the crypto plugin generates a key pair when fulfilling a GenerateStoredKeyRequest.
This base class is only useful for plugin-specific key-pair generation (where the keyPairType() is specified to be KeyPairGenerationParameters::KeyPairCustom and the client has specified a variety of customParameters()).
Most clients will want to use one of the derived types such as EcKeyPairGenerationParameters, RsaKeyPairGenerationParameters, DsaKeyPairGenerationParameters or DhKeyPairGenerationParameters.
Property Documentation
customParameters : QVariantMap
Access functions:
QVariantMap | customParameters() const |
void | setCustomParameters(const QVariantMap ¶ms) |
keyPairType : KeyPairType
Access functions:
KeyPairType | keyPairType() const |
void | setKeyPairType(KeyPairType type) |
Member Function Documentation
KeyPairGenerationParameters::KeyPairGenerationParameters()
Constructs a new, empty KeyPairGenerationParameters instance
KeyPairGenerationParameters::KeyPairGenerationParameters(const KeyPairGenerationParameters &other)
Constructs a copy of the other KeyPairGenerationParameters instance
[virtual]
KeyPairGenerationParameters::~KeyPairGenerationParameters()
Destroys the KeyPairGenerationParameters instance
QVariantMap KeyPairGenerationParameters::customParameters() const
Returns the plugin-specific custom parameters which will be used during key generation
Note: Getter function for property customParameters.
See also setCustomParameters().
[virtual]
bool KeyPairGenerationParameters::isValid() const
Returns true if enough parameters have been provided so that the plugin can generate a key pair
This is assumed to be true if the keyPairType() is KeyPairGenerationParameters::KeyPairCustom and some customParameters() exist, otherwise the validity of the parameters depends on the type of key pair to be generated and the specific values specified as parameters for generating that type of key pair.
Note that this function cannot determine whether the individual parameters themselves are valid or invalid, as no assumptions about parameter validity are encoded within the client API; hence the plugin may still return an error for parameters which are deemed valid (since they exist) but are erroneously specified (e.g. a prime number which isn't prime).
KeyPairType KeyPairGenerationParameters::keyPairType() const
Returns the type of key pair which should be generated
Note: Getter function for property keyPairType.
See also setKeyPairType().
void KeyPairGenerationParameters::setCustomParameters(const QVariantMap ¶ms)
Sets the plugin-specific custom parameters to be used during key generation to params
Note: Setter function for property customParameters.
See also customParameters().
void KeyPairGenerationParameters::setKeyPairType(KeyPairType type)
Sets the type of key pair which should be generated to type
Note: Setter function for property keyPairType.
See also keyPairType().
QVariantMap KeyPairGenerationParameters::subclassParameters() const
Returns the algorithm-specific parameters which will be used during key generation
KeyPairGenerationParameters &KeyPairGenerationParameters::operator=(const KeyPairGenerationParameters &other)
Assigns the other KeyPairGenerationParameters instance to this