Skip to content

Commit 00fcc6e

Browse files
committed
sipify auth classes
1 parent e99f548 commit 00fcc6e

File tree

7 files changed

+1212
-649
lines changed

7 files changed

+1212
-649
lines changed

python/auto_sip.blacklist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ core/qgsexception.sip
33
core/qgis.sip
44
core/qgsrange.sip
55
core/qgsvectorlayerfeatureiterator.sip
6-
core/auth/qgsauthcertutils.sip
7-
core/auth/qgsauthconfig.sip
8-
core/auth/qgsauthmanager.sip
9-
core/auth/qgsauthmethod.sip
106
core/composer/qgsaddremoveitemcommand.sip
117
core/composer/qgsgroupungroupitemscommand.sip
128
core/composer/qgsaddremovemultiframecommand.sip

python/core/auth/qgsauthcertutils.sip

Lines changed: 158 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
1-
/** \ingroup core
2-
* \brief Utilities for working with certificates and keys
3-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/auth/qgsauthcertutils.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
15+
416
class QgsAuthCertUtils
517
{
18+
%Docstring
19+
Utilities for working with certificates and keys
20+
%End
21+
622
%TypeHeaderCode
7-
#include <qgsauthcertutils.h>
23+
#include "qgsauthcertutils.h"
824
%End
925
public:
10-
/** Type of CA certificate source */
1126
enum CaCertSource
1227
{
13-
SystemRoot = 0,
14-
FromFile = 1,
15-
InDatabase = 2,
16-
Connection = 3
28+
SystemRoot,
29+
FromFile,
30+
InDatabase,
31+
Connection
1732
};
1833

19-
/** Type of certificate trust policy */
2034
enum CertTrustPolicy
2135
{
22-
DefaultTrust = 0,
23-
Trusted = 1,
24-
Untrusted = 2,
25-
NoPolicy = 3
36+
DefaultTrust,
37+
Trusted,
38+
Untrusted,
39+
NoPolicy
2640
};
2741

28-
/** Type of certificate usage */
2942
enum CertUsageType
3043
{
31-
UndeterminedUsage = 0,
44+
UndeterminedUsage,
3245
AnyOrUnspecifiedUsage,
3346
CertAuthorityUsage,
3447
CertIssuerUsage,
@@ -41,170 +54,188 @@ class QgsAuthCertUtils
4154
CRLSigningUsage
4255
};
4356

44-
/** Type of certificate key group */
4557
enum ConstraintGroup
4658
{
47-
KeyUsage = 0,
48-
ExtendedKeyUsage = 1
59+
KeyUsage,
60+
ExtendedKeyUsage
4961
};
5062

5163

52-
/** SSL Protocol name strings per enum */
5364
static QString getSslProtocolName( QSsl::SslProtocol protocol );
65+
%Docstring
66+
SSL Protocol name strings per enum
67+
:rtype: str
68+
%End
5469

55-
/** Map certificate sha1 to certificate as simple cache */
5670
static QMap<QString, QSslCertificate> mapDigestToCerts( const QList<QSslCertificate> &certs );
71+
%Docstring
72+
Map certificate sha1 to certificate as simple cache
73+
:rtype: QMap<str, QSslCertificate>
74+
%End
5775

58-
/** Map certificates to their oraganization.
59-
* @note not available in Python bindings
60-
*/
61-
// static QMap< QString, QList<QSslCertificate> > certsGroupedByOrg( QList<QSslCertificate> certs );
6276

63-
/** Map SSL custom configs' certificate sha1 to custom config as simple cache
64-
*/
6577
static QMap<QString, QgsAuthConfigSslServer> mapDigestToSslConfigs( const QList<QgsAuthConfigSslServer> &configs );
78+
%Docstring
79+
Map SSL custom configs' certificate sha1 to custom config as simple cache
80+
:rtype: QMap<str, QgsAuthConfigSslServer>
81+
%End
6682

67-
/** Map SSL custom configs' certificates to their oraganization.
68-
* @note not available in Python bindings
69-
*/
70-
// static QMap< QString, QList<QgsAuthConfigSslServer> > sslConfigsGroupedByOrg( const QList<QgsAuthConfigSslServer> &configs );
7183

72-
/** Return list of concatenated certs from a PEM or DER formatted file */
7384
static QList<QSslCertificate> certsFromFile( const QString &certspath );
85+
%Docstring
86+
Return list of concatenated certs from a PEM or DER formatted file
87+
:rtype: list of QSslCertificate
88+
%End
7489

75-
/** Return first cert from a PEM or DER formatted file */
7690
static QSslCertificate certFromFile( const QString &certpath );
91+
%Docstring
92+
Return first cert from a PEM or DER formatted file
93+
:rtype: QSslCertificate
94+
%End
7795

78-
/** Return non-encrypted key from a PEM or DER formatted file
79-
* @param keypath File path to private key
80-
* @param keypass Passphrase for private key
81-
* @param algtype QString to set with resolved algorithm type
82-
*/
8396
static QSslKey keyFromFile( const QString &keypath,
8497
const QString &keypass = QString(),
8598
QString *algtype = 0 );
99+
%Docstring
100+
Return non-encrypted key from a PEM or DER formatted file
101+
\param keypath File path to private key
102+
\param keypass Passphrase for private key
103+
\param algtype QString to set with resolved algorithm type
104+
:rtype: QSslKey
105+
%End
86106

87-
/** Return list of concatenated certs from a PEM Base64 text block */
88107
static QList<QSslCertificate> certsFromString( const QString &pemtext );
108+
%Docstring
109+
Return list of concatenated certs from a PEM Base64 text block
110+
:rtype: list of QSslCertificate
111+
%End
89112

90-
/** Return list of certificate, private key and algorithm (as PEM text) from file path components
91-
* @param certpath File path to certificate
92-
* @param keypath File path to private key
93-
* @param keypass Passphrase for private key
94-
* @param reencrypt Whether to re-encrypt the private key with the passphrase
95-
* @return certificate, private key, key's algorithm type
96-
*/
97113
static QStringList certKeyBundleToPem( const QString &certpath,
98114
const QString &keypath,
99115
const QString &keypass = QString(),
100116
bool reencrypt = true );
117+
%Docstring
118+
Return list of certificate, private key and algorithm (as PEM text) from file path components
119+
\param certpath File path to certificate
120+
\param keypath File path to private key
121+
\param keypass Passphrase for private key
122+
\param reencrypt Whether to re-encrypt the private key with the passphrase
123+
:return: certificate, private key, key's algorithm type
124+
:rtype: list of str
125+
%End
101126

102-
/** Return list of certificate, private key and algorithm (as PEM text) for a PKCS#12 bundle
103-
* @param bundlepath File path to the PKCS bundle
104-
* @param bundlepass Passphrase for bundle
105-
* @param reencrypt Whether to re-encrypt the private key with the passphrase
106-
* @return certificate, private key, key's algorithm type
107-
*/
108127
static QStringList pkcs12BundleToPem( const QString &bundlepath,
109128
const QString &bundlepass = QString(),
110129
bool reencrypt = true );
130+
%Docstring
131+
Return list of certificate, private key and algorithm (as PEM text) for a PKCS#12 bundle
132+
\param bundlepath File path to the PKCS bundle
133+
\param bundlepass Passphrase for bundle
134+
\param reencrypt Whether to re-encrypt the private key with the passphrase
135+
:return: certificate, private key, key's algorithm type
136+
:rtype: list of str
137+
%End
111138

112-
/** Write a temporary file for a PEM text of cert/key/CAs bundle component
113-
* @param pemtext Component content as PEM text
114-
* @param name Name of file
115-
* @return File path to temporary file
116-
*/
117139
static QString pemTextToTempFile( const QString &name, const QByteArray &pemtext );
140+
%Docstring
141+
Write a temporary file for a PEM text of cert/key/CAs bundle component
142+
\param pemtext Component content as PEM text
143+
\param name Name of file
144+
:return: File path to temporary file
145+
:rtype: str
146+
%End
118147

119-
/** Get the general name for CA source enum type
120-
* @param source The enum source type for the CA
121-
* @param single Whether to return singular or plural description
122-
*/
123-
static QString getCaSourceName( QgsAuthCertUtils::CaCertSource source , bool single = false );
148+
static QString getCaSourceName( QgsAuthCertUtils::CaCertSource source, bool single = false );
149+
%Docstring
150+
Get the general name for CA source enum type
151+
\param source The enum source type for the CA
152+
\param single Whether to return singular or plural description
153+
:rtype: str
154+
%End
124155

125-
/** Get the general name via RFC 5280 resolution */
126156
static QString resolvedCertName( const QSslCertificate &cert, bool issuer = false );
157+
%Docstring
158+
Get the general name via RFC 5280 resolution
159+
:rtype: str
160+
%End
161+
127162

128-
/** Get combined distinguished name for certificate
129-
* @param qcert Qt SSL cert object
130-
* @param acert QCA SSL cert object to add more info to the output
131-
* @param issuer Whether to return cert's subject or issuer combined name
132-
* @note not available in Python bindings
133-
*/
134-
// static QString getCertDistinguishedName( const QSslCertificate& qcert,
135-
// const QCA::Certificate& acert = QCA::Certificate(),
136-
// bool issuer = false );
137-
138-
/** Get the general name for certificate trust */
139163
static QString getCertTrustName( QgsAuthCertUtils::CertTrustPolicy trust );
164+
%Docstring
165+
Get the general name for certificate trust
166+
:rtype: str
167+
%End
140168

141-
/** Get string with colon delimiters every 2 characters */
142169
static QString getColonDelimited( const QString &txt );
170+
%Docstring
171+
Get string with colon delimiters every 2 characters
172+
:rtype: str
173+
%End
174+
175+
static QString shaHexForCert( const QSslCertificate &cert, bool formatted = false );
176+
%Docstring
177+
Get the sha1 hash for certificate
178+
\param cert Qt SSL certificate to generate hash from
179+
\param formatted Whether to colon-delimit the hash
180+
:rtype: str
181+
%End
182+
183+
184+
185+
186+
187+
188+
143189

144-
/** Get the sha1 hash for certificate
145-
* @param cert Qt SSL certificate to generate hash from
146-
* @param formatted Whether to colon-delimit the hash
147-
*/
148-
static QString shaHexForCert( const QSslCertificate &cert , bool formatted = false );
149-
150-
/** Convert a QSslCertificate to a QCA::Certificate.
151-
* @note not available in Python bindings
152-
*/
153-
// static QCA::Certificate qtCertToQcaCert( const QSslCertificate &cert );
154-
155-
/** Convert a QList of QSslCertificate to a QCA::CertificateCollection.
156-
* @note not available in Python bindings
157-
*/
158-
// static QCA::CertificateCollection qtCertsToQcaCollection( const QList<QSslCertificate> &certs );
159-
160-
/** PKI key/cert bundle from file path, e.g. from .p12 or pfx files.
161-
* @note not available in Python bindings
162-
*/
163-
// static QCA::KeyBundle qcaKeyBundle( const QString &path, const QString &pass );
164-
165-
/** Certificate validity check messages per enum.
166-
* @note not available in Python bindings
167-
*/
168-
// static QString qcaValidityMessage( QCA::Validity validity );
169-
170-
/** Certificate signature algorithm strings per enum.
171-
* @note not available in Python bindings
172-
*/
173-
// static QString qcaSignatureAlgorithm( QCA::SignatureAlgorithm algorithm );
174-
175-
/** Certificate well-known constraint strings per enum.
176-
* @note not available in Python bindings
177-
*/
178-
// static QString qcaKnownConstraint( QCA::ConstraintTypeKnown constraint );
179-
180-
/** Certificate usage type strings per enum
181-
* @note not available in Python bindings
182-
*/
183-
static QString certificateUsageTypeString( QgsAuthCertUtils::CertUsageType usagetype );
184-
185-
/** Try to determine the certificates usage types */
186190
static QList<QgsAuthCertUtils::CertUsageType> certificateUsageTypes( const QSslCertificate &cert );
191+
%Docstring
192+
Try to determine the certificates usage types
193+
:rtype: list of QgsAuthCertUtils.CertUsageType
194+
%End
187195

188-
/** Get whether a certificate is an Authority */
189196
static bool certificateIsAuthority( const QSslCertificate &cert );
197+
%Docstring
198+
Get whether a certificate is an Authority
199+
:rtype: bool
200+
%End
190201

191-
/** Get whether a certificate can sign other certificates */
192202
static bool certificateIsIssuer( const QSslCertificate &cert );
203+
%Docstring
204+
Get whether a certificate can sign other certificates
205+
:rtype: bool
206+
%End
193207

194-
/** Get whether a certificate is an Authority or can at least sign other certificates */
195208
static bool certificateIsAuthorityOrIssuer( const QSslCertificate &cert );
209+
%Docstring
210+
Get whether a certificate is an Authority or can at least sign other certificates
211+
:rtype: bool
212+
%End
196213

197-
/** Get whether a certificate is probably used for a SSL server */
198214
static bool certificateIsSslServer( const QSslCertificate &cert );
215+
%Docstring
216+
Get whether a certificate is probably used for a SSL server
217+
:rtype: bool
218+
%End
199219

200-
/** Get whether a certificate is probably used for a client identity */
201220
static bool certificateIsSslClient( const QSslCertificate &cert );
221+
%Docstring
222+
Get whether a certificate is probably used for a client identity
223+
:rtype: bool
224+
%End
202225

203-
/** Get short strings describing an SSL error */
204226
static QString sslErrorEnumString( QSslError::SslError errenum );
227+
%Docstring
228+
Get short strings describing an SSL error
229+
:rtype: str
230+
%End
231+
205232

206-
/** Get short strings describing SSL errors.
207-
* @note not available in Python bindings
208-
*/
209-
// static QList<QPair<QSslError::SslError, QString> > sslErrorEnumStrings();
210233
};
234+
235+
/************************************************************************
236+
* This file has been generated automatically from *
237+
* *
238+
* src/core/auth/qgsauthcertutils.h *
239+
* *
240+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
241+
************************************************************************/

0 commit comments

Comments
 (0)