Qt Cryptographic Architecture
QCA::RSAPrivateKey Class Reference

#include <QtCrypto>

Collaboration diagram for QCA::RSAPrivateKey:

Public Member Functions

BigInteger d () const
BigInteger e () const
BigInteger n () const
BigInteger p () const
BigInteger q () const
 RSAPrivateKey ()
 RSAPrivateKey (const BigInteger &n, const BigInteger &e, const BigInteger &p, const BigInteger &q, const BigInteger &d, const QString &provider=QString())
Public Member Functions inherited from QCA::PrivateKey
bool canDecrypt () const
bool canEncrypt () const
bool canSign () const
bool decrypt (const SecureArray &in, SecureArray *out, EncryptionAlgorithm alg)
SymmetricKey deriveKey (const PublicKey &theirs)
SecureArray encrypt (const SecureArray &a, EncryptionAlgorithm alg)
int maximumEncryptSize (EncryptionAlgorithm alg) const
PrivateKeyoperator= (const PrivateKey &from)
 PrivateKey ()
 PrivateKey (const PrivateKey &from)
 PrivateKey (const QString &fileName, const SecureArray &passphrase=SecureArray())
QByteArray signature ()
QByteArray signMessage (const MemoryRegion &a, SignatureAlgorithm alg, SignatureFormat format=DefaultFormat)
void startSign (SignatureAlgorithm alg, SignatureFormat format=DefaultFormat)
SecureArray toDER (const SecureArray &passphrase=SecureArray(), PBEAlgorithm pbe=PBEDefault) const
DHPrivateKey toDH () const
DSAPrivateKey toDSA () const
QString toPEM (const SecureArray &passphrase=SecureArray(), PBEAlgorithm pbe=PBEDefault) const
bool toPEMFile (const QString &fileName, const SecureArray &passphrase=SecureArray(), PBEAlgorithm pbe=PBEDefault) const
RSAPrivateKey toRSA () const
void update (const MemoryRegion &a)
Public Member Functions inherited from QCA::PKey
int bitSize () const
bool canExport () const
bool canKeyAgree () const
bool isDH () const
bool isDSA () const
bool isNull () const
bool isPrivate () const
bool isPublic () const
bool isRSA () const
bool operator!= (const PKey &a) const
PKeyoperator= (const PKey &from)
bool operator== (const PKey &a) const
 PKey ()
 PKey (const PKey &from)
PrivateKey toPrivateKey () const
PublicKey toPublicKey () const
Type type () const
Public Member Functions inherited from QCA::Algorithm
 Algorithm (const Algorithm &from)
void change (const QString &type, const QString &provider)
void change (Provider::Context *c)
Provider::Contextcontext ()
const Provider::Contextcontext () const
Algorithmoperator= (const Algorithm &from)
Providerprovider () const
Provider::ContexttakeContext ()
QString type () const

Additional Inherited Members

Public Types inherited from QCA::PKey
enum  Type { RSA , DSA , DH }
Static Public Member Functions inherited from QCA::PrivateKey
static PrivateKey fromDER (const SecureArray &a, const SecureArray &passphrase=SecureArray(), ConvertResult *result=nullptr, const QString &provider=QString())
static PrivateKey fromPEM (const QString &s, const SecureArray &passphrase=SecureArray(), ConvertResult *result=nullptr, const QString &provider=QString())
static PrivateKey fromPEMFile (const QString &fileName, const SecureArray &passphrase=SecureArray(), ConvertResult *result=nullptr, const QString &provider=QString())
static QList< PBEAlgorithmsupportedPBEAlgorithms (const QString &provider=QString())
Static Public Member Functions inherited from QCA::PKey
static QList< TypesupportedIOTypes (const QString &provider=QString())
static QList< TypesupportedTypes (const QString &provider=QString())
Protected Member Functions inherited from QCA::PrivateKey
 PrivateKey (const QString &type, const QString &provider)
Protected Member Functions inherited from QCA::PKey
 PKey (const QString &type, const QString &provider)
void set (const PKey &k)
DHPrivateKey toDHPrivateKey () const
DHPublicKey toDHPublicKey () const
DSAPrivateKey toDSAPrivateKey () const
DSAPublicKey toDSAPublicKey () const
RSAPrivateKey toRSAPrivateKey () const
RSAPublicKey toRSAPublicKey () const
Protected Member Functions inherited from QCA::Algorithm
 Algorithm ()
 Algorithm (const QString &type, const QString &provider)

Detailed Description

RSA Private Key.

Constructor & Destructor Documentation

◆ RSAPrivateKey() [1/2]

QCA::RSAPrivateKey::RSAPrivateKey ( )

Generate an empty RSA private key.

◆ RSAPrivateKey() [2/2]

QCA::RSAPrivateKey::RSAPrivateKey ( const BigInteger & n,
const BigInteger & e,
const BigInteger & p,
const BigInteger & q,
const BigInteger & d,
const QString & provider = QString() )

Generate an RSA private key from specified parameters.

Parameters
nthe public key value
ethe public key exponent
pone of the two chosen primes
qthe other of the two chosen primes
dinverse of the exponent, modulo (p-1)(q-1)
providerthe provider to use, if a particular provider is required

References d(), e(), n(), p(), QCA::Algorithm::provider(), and q().

Member Function Documentation

◆ n()

BigInteger QCA::RSAPrivateKey::n ( ) const

The public key value.

This value is the actual public key value (the product of p and q, the random prime numbers used to generate the RSA key), also known as the public modulus.

Referenced by RSAPrivateKey().

◆ e()

BigInteger QCA::RSAPrivateKey::e ( ) const

The public key exponent.

This value is the exponent chosen in the original key generator step

Referenced by RSAPrivateKey().

◆ p()

BigInteger QCA::RSAPrivateKey::p ( ) const

One of the two random primes used to generate the private key.

Referenced by RSAPrivateKey().

◆ q()

BigInteger QCA::RSAPrivateKey::q ( ) const

The second of the two random primes used to generate the private key.

Referenced by RSAPrivateKey().

◆ d()

BigInteger QCA::RSAPrivateKey::d ( ) const

The inverse of the exponent, module (p-1)(q-1).

Referenced by RSAPrivateKey().


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