Subgroup: Pki

Class: QgsPkiBundle

class qgis.core.QgsPkiBundle(clientCert: QSslCertificate = QSslCertificate(), clientKey: QSslKey = QSslKey(), caChain: Iterable[QSslCertificate] = [])

Bases: sip.wrapper

Construct a bundle from existing PKI components

Parameters:
  • clientCert – Certificate to store in bundle
  • clientKey – Private key to store in bundle
  • caChain – Chain of Certificate Authorities for client certificate

QgsPkiBundle(QgsPkiBundle)

Storage set for PKI bundle: SSL certificate, key, optional CA cert chain

Note

Useful for caching the bundle during application run sessions

Methods

caChain Chain of Certificate Authorities for client certificate
certId The sha hash of the client certificate
clientCert Client certificate object
clientKey Private key object
fromPemPaths Construct a bundle of PKI components from PEM-formatted file paths
fromPkcs12Paths Construct a bundle of PKI components from a PKCS#12 file path
isNull Whether the bundle, either its certificate or private key, is null
isValid Whether the bundle is valid
setCaChain Set chain of Certificate Authorities for client certificate
setClientCert Set client certificate object
setClientKey Set private key object

Signals

Attributes

caChain(self) → List[QSslCertificate]

Chain of Certificate Authorities for client certificate

certId(self) → str

The sha hash of the client certificate

clientCert(self) → QSslCertificate

Client certificate object

clientKey(self) → QSslKey

Private key object

fromPemPaths(certPath: str, keyPath: str, keyPass: str = '', caChain: Iterable[QSslCertificate] = []) → QgsPkiBundle

Construct a bundle of PKI components from PEM-formatted file paths

Parameters:
  • certPath – Certificate file path
  • keyPath – Private key path
  • keyPass – Private key passphrase
  • caChain – Chain of Certificate Authorities for client certificate
fromPkcs12Paths(bundlepath: str, bundlepass: str = '') → QgsPkiBundle

Construct a bundle of PKI components from a PKCS#12 file path

Parameters:
  • bundlepath – Bundle file path
  • bundlepass – Optional bundle passphrase
isNull(self) → bool

Whether the bundle, either its certificate or private key, is null

isValid(self) → bool

Whether the bundle is valid

setCaChain(self, cachain: Iterable[QSslCertificate])

Set chain of Certificate Authorities for client certificate

setClientCert(self, cert: QSslCertificate)

Set client certificate object

setClientKey(self, certkey: QSslKey)

Set private key object