Sailfish Crypto
API DocumentationRsaKeyPairGenerationParameters Class
(Sailfish::Crypto::RsaKeyPairGenerationParameters)Encapsulates parameters related to the generation of an asymmetric cryptographic key pair based on the RSA algorithm More...
Header: | #include <Crypto/keypairgenerationparameters.h> |
Inherits: | KeyPairGenerationParameters |
Properties
- modulusLength : int
- numberPrimes : int
- publicExponent : quint64
- 2 properties inherited from Sailfish::Crypto::KeyPairGenerationParameters
Public Functions
RsaKeyPairGenerationParameters() | |
RsaKeyPairGenerationParameters(const KeyPairGenerationParameters &other) | |
~RsaKeyPairGenerationParameters() | |
int | modulusLength() const |
int | numberPrimes() const |
quint64 | publicExponent() const |
void | setModulusLength(int length) |
void | setNumberPrimes(int primes) |
void | setPublicExponent(quint64 exponent) |
RsaKeyPairGenerationParameters & | operator=(const RsaKeyPairGenerationParameters &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 RSA 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 4096-bit RSA key pair follows. Note that the default public exponent is defined as 65537 and the default number of primes is 2, so the last two lines are not required but are included for illustration purposes.
Sailfish::Crypto::RsaKeyPairGenerationParameters rsakpgParams; rsakpgParams.setModulusLength(4096); rsakpgParams.setPublicExponent(65537); rsakpgParams.setNumberPrimes(2);
Property Documentation
modulusLength : int
Access functions:
int | modulusLength() const |
void | setModulusLength(int length) |
numberPrimes : int
Access functions:
int | numberPrimes() const |
void | setNumberPrimes(int primes) |
publicExponent : quint64
Access functions:
quint64 | publicExponent() const |
void | setPublicExponent(quint64 exponent) |
Member Function Documentation
RsaKeyPairGenerationParameters::RsaKeyPairGenerationParameters()
Constructs a new, default RsaKeyPairGenerationParameters instance
RsaKeyPairGenerationParameters::RsaKeyPairGenerationParameters(const KeyPairGenerationParameters &other)
Constructs a copy of the other KeyPairGenerationParameters instance
RsaKeyPairGenerationParameters::~RsaKeyPairGenerationParameters()
Destroys the RsaKeyPairGenerationParameters instance
[virtual]
bool RsaKeyPairGenerationParameters::isValid() const
int RsaKeyPairGenerationParameters::modulusLength() const
Returns the modulus length of the RSA key pair to be generated
This defines the security size of the output key.
Note: Getter function for property modulusLength.
See also setModulusLength().
int RsaKeyPairGenerationParameters::numberPrimes() const
Sets the number of prime factors in the key as per RFC3447
The default value is 2. Having more than this reduces the security of the key but allows faster performance during operations.
Note: Getter function for property numberPrimes.
See also setNumberPrimes().
quint64 RsaKeyPairGenerationParameters::publicExponent() const
Returns the public exponent to use when generating the key
The default value is 65537. Other common values include 3, 5, 7, 17, and 257, although any prime number is sufficient.
Note: Getter function for property publicExponent.
See also setPublicExponent().
void RsaKeyPairGenerationParameters::setModulusLength(int length)
Sets the modulus length of the RSA key pair to be generated to length
Note: Setter function for property modulusLength.
See also modulusLength().
void RsaKeyPairGenerationParameters::setNumberPrimes(int primes)
Sets the number of prime factors in the key as per RFC3447 to primes
Note: Setter function for property numberPrimes.
See also numberPrimes().
void RsaKeyPairGenerationParameters::setPublicExponent(quint64 exponent)
Sets the public exponent to use when generating the key to exponent
Note: Setter function for property publicExponent.
See also publicExponent().
RsaKeyPairGenerationParameters &RsaKeyPairGenerationParameters::operator=(const RsaKeyPairGenerationParameters &other)
Assigns the other RsaKeyPairGenerationParameters to this instance