aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/encryptjob.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* qt: Support writing/reading signed/encrypted files directly to/from fileIngo Klöcker2023-12-211-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/job.cpp (EncryptJob, SignJob, SignEncryptJob): Move definition of constructor and destructor and inclusion of the moc file to the corresponding .cpp files. * lang/qt/src/encryptjob.cpp (EncryptJob): Define constructor. Define destructor as default. Include moc file. * lang/qt/src/encryptjob.cpp, lang/qt/src/encryptjob.h (EncryptJob): Add member functions setRecipients, recipients, setInputFile, inputFile, setOutputFile, outputFile, setEncryptionFlags, encryptionFlags. * lang/qt/src/encryptjob_p.h (EncryptJobPrivate): Add members m_recipients, m_inputFilePath, m_outputFilePath, m_encryptionFlags. * lang/qt/src/qgpgmeencryptjob.cpp (encrypt_to_filename): New. (QGpgMEEncryptJobPrivate::startIt): Start the job with the values from the member variables. * lang/qt/src/qgpgmesignencryptjob.cpp (sign_encrypt_to_filename): New. (QGpgMESignEncryptJobPrivate::startIt): Start the job with the values from the member variables. * lang/qt/src/qgpgmesignjob.cpp (class QGpgMESignJobPrivate): New. (QGpgMESignJob::QGpgMESignJob): Instantiate private job class. (sign_to_filename): New. * lang/qt/src/signencryptjob.cpp (SignEncryptJob): Define constructor. Define destructor as default. Include moc file. * lang/qt/src/signencryptjob.cpp, lang/qt/src/signencryptjob.h (SignEncryptJob): Add member functions setSigners, signers, setRecipients, recipients, setInputFile, inputFile, setOutputFile, outputFile, setEncryptionFlags, encryptionFlags. * lang/qt/src/signencryptjob_p.h (SignEncryptJobPrivate): Add members m_signers, m_recipients, m_inputFilePath, m_outputFilePath, m_encryptionFlags. * lang/qt/src/signjob.cpp: New. * lang/qt/src/signjob.h (SignJob): Add member functions setSigners, signers, setInputFile, inputFile, setOutputFile, outputFile, setSigningFlags, signingFlags. * lang/qt/src/signjob_p.h: New. * lang/qt/tests/Makefile.am: Add new test programs. * lang/qt/tests/run-encryptjob.cpp: New. * lang/qt/tests/run-signjob.cpp: New. -- This makes it possible to tell gpg to read the input and write the output directly to a specified file bypassing GpgME's Data IO when signing and/or encrypting a file. GnuPG-bug-id: 6550
* qt: Add setInputEncoding to QGpgMe::EncryptJobCarl Schwan2023-08-031-0/+12
| | | | | | | | | | | | | | | | * lang/qt/src/encryptjob.cpp, lang/qt/src/encryptjob.h, lang/qt/src/encryptjob_p.h: Add inputEncoding/setInputEncoding to EncryptJob * lang/qt/src/qgpgmeencryptjob.cpp: Use newly added inputEncoding to set encoding hint of the encrypted content -- This allows applications like KMail to set the input encoding of the encrypted content, which simplify and improve the performance of identifying the content type then decrypting it. GnuPG-bug-id: 6616 Signed-off-by: Carl Schwan <[email protected]>
* qt: Explicitly instantiate private job classesIngo Klöcker2023-01-041-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/changeexpiryjob_p.h, lang/qt/src/encryptjob_p.h, lang/qt/src/importjob_p.h, lang/qt/src/listallkeysjob_p.h, lang/qt/src/signencryptjob_p.h: New. * lang/qt/src/changeexpiryjob.cpp, lang/qt/src/encryptjob.cpp, lang/qt/src/importjob.cpp, lang/qt/src/listallkeysjob.cpp, lang/qt/src/signencryptjob.cpp: Move JobPrivate subclasses to the new private header files. * lang/qt/src/job_p.h (jobPrivate): Remove lazy instantiation of private job classes. * lang/qt/src/qgpgmechangeexpiryjob.cpp (class QGpgMEChangeExpiryJobPrivate): New. (QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob): Instantiate private job class. * lang/qt/src/qgpgmeencryptjob.cpp (class QGpgMEEncryptJobPrivate): New. (QGpgMEEncryptJob::QGpgMEEncryptJob): Instantiate private job class. * lang/qt/src/qgpgmeimportjob.cpp (class QGpgMEImportJobPrivate): New. (QGpgMEImportJob::QGpgMEImportJob): Instantiate private job class. * lang/qt/src/qgpgmelistallkeysjob.cpp (class QGpgMEListAllKeysJobPrivate): New. (QGpgMEListAllKeysJob::QGpgMEListAllKeysJob): Instantiate private job class. * lang/qt/src/qgpgmesignencryptjob.cpp (class QGpgMESignEncryptJobPrivate): New. (QGpgMESignEncryptJob::QGpgMESignEncryptJob): Instantiate private job class. -- We need private job classes corresponding to the concrete leaf classes. This makes the lazy instantiation of the private classes by the job interface classes impossible. GnuPG-bug-id: 6323
* qt: Allow setting the file name of encrypted dataIngo Klöcker2022-07-051-0/+61
* lang/qt/src/Makefile.am (qgpgme_sources): Add encryptjob.cpp. * lang/qt/src/encryptjob.cpp: New. * lang/qt/src/encryptjob.h (class EncryptJob): Add member functions setFileName, fileName. * lang/qt/src/qgpgmeencryptjob.cpp (encrypt): Set file name of input. (encrypt_qba, QGpgMEEncryptJob::exec, QGpgMEEncryptJob::start): Pass file name to encrypt resp. encrypt_qba. -- This makes it possible to store the original name of an encrypted file in the encryption result. GnuPG-bug-id: 6056