ImagingTools Core SDK
Public Member Functions | List of all members
imtcom::ISslConfigurationApplierabstract

Interface for applying SSL-related settings to an SSL configuration. More...

#include <ISslConfigurationApplier.h>

Inherits istd::IPolymorphic.

Inherited by imtcom::CSslConfigurationAdapterComp [virtual].

Public Member Functions

virtual bool LoadLocalCertificateFromFile (const QString &path, QSsl::EncodingFormat format=QSsl::Pem) const =0
 Loads a local SSL certificate from the specified file and applies it to the underlying SSL configuration.
 
virtual bool LoadPrivateKeyFromFile (const QString &path, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format=QSsl::Pem, const QByteArray &passPhrase={}) const =0
 Loads a private key from the specified file and applies it to the underlying SSL configuration.
 
virtual bool LoadCaCertificatesFromFile (const QString &path, QSsl::EncodingFormat format=QSsl::Pem) const =0
 Loads one or more Certificate Authority (CA) certificates from the specified file and applies them to the underlying SSL configuration.
 
virtual bool SetPeerVerifyMode (QSslSocket::PeerVerifyMode mode) const =0
 Sets the peer verification mode for the underlying SSL configuration.
 
virtual bool SetSslProtocol (QSsl::SslProtocol protocol) const =0
 Sets the SSL/TLS protocol version for the underlying SSL configuration.
 

Detailed Description

Interface for applying SSL-related settings to an SSL configuration.

The ISslConfigurationApplier interface defines a write-only contract for applying SSL-related parameters to an existing SSL configuration.

Implementations of this interface translate high-level SSL settings (such as certificates, private keys, CA chains, protocols, and peer verification modes) into a concrete SSL configuration representation used by networking components.

This interface does not own or expose a \l QSslConfiguration instance. Instead, it applies changes to an underlying configuration managed elsewhere (for example, by an ISslConfigurationManager or a similar component).

Typical use cases include configuring SSL settings via configuration files, command-line parameters, or UI-driven setup flows.

Note
Implementations are expected to be idempotent where possible and to perform validation of input parameters before applying them.
See also
QSslConfiguration, QSslSocket

Definition at line 41 of file ISslConfigurationApplier.h.

Member Function Documentation

◆ LoadCaCertificatesFromFile()

bool imtcom::ISslConfigurationApplier::LoadCaCertificatesFromFile ( const QString &  path,
QSsl::EncodingFormat  format = QSsl::Pem 
) const
pure virtual

Loads one or more Certificate Authority (CA) certificates from the specified file and applies them to the underlying SSL configuration.

The file may contain multiple CA certificates. All successfully parsed certificates are applied and used for peer verification.

Parameters
pathPath to the CA certificate file.
formatEncoding format of the certificate data.
Returns
true if at least one CA certificate was successfully applied; otherwise returns false.

◆ LoadLocalCertificateFromFile()

bool imtcom::ISslConfigurationApplier::LoadLocalCertificateFromFile ( const QString &  path,
QSsl::EncodingFormat  format = QSsl::Pem 
) const
pure virtual

Loads a local SSL certificate from the specified file and applies it to the underlying SSL configuration.

The certificate file may be encoded in PEM or DER format. If the file contains multiple certificates, the first one is used as the local certificate.

Parameters
pathPath to the certificate file.
formatEncoding format of the certificate data.
Returns
true if the certificate was successfully applied; otherwise returns false.

◆ LoadPrivateKeyFromFile()

bool imtcom::ISslConfigurationApplier::LoadPrivateKeyFromFile ( const QString &  path,
QSsl::KeyAlgorithm  algorithm,
QSsl::EncodingFormat  format = QSsl::Pem,
const QByteArray &  passPhrase = {} 
) const
pure virtual

Loads a private key from the specified file and applies it to the underlying SSL configuration.

The private key may be encrypted. In this case, the provided passphrase is used to decrypt the key.

Parameters
pathPath to the private key file.
algorithmAlgorithm used by the private key (for example, RSA or EC).
formatEncoding format of the key data.
passPhrasePassphrase used to decrypt the private key.
Returns
true if the private key was successfully applied; otherwise returns false.
See also
QSslKey

◆ SetPeerVerifyMode()

bool imtcom::ISslConfigurationApplier::SetPeerVerifyMode ( QSslSocket::PeerVerifyMode  mode) const
pure virtual

Sets the peer verification mode for the underlying SSL configuration.

This setting controls how peer certificates are verified during the SSL/TLS handshake.

Parameters
modePeer verification mode to apply.
Returns
true if the verification mode was successfully applied; otherwise returns false.
See also
QSslSocket::PeerVerifyMode

◆ SetSslProtocol()

bool imtcom::ISslConfigurationApplier::SetSslProtocol ( QSsl::SslProtocol  protocol) const
pure virtual

Sets the SSL/TLS protocol version for the underlying SSL configuration.

This setting determines which SSL/TLS protocol versions are allowed during connection establishment.

Parameters
protocolSSL/TLS protocol to apply.
Returns
true if the protocol was successfully applied; otherwise returns false.
See also
QSsl::SslProtocol