Qt Cryptographic Architecture
|
Go to the documentation of this file.
33 #ifndef QCA_SECUREMESSAGE_H
34 #define QCA_SECUREMESSAGE_H
45 class SecureMessageSystem;
169 QSharedDataPointer<Private> d;
257 QSharedDataPointer<Private> d;
789 friend class Private;
851 explicit OpenPGP(
QObject *parent =
nullptr,
const QString &provider = QString());
897 explicit CMS(
QObject *parent =
nullptr,
const QString &provider = QString());
bool success() const
Indicates whether or not the operation was successful or failed.
QByteArray read()
Read the available data.
IdentityResult
The result of identity verification.
Definition: qca_securemessage.h:191
SecureMessage(SecureMessageSystem *system)
Create a new secure message.
void setPrivateKeys(const SecureMessageKeyList &keys)
Set the private keys to use for the messages built using this CMS object.
QString diagnosticText() const
Returns a log of technical information about the operation, which may be useful for presenting to the...
SecureMessageSignature(const SecureMessageSignature &from)
Standard copy constructor.
Error errorCode() const
Returns the failure code.
SecureMessageKeyList recipientKeys() const
Return the recipient(s) set for this message with setRecipient() or setRecipients()
Type type() const
The Type of secure message.
void end()
Complete an operation.
bool wasSigned() const
Test if the message was signed.
CertificateCollection untrustedCertificates() const
Return the untrusted certificates set for this object.
@ OpenPGP
a Pretty Good Privacy message
Definition: qca_securemessage.h:329
bool canClearsign() const
True if the SecureMessageSystem can clearsign messages.
int bytesAvailable() const
The number of bytes available to be read.
bool canSignMultiple() const
Test if the message type supports multiple (parallel) signatures.
SecureMessageKey()
Construct an empty key.
void setRecipients(const SecureMessageKeyList &keys)
Set the list of recipients for an encrypted message.
Definition: qca_securemessage.h:55
Error
Errors for secure messages.
Definition: qca_securemessage.h:356
bool canSignAndEncrypt() const
True if the SecureMessageSystem can both sign and encrypt (in the same operation).
QString name() const
The name associated with this key.
void setSMIMEAttributesEnabled(bool b)
For CMS only, this will put extra attributes into the message related to S/MIME, such as the preferre...
IdentityResult identityResult() const
get the results of the identity check on this signature
Definition: qca_securemessage.h:887
CertificateCollection trustedCertificates() const
Return the trusted certificates set for this object.
@ ErrorEncryptUntrusted
encrypting key is untrusted
Definition: qca_securemessage.h:362
Definition: qca_publickey.h:827
bool smimeAttributesEnabled() const
Returns true if inclusion of S/MIME attributes is enabled.
@ InvalidSignature
valid key provided, but signature failed
Definition: qca_securemessage.h:193
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:41
QList< SecureMessageSignature > SecureMessageSignatureList
A list of signatures.
Definition: qca_securemessage.h:263
Definition: qca_core.h:1152
SecureMessageKeyList privateKeys() const
Return the private keys set for this object.
@ Valid
indentity is verified, matches signature
Definition: qca_securemessage.h:192
void setBundleSignerEnabled(bool b)
For CMS only, this will bundle the signer certificate chain into the message.
SecureMessageKeyList signerKeys() const
Return the signer(s) set for this message with setSigner() or setSigners()
void startVerify(const QByteArray &detachedSig=QByteArray())
Start a verification operation.
@ Binary
DER/binary.
Definition: qca_securemessage.h:348
@ ErrorCertKeyMismatch
certificate and private key don't match
Definition: qca_securemessage.h:365
void startSign(SignMode m=Message)
@ ErrorSignerInvalid
signing key is invalid in some way
Definition: qca_securemessage.h:360
void setX509CertificateChain(const CertificateChain &c)
Set the public key part of this X.509 key.
void update(const QByteArray &in)
Process a message (or the next part of a message) in the current operation.
Definition: qca_cert.h:1891
@ ErrorFormat
input format was bad
Definition: qca_securemessage.h:358
Definition: qca_securemessage.h:804
bool verifySuccess() const
Verify that the message signature is correct.
SecureMessageSignature & operator=(const SecureMessageSignature &from)
Standard assignment operator.
SecureMessageKey key() const
get the key associated with this signature
bool isNull() const
Returns true for null object.
Definition: qca_securemessage.h:185
void setSigner(const SecureMessageKey &key)
Set the signer for a signed message.
SecureMessageSystem(QObject *parent, const QString &type, const QString &provider)
Protected constructor for SecureMessageSystem classes.
@ InvalidKey
invalid key provided
Definition: qca_securemessage.h:194
void setTrustedCertificates(const CertificateCollection &trusted)
Set the trusted certificates to use for the messages built using this CMS object.
@ ErrorEncryptExpired
encrypting key is expired
Definition: qca_securemessage.h:361
@ ErrorPassphrase
passphrase was either wrong or not provided
Definition: qca_securemessage.h:357
Definition: qca_cert.h:1208
bool waitForFinished(int msecs=30000)
Block until the operation (encryption, decryption, signing or verifying) completes.
void setX509KeyBundle(const KeyBundle &kb)
Set the public and private part of this X.509 key with KeyBundle.
@ ErrorSignerExpired
signing key is expired
Definition: qca_securemessage.h:359
@ ErrorNeedCard
pgp card is missing
Definition: qca_securemessage.h:364
void readyRead()
This signal is emitted when there is some data to read.
Format
Formats for secure messages.
Definition: qca_securemessage.h:347
@ ErrorSignatureExpired
signature is expired
Definition: qca_securemessage.h:368
@ Clearsign
the message is clear signed
Definition: qca_securemessage.h:339
SecureMessageSignature(IdentityResult r, Validity v, const SecureMessageKey &key, const QDateTime &ts)
Create a signature check object.
void setPGPPublicKey(const PGPKey &pub)
Set the public key part of a PGP key.
OpenPGP(QObject *parent=nullptr, const QString &provider=QString())
Standard constructor.
Definition: qca_securemessage.h:321
void bytesWritten(int bytes)
This signal is emitted when data has been accepted by the message processor.
void setX509PrivateKey(const PrivateKey &k)
Set the private key part of this X.509 key.
Definition: qca_cert.h:2136
Type
The type of secure message.
Definition: qca_securemessage.h:328
Validity keyValidity() const
get the results of the key validation check on this signature
CertificateChain x509CertificateChain() const
The X.509 certificate chain (public part) for this key.
void reset()
Reset the object state to that of original construction.
PGPKey pgpSecretKey() const
Private key part of a PGP key.
SecureMessageSignatureList signers() const
Information on the signers for the message.
QByteArray signature() const
The signature for the message.
@ ErrorUnknown
other error
Definition: qca_securemessage.h:366
SecureMessageKey & operator=(const SecureMessageKey &from)
Standard assignment operator.
void setPGPSecretKey(const PGPKey &sec)
Set the private key part of a PGP key.
Definition: qca_securemessage.h:841
Type type() const
The key type.
@ ErrorSignerRevoked
signing key is revoked
Definition: qca_securemessage.h:367
CMS(QObject *parent=nullptr, const QString &provider=QString())
Standard constructor.
void setSigners(const SecureMessageKeyList &keys)
Set the list of signers for a signed message.
QList< SecureMessageKey > SecureMessageKeyList
A list of message keys.
Definition: qca_securemessage.h:175
bool bundleSignerEnabled() const
Returns true if bundling of the signer certificate chain is enabled.
@ ErrorEncryptInvalid
encrypting key is invalid in some way
Definition: qca_securemessage.h:363
@ Message
the message includes the signature
Definition: qca_securemessage.h:338
SecureMessageKey(const SecureMessageKey &from)
Standard copy constructor.
PrivateKey x509PrivateKey() const
The X.509 private key part of this key.
Definition: qca_cert.h:2361
SecureMessageSignature()
Create an empty signature check object.
bool havePrivate() const
Test if this key contains a private key part.
QString hashName() const
The name of the hash used for the signature process.
Format format() const
Return the format type set for this message.
void setFormat(Format f)
Set the Format used for messages.
Validity
The validity (or otherwise) of a certificate.
Definition: qca_cert.h:490
SecureMessageSignature signer() const
Information on the signer for the message.
@ None
no key
Definition: qca_securemessage.h:62
void startSignAndEncrypt()
Start a combined signing and encrypting operation.
@ PGP
Pretty Good Privacy key.
Definition: qca_securemessage.h:63
PGPKey pgpPublicKey() const
Public key part of a PGP key.
void setUntrustedCertificates(const CertificateCollection &untrusted)
Set the untrusted certificates to use for the messages built using this CMS object.
QDateTime timestamp() const
get the timestamp associated with this signature
void setRecipient(const SecureMessageKey &key)
Set the recipient for an encrypted message.
void finished()
This signal is emitted when the message is fully processed.
Type
The key type.
Definition: qca_securemessage.h:61
SignMode
The type of message signature.
Definition: qca_securemessage.h:337