@girs/gcr-3 3.41.0-3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/gcr-3.cjs +9 -0
- package/gcr-3.d.cts +4505 -0
- package/gcr-3.d.ts +4510 -0
- package/gcr-3.js +8 -0
- package/package.json +55 -0
- package/tsconfig.doc.json +19 -0
package/gcr-3.d.ts
ADDED
|
@@ -0,0 +1,4510 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Gcr-3
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type Gio from '@girs/gio-2.0';
|
|
13
|
+
import type GObject from '@girs/gobject-2.0';
|
|
14
|
+
import type GLib from '@girs/glib-2.0';
|
|
15
|
+
import type Gck from '@girs/gck-1';
|
|
16
|
+
|
|
17
|
+
export namespace Gcr {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The status of a built certificate chain. Will be set to
|
|
21
|
+
* %GCR_CERTIFICATE_CHAIN_UNKNOWN for certificate chains that have not been
|
|
22
|
+
* built.
|
|
23
|
+
*/
|
|
24
|
+
enum CertificateChainStatus {
|
|
25
|
+
/**
|
|
26
|
+
* The certificate chain's status is unknown.
|
|
27
|
+
* When a chain is not yet built it has this status. If a chain is modified after
|
|
28
|
+
* being built, it has this status.
|
|
29
|
+
*/
|
|
30
|
+
UNKNOWN,
|
|
31
|
+
/**
|
|
32
|
+
* A full chain could not be loaded. The
|
|
33
|
+
* chain does not end with a self-signed certificate, a trusted anchor, or a
|
|
34
|
+
* pinned certificate.
|
|
35
|
+
*/
|
|
36
|
+
INCOMPLETE,
|
|
37
|
+
/**
|
|
38
|
+
* The certificate chain contains a revoked
|
|
39
|
+
* or otherwise explicitly distrusted certificate. The entire chain should
|
|
40
|
+
* be distrusted.
|
|
41
|
+
*/
|
|
42
|
+
DISTRUSTED,
|
|
43
|
+
/**
|
|
44
|
+
* The chain ends with a self-signed
|
|
45
|
+
* certificate. No trust anchor was found.
|
|
46
|
+
*/
|
|
47
|
+
SELFSIGNED,
|
|
48
|
+
/**
|
|
49
|
+
* The chain represents a pinned certificate. A
|
|
50
|
+
* pinned certificate is an exception which trusts a given certificate
|
|
51
|
+
* explicitly for a purpose and communication with a certain peer.
|
|
52
|
+
*/
|
|
53
|
+
PINNED,
|
|
54
|
+
/**
|
|
55
|
+
* The chain ends with an anchored
|
|
56
|
+
* certificate. The anchored certificate is not necessarily self-signed.
|
|
57
|
+
*/
|
|
58
|
+
ANCHORED,
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The format of a certificate request. Currently only PKCS#10 is supported.
|
|
62
|
+
*/
|
|
63
|
+
enum CertificateRequestFormat {
|
|
64
|
+
/**
|
|
65
|
+
* certificate request is in PKCS#10 format
|
|
66
|
+
*/
|
|
67
|
+
CERTIFICATE_REQUEST_PKCS10,
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Values responding to error codes for parsing and serializing data.
|
|
71
|
+
*/
|
|
72
|
+
enum DataError {
|
|
73
|
+
/**
|
|
74
|
+
* Failed to parse or serialize the data
|
|
75
|
+
*/
|
|
76
|
+
FAILURE,
|
|
77
|
+
/**
|
|
78
|
+
* The data was unrecognized or unsupported
|
|
79
|
+
*/
|
|
80
|
+
UNRECOGNIZED,
|
|
81
|
+
/**
|
|
82
|
+
* The operation was cancelled
|
|
83
|
+
*/
|
|
84
|
+
CANCELLED,
|
|
85
|
+
/**
|
|
86
|
+
* The data was encrypted or locked and could not be unlocked.
|
|
87
|
+
*/
|
|
88
|
+
LOCKED,
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The various format identifiers.
|
|
92
|
+
*/
|
|
93
|
+
enum DataFormat {
|
|
94
|
+
/**
|
|
95
|
+
* Represents all the formats, when enabling or disabling
|
|
96
|
+
*/
|
|
97
|
+
ALL,
|
|
98
|
+
/**
|
|
99
|
+
* Not a valid format
|
|
100
|
+
*/
|
|
101
|
+
INVALID,
|
|
102
|
+
/**
|
|
103
|
+
* DER encoded private key
|
|
104
|
+
*/
|
|
105
|
+
DER_PRIVATE_KEY,
|
|
106
|
+
/**
|
|
107
|
+
* DER encoded RSA private key
|
|
108
|
+
*/
|
|
109
|
+
DER_PRIVATE_KEY_RSA,
|
|
110
|
+
/**
|
|
111
|
+
* DER encoded DSA private key
|
|
112
|
+
*/
|
|
113
|
+
DER_PRIVATE_KEY_DSA,
|
|
114
|
+
/**
|
|
115
|
+
* DER encoded EC private key
|
|
116
|
+
*/
|
|
117
|
+
DER_PRIVATE_KEY_EC,
|
|
118
|
+
/**
|
|
119
|
+
* DER encoded SubjectPublicKeyInfo
|
|
120
|
+
*/
|
|
121
|
+
DER_SUBJECT_PUBLIC_KEY,
|
|
122
|
+
/**
|
|
123
|
+
* DER encoded X.509 certificate
|
|
124
|
+
*/
|
|
125
|
+
DER_CERTIFICATE_X509,
|
|
126
|
+
/**
|
|
127
|
+
* DER encoded PKCS#7 container file which can contain certificates
|
|
128
|
+
*/
|
|
129
|
+
DER_PKCS7,
|
|
130
|
+
/**
|
|
131
|
+
* DER encoded PKCS#8 file which can contain a key
|
|
132
|
+
*/
|
|
133
|
+
DER_PKCS8,
|
|
134
|
+
/**
|
|
135
|
+
* Unencrypted DER encoded PKCS#8 file which can contain a key
|
|
136
|
+
*/
|
|
137
|
+
DER_PKCS8_PLAIN,
|
|
138
|
+
/**
|
|
139
|
+
* Encrypted DER encoded PKCS#8 file which can contain a key
|
|
140
|
+
*/
|
|
141
|
+
DER_PKCS8_ENCRYPTED,
|
|
142
|
+
/**
|
|
143
|
+
* DER encoded PKCS#10 certificate request file
|
|
144
|
+
*/
|
|
145
|
+
DER_PKCS10,
|
|
146
|
+
/**
|
|
147
|
+
* DER encoded SPKAC as generated by HTML5 keygen element
|
|
148
|
+
*/
|
|
149
|
+
DER_SPKAC,
|
|
150
|
+
/**
|
|
151
|
+
* OpenSSL style SPKAC data
|
|
152
|
+
*/
|
|
153
|
+
BASE64_SPKAC,
|
|
154
|
+
/**
|
|
155
|
+
* DER encoded PKCS#12 file which can contain certificates and/or keys
|
|
156
|
+
*/
|
|
157
|
+
DER_PKCS12,
|
|
158
|
+
/**
|
|
159
|
+
* OpenSSH v1 or v2 public key
|
|
160
|
+
*/
|
|
161
|
+
OPENSSH_PUBLIC,
|
|
162
|
+
/**
|
|
163
|
+
* OpenPGP key packet(s)
|
|
164
|
+
*/
|
|
165
|
+
OPENPGP_PACKET,
|
|
166
|
+
/**
|
|
167
|
+
* OpenPGP public or private key armor encoded data
|
|
168
|
+
*/
|
|
169
|
+
OPENPGP_ARMOR,
|
|
170
|
+
/**
|
|
171
|
+
* An OpenSSL style PEM file with unspecified contents
|
|
172
|
+
*/
|
|
173
|
+
PEM,
|
|
174
|
+
/**
|
|
175
|
+
* An OpenSSL style PEM file with a private RSA key
|
|
176
|
+
*/
|
|
177
|
+
PEM_PRIVATE_KEY_RSA,
|
|
178
|
+
/**
|
|
179
|
+
* An OpenSSL style PEM file with a private DSA key
|
|
180
|
+
*/
|
|
181
|
+
PEM_PRIVATE_KEY_DSA,
|
|
182
|
+
/**
|
|
183
|
+
* An OpenSSL style PEM file with an X.509 certificate
|
|
184
|
+
*/
|
|
185
|
+
PEM_CERTIFICATE_X509,
|
|
186
|
+
/**
|
|
187
|
+
* An OpenSSL style PEM file containing PKCS#7
|
|
188
|
+
*/
|
|
189
|
+
PEM_PKCS7,
|
|
190
|
+
/**
|
|
191
|
+
* Unencrypted OpenSSL style PEM file containing PKCS#8
|
|
192
|
+
*/
|
|
193
|
+
PEM_PKCS8_PLAIN,
|
|
194
|
+
/**
|
|
195
|
+
* Encrypted OpenSSL style PEM file containing PKCS#8
|
|
196
|
+
*/
|
|
197
|
+
PEM_PKCS8_ENCRYPTED,
|
|
198
|
+
/**
|
|
199
|
+
* An OpenSSL style PEM file containing PKCS#12
|
|
200
|
+
*/
|
|
201
|
+
PEM_PKCS12,
|
|
202
|
+
/**
|
|
203
|
+
* An OpenSSL style PEM file with a private key
|
|
204
|
+
*/
|
|
205
|
+
PEM_PRIVATE_KEY,
|
|
206
|
+
/**
|
|
207
|
+
* An OpenSSL style PEM file containing PKCS#10
|
|
208
|
+
*/
|
|
209
|
+
PEM_PKCS10,
|
|
210
|
+
/**
|
|
211
|
+
* An OpenSSL style PEM file with a private EC key
|
|
212
|
+
*/
|
|
213
|
+
PEM_PRIVATE_KEY_EC,
|
|
214
|
+
/**
|
|
215
|
+
* An OpenSSL style PEM file containing a SubjectPublicKeyInfo
|
|
216
|
+
*/
|
|
217
|
+
PEM_PUBLIC_KEY,
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Various replies returned by [method`Prompt`.confirm] and friends.
|
|
221
|
+
*/
|
|
222
|
+
enum PromptReply {
|
|
223
|
+
/**
|
|
224
|
+
* the prompt was cancelled
|
|
225
|
+
*/
|
|
226
|
+
CANCEL,
|
|
227
|
+
/**
|
|
228
|
+
* the user replied with 'ok'
|
|
229
|
+
*/
|
|
230
|
+
CONTINUE,
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* No error returned by the #GcrSystemPrompt is suitable for display or
|
|
234
|
+
* to the user.
|
|
235
|
+
*
|
|
236
|
+
* If the system prompter can only show one prompt at a time, and there is
|
|
237
|
+
* already a prompt being displayed, and the timeout waiting to open the
|
|
238
|
+
* prompt expires, then %GCR_SYSTEM_PROMPT_IN_PROGRESS is returned.
|
|
239
|
+
*/
|
|
240
|
+
enum SystemPromptError {
|
|
241
|
+
/**
|
|
242
|
+
* another prompt is already in progress
|
|
243
|
+
*/
|
|
244
|
+
SYSTEM_PROMPT_IN_PROGRESS,
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The mode for the system prompter. Most system prompters can only show
|
|
248
|
+
* one prompt at a time and would use the %GCR_SYSTEM_PROMPTER_SINGLE mode.
|
|
249
|
+
*/
|
|
250
|
+
enum SystemPrompterMode {
|
|
251
|
+
/**
|
|
252
|
+
* only one prompt shown at a time
|
|
253
|
+
*/
|
|
254
|
+
SINGLE,
|
|
255
|
+
/**
|
|
256
|
+
* more than one prompt shown at a time
|
|
257
|
+
*/
|
|
258
|
+
MULTIPLE,
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Flags to be used with the gcr_certificate_chain_build() operation.
|
|
262
|
+
* @bitfield
|
|
263
|
+
*/
|
|
264
|
+
enum CertificateChainFlags {
|
|
265
|
+
/**
|
|
266
|
+
* no flags
|
|
267
|
+
*/
|
|
268
|
+
NONE,
|
|
269
|
+
/**
|
|
270
|
+
* If this flag is specified then no
|
|
271
|
+
* lookups for anchors or pinned certificates are done, and the resulting chain
|
|
272
|
+
* will be neither anchored or pinned. Additionally no missing certificate
|
|
273
|
+
* authorities are looked up in PKCS#11.
|
|
274
|
+
*/
|
|
275
|
+
NO_LOOKUPS,
|
|
276
|
+
}
|
|
277
|
+
enum ColumnFlags {
|
|
278
|
+
NONE,
|
|
279
|
+
HIDDEN,
|
|
280
|
+
SORTABLE,
|
|
281
|
+
}
|
|
282
|
+
const ICON_CERTIFICATE: string | null
|
|
283
|
+
const ICON_GNUPG: string | null
|
|
284
|
+
const ICON_HOME_DIRECTORY: string | null
|
|
285
|
+
const ICON_KEY: string | null
|
|
286
|
+
const ICON_KEY_PAIR: string | null
|
|
287
|
+
const ICON_PASSWORD: string | null
|
|
288
|
+
const ICON_SMART_CARD: string | null
|
|
289
|
+
/**
|
|
290
|
+
* The major version number of the Gcr library.
|
|
291
|
+
*/
|
|
292
|
+
const MAJOR_VERSION: number
|
|
293
|
+
/**
|
|
294
|
+
* The micro version number of the Gcr library.
|
|
295
|
+
*/
|
|
296
|
+
const MICRO_VERSION: number
|
|
297
|
+
/**
|
|
298
|
+
* The minor version number of the Gcr library.
|
|
299
|
+
*/
|
|
300
|
+
const MINOR_VERSION: number
|
|
301
|
+
/**
|
|
302
|
+
* The purpose used to verify the client certificate in a TLS connection.
|
|
303
|
+
*/
|
|
304
|
+
const PURPOSE_CLIENT_AUTH: string | null
|
|
305
|
+
/**
|
|
306
|
+
* The purpose used to verify certificate used for the signature on signed code.
|
|
307
|
+
*/
|
|
308
|
+
const PURPOSE_CODE_SIGNING: string | null
|
|
309
|
+
/**
|
|
310
|
+
* The purpose used to verify certificates that are used in email communication
|
|
311
|
+
* such as S/MIME.
|
|
312
|
+
*/
|
|
313
|
+
const PURPOSE_EMAIL: string | null
|
|
314
|
+
/**
|
|
315
|
+
* The purpose used to verify the server certificate in a TLS connection. This
|
|
316
|
+
* is the most common purpose in use.
|
|
317
|
+
*/
|
|
318
|
+
const PURPOSE_SERVER_AUTH: string | null
|
|
319
|
+
/**
|
|
320
|
+
* The current secret exchange protocol. Key agreement is done using DH with the
|
|
321
|
+
* 1536 bit IKE parameter group. Keys are derived using SHA256 with HKDF. The
|
|
322
|
+
* transport encryption is done with 128 bit AES.
|
|
323
|
+
*/
|
|
324
|
+
const SECRET_EXCHANGE_PROTOCOL_1: string | null
|
|
325
|
+
const UNLOCK_OPTION_ALWAYS: string | null
|
|
326
|
+
const UNLOCK_OPTION_IDLE: string | null
|
|
327
|
+
const UNLOCK_OPTION_SESSION: string | null
|
|
328
|
+
const UNLOCK_OPTION_TIMEOUT: string | null
|
|
329
|
+
/**
|
|
330
|
+
* Compare one certificate against another. If the certificates are equal
|
|
331
|
+
* then zero is returned. If one certificate is %NULL or not a certificate,
|
|
332
|
+
* then a non-zero value is returned.
|
|
333
|
+
*
|
|
334
|
+
* The return value is useful in a stable sort, but has no user logical
|
|
335
|
+
* meaning.
|
|
336
|
+
* @param first the certificate to compare
|
|
337
|
+
* @param other the certificate to compare against
|
|
338
|
+
* @returns zero if the certificates match, non-zero otherwise.
|
|
339
|
+
*/
|
|
340
|
+
function certificate_compare(first: Comparable | null, other: Comparable | null): number
|
|
341
|
+
function data_error_get_domain(): GLib.Quark
|
|
342
|
+
/**
|
|
343
|
+
* Create a key fingerprint for a certificate, public key or private key.
|
|
344
|
+
* Note that this is not a fingerprint of certificate data, which you would
|
|
345
|
+
* use gcr_certificate_get_fingerprint() for.
|
|
346
|
+
* @param attrs attributes for key or certificate
|
|
347
|
+
* @param checksum_type the type of fingerprint to create
|
|
348
|
+
* @returns the fingerprint or %NULL if the input was invalid.
|
|
349
|
+
*/
|
|
350
|
+
function fingerprint_from_attributes(attrs: Gck.Attributes, checksum_type: GLib.ChecksumType): Uint8Array | null
|
|
351
|
+
/**
|
|
352
|
+
* Create a key fingerprint for a DER encoded subjectPublicKeyInfo. The
|
|
353
|
+
* fingerprint is created so that it will be identical for a key and its
|
|
354
|
+
* corresponding certificate.
|
|
355
|
+
*
|
|
356
|
+
* Note that in the case of certificates this is not a fingerprint of the
|
|
357
|
+
* actual certificate data, but rather of the public key contained in a
|
|
358
|
+
* certificate.
|
|
359
|
+
* @param key_info DER encoded subjectPublicKeyInfo structure
|
|
360
|
+
* @param checksum_type the type of fingerprint to create
|
|
361
|
+
* @returns the fingerprint or %NULL if the input was invalid.
|
|
362
|
+
*/
|
|
363
|
+
function fingerprint_from_subject_public_key_info(key_info: Uint8Array, checksum_type: GLib.ChecksumType): Uint8Array | null
|
|
364
|
+
/**
|
|
365
|
+
* Get an appropriate icon for the token
|
|
366
|
+
* @param token_info the token info
|
|
367
|
+
* @returns the icon
|
|
368
|
+
*/
|
|
369
|
+
function icon_for_token(token_info: Gck.TokenInfo): Gio.Icon
|
|
370
|
+
/**
|
|
371
|
+
* Create a set of importers which can import this parsed item.
|
|
372
|
+
* The parsed item is represented by the state of the GcrParser at the
|
|
373
|
+
* time of calling this method.
|
|
374
|
+
* @param parsed a parser with a parsed item to import
|
|
375
|
+
* @returns a list of importers which can import the parsed item, which should be freed with g_object_unref(), or %NULL if no types of importers can be created
|
|
376
|
+
*/
|
|
377
|
+
function importer_create_for_parsed(parsed: Parsed): Importer[]
|
|
378
|
+
/**
|
|
379
|
+
* Queues an additional item to be imported in all compattible importers
|
|
380
|
+
* in the set. The parsed item is represented by the state of the #GcrParser
|
|
381
|
+
* at the time of calling this method.
|
|
382
|
+
*
|
|
383
|
+
* If the parsed item is incompatible with an importer, then that the item
|
|
384
|
+
* will not be queued on that importer.
|
|
385
|
+
* @param importers a set of importers
|
|
386
|
+
* @param parsed a parsed item
|
|
387
|
+
* @returns a new set of importers that queued the item, which should be freed with gck_list_unref_free()
|
|
388
|
+
*/
|
|
389
|
+
function importer_queue_and_filter_for_parsed(importers: Importer[], parsed: Parsed): Importer[]
|
|
390
|
+
/**
|
|
391
|
+
* Register an importer to handle parsed items that match the given attributes.
|
|
392
|
+
*
|
|
393
|
+
* If `attrs` are a floating reference, then it is consumed.
|
|
394
|
+
* @param importer_type the GType of the importer being registered
|
|
395
|
+
* @param attrs the attributes that this importer is compatible with
|
|
396
|
+
*/
|
|
397
|
+
function importer_register(importer_type: GObject.GType, attrs: Gck.Attributes): void
|
|
398
|
+
/**
|
|
399
|
+
* Register built-in PKCS#11 and GnuPG importers.
|
|
400
|
+
*/
|
|
401
|
+
function importer_register_well_known(): void
|
|
402
|
+
/**
|
|
403
|
+
* Disconnect the mock prompter
|
|
404
|
+
*/
|
|
405
|
+
function mock_prompter_disconnect(): void
|
|
406
|
+
/**
|
|
407
|
+
* Queue an expected response on the mock prompter.
|
|
408
|
+
*
|
|
409
|
+
* Expects any prompt, and closes the prompt when it gets it.
|
|
410
|
+
*/
|
|
411
|
+
function mock_prompter_expect_close(): void
|
|
412
|
+
/**
|
|
413
|
+
* Queue an expected response on the mock prompter.
|
|
414
|
+
*
|
|
415
|
+
* Expects a confirmation prompt, and then cancels that prompt.
|
|
416
|
+
*/
|
|
417
|
+
function mock_prompter_expect_confirm_cancel(): void
|
|
418
|
+
/**
|
|
419
|
+
* Queue an expected response on the mock prompter.
|
|
420
|
+
*
|
|
421
|
+
* Expects a password prompt, and then cancels that prompt.
|
|
422
|
+
*/
|
|
423
|
+
function mock_prompter_expect_password_cancel(): void
|
|
424
|
+
/**
|
|
425
|
+
* Get the delay in milliseconds before the mock prompter completes
|
|
426
|
+
* an expected prompt.
|
|
427
|
+
* @returns the delay
|
|
428
|
+
*/
|
|
429
|
+
function mock_prompter_get_delay_msec(): number
|
|
430
|
+
/**
|
|
431
|
+
* Check if the mock prompter is expecting a response. This will be %TRUE
|
|
432
|
+
* when one of the <literal>gcr_mock_prompter_expect_xxx<!-- -->()</literal>
|
|
433
|
+
* functions have been used to queue an expected prompt, but that prompt
|
|
434
|
+
* response has not be 'used' yet.
|
|
435
|
+
* @returns whether expecting a prompt
|
|
436
|
+
*/
|
|
437
|
+
function mock_prompter_is_expecting(): boolean
|
|
438
|
+
/**
|
|
439
|
+
* Check if the mock prompter is showing any prompts.
|
|
440
|
+
* @returns whether prompting
|
|
441
|
+
*/
|
|
442
|
+
function mock_prompter_is_prompting(): boolean
|
|
443
|
+
/**
|
|
444
|
+
* Set the delay in milliseconds before the mock prompter completes
|
|
445
|
+
* an expected prompt.
|
|
446
|
+
* @param delay_msec prompt response delay in milliseconds
|
|
447
|
+
*/
|
|
448
|
+
function mock_prompter_set_delay_msec(delay_msec: number): void
|
|
449
|
+
/**
|
|
450
|
+
* Start the mock prompter. This is often used from the
|
|
451
|
+
* <literal>setup<!-- -->()</literal> function of tests.
|
|
452
|
+
*
|
|
453
|
+
* Starts the mock prompter in an additional thread. Use the returned DBus bus
|
|
454
|
+
* name with gcr_system_prompt_open_for_prompter() to connect to this prompter.
|
|
455
|
+
* @returns the bus name that the mock prompter is listening on
|
|
456
|
+
*/
|
|
457
|
+
function mock_prompter_start(): string | null
|
|
458
|
+
/**
|
|
459
|
+
* Stop the mock prompter. This is often used from the
|
|
460
|
+
* <literal>teardown<!-- -->()</literal> function of tests.
|
|
461
|
+
*/
|
|
462
|
+
function mock_prompter_stop(): void
|
|
463
|
+
/**
|
|
464
|
+
* Unreferences a parsed item which was referenced with gcr_parsed_ref()
|
|
465
|
+
* @param parsed a parsed item
|
|
466
|
+
*/
|
|
467
|
+
function parsed_unref(parsed: any | null): void
|
|
468
|
+
/**
|
|
469
|
+
* Add a #GckModule to the list of PKCS#11 modules that are used by the
|
|
470
|
+
* GCR library.
|
|
471
|
+
*
|
|
472
|
+
* It is not normally necessary to call this function. The available
|
|
473
|
+
* PKCS#11 modules installed on the system are automatically loaded
|
|
474
|
+
* by the GCR library.
|
|
475
|
+
* @param module a #GckModule
|
|
476
|
+
*/
|
|
477
|
+
function pkcs11_add_module(module: Gck.Module): void
|
|
478
|
+
/**
|
|
479
|
+
* Initialize a PKCS#11 module and add it to the modules that are
|
|
480
|
+
* used by the GCR library. Note that is an error to initialize the same
|
|
481
|
+
* PKCS#11 module twice.
|
|
482
|
+
*
|
|
483
|
+
* It is not normally necessary to call this function. The available
|
|
484
|
+
* PKCS#11 modules installed on the system are automatically loaded
|
|
485
|
+
* by the GCR library.
|
|
486
|
+
* @param module_path the full file path of the PKCS#11 module
|
|
487
|
+
* @param unused unused
|
|
488
|
+
* @returns whether the module was sucessfully added.
|
|
489
|
+
*/
|
|
490
|
+
function pkcs11_add_module_from_file(module_path: string | null, unused: any | null): boolean
|
|
491
|
+
/**
|
|
492
|
+
* List all the PKCS#11 modules that are used by the GCR library.
|
|
493
|
+
* Each module is a [class`Gck`.Module] object.
|
|
494
|
+
*
|
|
495
|
+
* An empty list of modules will be returned if [func`pkcs1`1_set_modules],
|
|
496
|
+
* or [func`pkcs1`1_initialize] has not yet run.
|
|
497
|
+
*
|
|
498
|
+
* When done with the list, free it with gck_list_unref_free().
|
|
499
|
+
* @returns a newly allocated list of #GckModule objects
|
|
500
|
+
*/
|
|
501
|
+
function pkcs11_get_modules(): Gck.Module[]
|
|
502
|
+
/**
|
|
503
|
+
* List all the PKCS#11 slots that are used by the GCR library for lookup
|
|
504
|
+
* of trust assertions. Each slot is a [class`Gck`.Slot] object.
|
|
505
|
+
*
|
|
506
|
+
* This will return an empty list if the [func`pkcs1`1_initialize] function has
|
|
507
|
+
* not yet been called.
|
|
508
|
+
* @returns a list of #GckSlot objects to use for lookup of trust, or the empty list if not initialized or no appropriate trust stores could be found.
|
|
509
|
+
*/
|
|
510
|
+
function pkcs11_get_trust_lookup_slots(): Gck.Slot[]
|
|
511
|
+
/**
|
|
512
|
+
* Get the PKCS#11 URIs that are used to identify which slots to use for
|
|
513
|
+
* lookup trust assertions.
|
|
514
|
+
* @returns the uri which identifies trust storage slot
|
|
515
|
+
*/
|
|
516
|
+
function pkcs11_get_trust_lookup_uris(): string[] | null
|
|
517
|
+
/**
|
|
518
|
+
* Selects an appropriate PKCS#11 slot to store trust assertions. The slot
|
|
519
|
+
* to use is normally configured automatically by the system.
|
|
520
|
+
*
|
|
521
|
+
* This will only return a valid result after the [func`pkcs1`1_initialize]
|
|
522
|
+
* method has been called.
|
|
523
|
+
*
|
|
524
|
+
* When done with the #GckSlot, use g_object_unref() to release it.
|
|
525
|
+
* @returns the #GckSlot to use for trust assertions, or null if not initialized or no appropriate trust store could be found.
|
|
526
|
+
*/
|
|
527
|
+
function pkcs11_get_trust_store_slot(): Gck.Slot | null
|
|
528
|
+
/**
|
|
529
|
+
* Get the PKCS#11 URI that is used to identify which slot to use for
|
|
530
|
+
* storing trust storage.
|
|
531
|
+
* @returns the uri which identifies trust storage slot
|
|
532
|
+
*/
|
|
533
|
+
function pkcs11_get_trust_store_uri(): string | null
|
|
534
|
+
/**
|
|
535
|
+
* Asynchronously initialize the registered PKCS#11 modules.
|
|
536
|
+
* @param cancellable optional cancellable used to cancel the operation
|
|
537
|
+
* @returns whether the operation was successful or not.
|
|
538
|
+
*/
|
|
539
|
+
function pkcs11_initialize(cancellable: Gio.Cancellable | null): boolean
|
|
540
|
+
/**
|
|
541
|
+
* Asynchronously initialize the registered PKCS#11 modules.
|
|
542
|
+
* @param cancellable optional cancellable used to cancel the operation
|
|
543
|
+
* @param callback callback which will be called when the operation completes
|
|
544
|
+
*/
|
|
545
|
+
function pkcs11_initialize_async<Z = unknown>(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Z> | null): void
|
|
546
|
+
/**
|
|
547
|
+
* Complete the asynchronous operation to initialize the registered PKCS#11
|
|
548
|
+
* modules.
|
|
549
|
+
* @param result the asynchronous result
|
|
550
|
+
* @returns whether the operation was successful or not.
|
|
551
|
+
*/
|
|
552
|
+
function pkcs11_initialize_finish(result: Gio.AsyncResult): boolean
|
|
553
|
+
/**
|
|
554
|
+
* Set the list of PKCS#11 modules that are used by the GCR library.
|
|
555
|
+
* Each module in the list is a [class`Gck`.Module] object.
|
|
556
|
+
*
|
|
557
|
+
* It is not normally necessary to call this function. The available
|
|
558
|
+
* PKCS#11 modules installed on the system are automatically loaded
|
|
559
|
+
* by the GCR library.
|
|
560
|
+
* @param modules a list of PKCS#11 modules
|
|
561
|
+
*/
|
|
562
|
+
function pkcs11_set_modules(modules: Gck.Module[]): void
|
|
563
|
+
/**
|
|
564
|
+
* Set the PKCS#11 URIs that are used to identify which slots to use for
|
|
565
|
+
* lookup of trust assertions.
|
|
566
|
+
*
|
|
567
|
+
* It is not normally necessary to call this function. The relevant
|
|
568
|
+
* PKCS#11 slots are automatically configured by the GCR library.
|
|
569
|
+
* @param pkcs11_uris the uris which identifies trust lookup slots
|
|
570
|
+
*/
|
|
571
|
+
function pkcs11_set_trust_lookup_uris(pkcs11_uris: string | null): void
|
|
572
|
+
/**
|
|
573
|
+
* Set the PKCS#11 URI that is used to identify which slot to use for
|
|
574
|
+
* storing trust assertions.
|
|
575
|
+
*
|
|
576
|
+
* It is not normally necessary to call this function. The relevant
|
|
577
|
+
* PKCS#11 slot is automatically configured by the GCR library.
|
|
578
|
+
* @param pkcs11_uri the uri which identifies trust storage slot
|
|
579
|
+
*/
|
|
580
|
+
function pkcs11_set_trust_store_uri(pkcs11_uri: string | null): void
|
|
581
|
+
/**
|
|
582
|
+
* Add a pinned `certificate` for connections to `peer` for `purpose`. A pinned
|
|
583
|
+
* certificate overrides all other certificate verification and should be
|
|
584
|
+
* used with care.
|
|
585
|
+
*
|
|
586
|
+
* If the same pinned certificate already exists, then this operation
|
|
587
|
+
* does not add another, and succeeds without error.
|
|
588
|
+
*
|
|
589
|
+
* This call may block, see gcr_trust_add_pinned_certificate_async() for the
|
|
590
|
+
* non-blocking version.
|
|
591
|
+
* @param certificate a #GcrCertificate
|
|
592
|
+
* @param purpose the purpose string
|
|
593
|
+
* @param peer the peer for this pinned certificate
|
|
594
|
+
* @param cancellable a #GCancellable
|
|
595
|
+
* @returns %TRUE if the pinned certificate is recorded successfully
|
|
596
|
+
*/
|
|
597
|
+
function trust_add_pinned_certificate(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
598
|
+
/**
|
|
599
|
+
* Add a pinned certificate for communication with `peer` for `purpose`. A pinned
|
|
600
|
+
* certificate overrides all other certificate verification and should be used
|
|
601
|
+
* with care.
|
|
602
|
+
*
|
|
603
|
+
* If the same pinned certificate already exists, then this operation
|
|
604
|
+
* does not add another, and succeeds without error.
|
|
605
|
+
*
|
|
606
|
+
* When the operation is finished, callback will be called. You can then call
|
|
607
|
+
* [func`Gcr`.trust_add_pinned_certificate_finish] to get the result of the
|
|
608
|
+
* operation.
|
|
609
|
+
* @param certificate a #GcrCertificate
|
|
610
|
+
* @param purpose the purpose string
|
|
611
|
+
* @param peer the peer for this pinned certificate
|
|
612
|
+
* @param cancellable a #GCancellable
|
|
613
|
+
* @param callback a #GAsyncReadyCallback to call when the operation completes
|
|
614
|
+
*/
|
|
615
|
+
function trust_add_pinned_certificate_async<Z = unknown>(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Z> | null): void
|
|
616
|
+
/**
|
|
617
|
+
* Finishes an asynchronous operation started by
|
|
618
|
+
* gcr_trust_add_pinned_certificate_async().
|
|
619
|
+
* @param result the #GAsyncResult passed to the callback
|
|
620
|
+
* @returns %TRUE if the pinned certificate is recorded successfully
|
|
621
|
+
*/
|
|
622
|
+
function trust_add_pinned_certificate_finish(result: Gio.AsyncResult): boolean
|
|
623
|
+
/**
|
|
624
|
+
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
|
|
625
|
+
* anchor is used to verify the signatures on other certificates when verifying
|
|
626
|
+
* a certificate chain. Also known as a trusted certificate authority.
|
|
627
|
+
*
|
|
628
|
+
* This call may block, see [func`Gcr`.trust_is_certificate_anchored_async] for
|
|
629
|
+
* the non-blocking version.
|
|
630
|
+
*
|
|
631
|
+
* In the case of an error, %FALSE is also returned. Check `error` to detect
|
|
632
|
+
* if an error occurred.
|
|
633
|
+
* @param certificate a #GcrCertificate to check
|
|
634
|
+
* @param purpose the purpose string
|
|
635
|
+
* @param cancellable a #GCancellable
|
|
636
|
+
* @returns %TRUE if the certificate is a trust anchor
|
|
637
|
+
*/
|
|
638
|
+
function trust_is_certificate_anchored(certificate: Certificate, purpose: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
639
|
+
/**
|
|
640
|
+
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
|
|
641
|
+
* anchor is used to verify the signatures on other certificates when verifying
|
|
642
|
+
* a certificate chain. Also known as a trusted certificate authority.
|
|
643
|
+
*
|
|
644
|
+
* When the operation is finished, callback will be called. You can then call
|
|
645
|
+
* gcr_trust_is_certificate_anchored_finish() to get the result of the operation.
|
|
646
|
+
* @param certificate a #GcrCertificate to check
|
|
647
|
+
* @param purpose the purpose string
|
|
648
|
+
* @param cancellable a #GCancellable
|
|
649
|
+
* @param callback a #GAsyncReadyCallback to call when the operation completes
|
|
650
|
+
*/
|
|
651
|
+
function trust_is_certificate_anchored_async<Z = unknown>(certificate: Certificate, purpose: string | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Z> | null): void
|
|
652
|
+
/**
|
|
653
|
+
* Finishes an asynchronous operation started by
|
|
654
|
+
* gcr_trust_is_certificate_anchored_async().
|
|
655
|
+
*
|
|
656
|
+
* In the case of an error, %FALSE is also returned. Check `error` to detect
|
|
657
|
+
* if an error occurred.
|
|
658
|
+
* @param result the #GAsyncResult passed to the callback
|
|
659
|
+
* @returns %TRUE if the certificate is a trust anchor
|
|
660
|
+
*/
|
|
661
|
+
function trust_is_certificate_anchored_finish(result: Gio.AsyncResult): boolean
|
|
662
|
+
/**
|
|
663
|
+
* Check if `certificate` is pinned for `purpose` to communicate with `peer`.
|
|
664
|
+
* A pinned certificate overrides all other certificate verification.
|
|
665
|
+
*
|
|
666
|
+
* This call may block, see gcr_trust_is_certificate_pinned_async() for the
|
|
667
|
+
* non-blocking version.
|
|
668
|
+
*
|
|
669
|
+
* In the case of an error, %FALSE is also returned. Check `error` to detect
|
|
670
|
+
* if an error occurred.
|
|
671
|
+
* @param certificate a #GcrCertificate to check
|
|
672
|
+
* @param purpose the purpose string
|
|
673
|
+
* @param peer the peer for this pinned
|
|
674
|
+
* @param cancellable a #GCancellable
|
|
675
|
+
* @returns %TRUE if the certificate is pinned for the host and purpose
|
|
676
|
+
*/
|
|
677
|
+
function trust_is_certificate_pinned(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
678
|
+
/**
|
|
679
|
+
* Check if `certificate` is pinned for `purpose` to communicate with `peer`. A
|
|
680
|
+
* pinned certificate overrides all other certificate verification.
|
|
681
|
+
*
|
|
682
|
+
* When the operation is finished, callback will be called. You can then call
|
|
683
|
+
* [func`Gcr`.trust_is_certificate_pinned_finish] to get the result of the
|
|
684
|
+
* operation.
|
|
685
|
+
* @param certificate a #GcrCertificate to check
|
|
686
|
+
* @param purpose the purpose string
|
|
687
|
+
* @param peer the peer for this pinned
|
|
688
|
+
* @param cancellable a #GCancellable
|
|
689
|
+
* @param callback a #GAsyncReadyCallback to call when the operation completes
|
|
690
|
+
*/
|
|
691
|
+
function trust_is_certificate_pinned_async<Z = unknown>(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Z> | null): void
|
|
692
|
+
/**
|
|
693
|
+
* Finishes an asynchronous operation started by
|
|
694
|
+
* gcr_trust_is_certificate_pinned_async().
|
|
695
|
+
*
|
|
696
|
+
* In the case of an error, %FALSE is also returned. Check `error` to detect
|
|
697
|
+
* if an error occurred.
|
|
698
|
+
* @param result the #GAsyncResult passed to the callback
|
|
699
|
+
* @returns %TRUE if the certificate is pinned.
|
|
700
|
+
*/
|
|
701
|
+
function trust_is_certificate_pinned_finish(result: Gio.AsyncResult): boolean
|
|
702
|
+
/**
|
|
703
|
+
* Remove a pinned certificate for communication with `peer` for `purpose`.
|
|
704
|
+
*
|
|
705
|
+
* If the same pinned certificate does not exist, or was already removed,
|
|
706
|
+
* then this operation succeeds without error.
|
|
707
|
+
*
|
|
708
|
+
* This call may block, see gcr_trust_remove_pinned_certificate_async() for the
|
|
709
|
+
* non-blocking version.
|
|
710
|
+
* @param certificate a #GcrCertificate
|
|
711
|
+
* @param purpose the purpose string
|
|
712
|
+
* @param peer the peer for this pinned certificate
|
|
713
|
+
* @param cancellable a #GCancellable
|
|
714
|
+
* @returns %TRUE if the pinned certificate no longer exists
|
|
715
|
+
*/
|
|
716
|
+
function trust_remove_pinned_certificate(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
717
|
+
/**
|
|
718
|
+
* Remove a pinned certificate for communication with `peer` for `purpose`.
|
|
719
|
+
*
|
|
720
|
+
* If the same pinned certificate does not exist, or was already removed,
|
|
721
|
+
* then this operation succeeds without error.
|
|
722
|
+
*
|
|
723
|
+
* When the operation is finished, callback will be called. You can then call
|
|
724
|
+
* gcr_trust_remove_pinned_certificate_finish() to get the result of the
|
|
725
|
+
* operation.
|
|
726
|
+
* @param certificate a #GcrCertificate
|
|
727
|
+
* @param purpose the purpose string
|
|
728
|
+
* @param peer the peer for this pinned certificate
|
|
729
|
+
* @param cancellable a #GCancellable
|
|
730
|
+
* @param callback a #GAsyncReadyCallback to call when the operation completes
|
|
731
|
+
*/
|
|
732
|
+
function trust_remove_pinned_certificate_async<Z = unknown>(certificate: Certificate, purpose: string | null, peer: string | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Z> | null): void
|
|
733
|
+
/**
|
|
734
|
+
* Finishes an asynchronous operation started by
|
|
735
|
+
* gcr_trust_remove_pinned_certificate_async().
|
|
736
|
+
* @param result the #GAsyncResult passed to the callback
|
|
737
|
+
* @returns %TRUE if the pinned certificate no longer exists
|
|
738
|
+
*/
|
|
739
|
+
function trust_remove_pinned_certificate_finish(result: Gio.AsyncResult): boolean
|
|
740
|
+
/**
|
|
741
|
+
* A function which is called by [class`FilterCollection]` in order to determine
|
|
742
|
+
* whether an object should show through the filter or not.
|
|
743
|
+
* @callback
|
|
744
|
+
* @param object object to filter
|
|
745
|
+
* @returns %TRUE if an object should be included in the filtered collection
|
|
746
|
+
*/
|
|
747
|
+
interface FilterCollectionFunc {
|
|
748
|
+
(object: GObject.Object): boolean
|
|
749
|
+
}
|
|
750
|
+
module Certificate {
|
|
751
|
+
|
|
752
|
+
// Constructor properties interface
|
|
753
|
+
|
|
754
|
+
interface ConstructorProperties extends Comparable.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
interface Certificate extends Comparable {
|
|
760
|
+
|
|
761
|
+
// Own properties of Gcr-3.Gcr.Certificate
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* A readable description for this certificate
|
|
765
|
+
*/
|
|
766
|
+
readonly description: string | null
|
|
767
|
+
/**
|
|
768
|
+
* The expiry date of the certificate
|
|
769
|
+
*/
|
|
770
|
+
readonly expiry: GLib.Date
|
|
771
|
+
/**
|
|
772
|
+
* An icon representing the certificate
|
|
773
|
+
*/
|
|
774
|
+
readonly icon: Gio.Icon
|
|
775
|
+
/**
|
|
776
|
+
* Common name part of the certificate issuer
|
|
777
|
+
*/
|
|
778
|
+
readonly issuer: string | null
|
|
779
|
+
/**
|
|
780
|
+
* A readable label for this certificate.
|
|
781
|
+
*/
|
|
782
|
+
readonly label: string | null
|
|
783
|
+
/**
|
|
784
|
+
* GLib markup to describe the certificate
|
|
785
|
+
*/
|
|
786
|
+
readonly markup: string | null
|
|
787
|
+
/**
|
|
788
|
+
* Common name part of the certificate subject
|
|
789
|
+
*/
|
|
790
|
+
readonly subject: string | null
|
|
791
|
+
|
|
792
|
+
// Owm methods of Gcr-3.Gcr.Certificate
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Get the basic constraints for the certificate if present. If %FALSE is
|
|
796
|
+
* returned then no basic constraints are present and the `is_ca` and
|
|
797
|
+
* `path_len` arguments are not changed.
|
|
798
|
+
* @returns whether basic constraints are present or not
|
|
799
|
+
*/
|
|
800
|
+
get_basic_constraints(): [ /* returnType */ boolean, /* is_ca */ boolean, /* path_len */ number ]
|
|
801
|
+
/**
|
|
802
|
+
* Gets the raw DER data for an X.509 certificate.
|
|
803
|
+
* @returns raw DER data of the X.509 certificate
|
|
804
|
+
*/
|
|
805
|
+
get_der_data(): Uint8Array
|
|
806
|
+
/**
|
|
807
|
+
* Get the expiry date of this certificate.
|
|
808
|
+
*
|
|
809
|
+
* The #GDate returned should be freed by the caller using
|
|
810
|
+
* g_date_free() when no longer required.
|
|
811
|
+
* @returns An allocated expiry date of this certificate.
|
|
812
|
+
*/
|
|
813
|
+
get_expiry_date(): GLib.Date
|
|
814
|
+
/**
|
|
815
|
+
* Calculate the fingerprint for this certificate.
|
|
816
|
+
*
|
|
817
|
+
* The caller should free the returned data using g_free() when
|
|
818
|
+
* it is no longer required.
|
|
819
|
+
* @param type the type of algorithm for the fingerprint.
|
|
820
|
+
* @returns the raw binary fingerprint
|
|
821
|
+
*/
|
|
822
|
+
get_fingerprint(type: GLib.ChecksumType): Uint8Array
|
|
823
|
+
/**
|
|
824
|
+
* Calculate the fingerprint for this certificate, and return it
|
|
825
|
+
* as a hex string.
|
|
826
|
+
*
|
|
827
|
+
* The caller should free the returned data using g_free() when
|
|
828
|
+
* it is no longer required.
|
|
829
|
+
* @param type the type of algorithm for the fingerprint.
|
|
830
|
+
* @returns an allocated hex string which contains the fingerprint.
|
|
831
|
+
*/
|
|
832
|
+
get_fingerprint_hex(type: GLib.ChecksumType): string | null
|
|
833
|
+
/**
|
|
834
|
+
* Get the issued date of this certificate.
|
|
835
|
+
*
|
|
836
|
+
* The #GDate returned should be freed by the caller using
|
|
837
|
+
* g_date_free() when no longer required.
|
|
838
|
+
* @returns An allocated issued date of this certificate.
|
|
839
|
+
*/
|
|
840
|
+
get_issued_date(): GLib.Date
|
|
841
|
+
/**
|
|
842
|
+
* Get the common name of the issuer of this certificate.
|
|
843
|
+
*
|
|
844
|
+
* The string returned should be freed by the caller when no longer
|
|
845
|
+
* required.
|
|
846
|
+
* @returns The allocated issuer CN, or %NULL if no issuer CN present.
|
|
847
|
+
*/
|
|
848
|
+
get_issuer_cn(): string | null
|
|
849
|
+
/**
|
|
850
|
+
* Get the full issuer DN of the certificate as a (mostly)
|
|
851
|
+
* readable string.
|
|
852
|
+
*
|
|
853
|
+
* The string returned should be freed by the caller when no longer
|
|
854
|
+
* required.
|
|
855
|
+
* @returns The allocated issuer DN of the certificate.
|
|
856
|
+
*/
|
|
857
|
+
get_issuer_dn(): string | null
|
|
858
|
+
/**
|
|
859
|
+
* Get a name to represent the issuer of this certificate.
|
|
860
|
+
*
|
|
861
|
+
* This will try to lookup the common name, orianizational unit,
|
|
862
|
+
* organization in that order.
|
|
863
|
+
* @returns the allocated issuer name, or %NULL if no issuer name
|
|
864
|
+
*/
|
|
865
|
+
get_issuer_name(): string | null
|
|
866
|
+
/**
|
|
867
|
+
* Get a part of the DN of the issuer of this certificate.
|
|
868
|
+
*
|
|
869
|
+
* Examples of a `part` might be the 'OU' (organizational unit)
|
|
870
|
+
* or the 'CN' (common name). Only the value of that part
|
|
871
|
+
* of the DN is returned.
|
|
872
|
+
*
|
|
873
|
+
* The string returned should be freed by the caller when no longer
|
|
874
|
+
* required.
|
|
875
|
+
* @param part a DN type string or OID.
|
|
876
|
+
* @returns the allocated part of the issuer DN, or %NULL if no such part is present
|
|
877
|
+
*/
|
|
878
|
+
get_issuer_part(part: string | null): string | null
|
|
879
|
+
/**
|
|
880
|
+
* Get the raw DER data for the issuer DN of the certificate.
|
|
881
|
+
*
|
|
882
|
+
* The data should be freed by using g_free() when no longer required.
|
|
883
|
+
* @returns allocated memory containing the raw issuer
|
|
884
|
+
*/
|
|
885
|
+
get_issuer_raw(): Uint8Array
|
|
886
|
+
/**
|
|
887
|
+
* Get the key size in bits of the public key represented
|
|
888
|
+
* by this certificate.
|
|
889
|
+
* @returns The key size of the certificate.
|
|
890
|
+
*/
|
|
891
|
+
get_key_size(): number
|
|
892
|
+
/**
|
|
893
|
+
* Calculate a GMarkup string for displaying this certificate.
|
|
894
|
+
* @returns the markup string
|
|
895
|
+
*/
|
|
896
|
+
get_markup_text(): string | null
|
|
897
|
+
/**
|
|
898
|
+
* Get the raw binary serial number of the certificate.
|
|
899
|
+
*
|
|
900
|
+
* The caller should free the returned data using g_free() when
|
|
901
|
+
* it is no longer required.
|
|
902
|
+
* @returns the raw binary serial number.
|
|
903
|
+
*/
|
|
904
|
+
get_serial_number(): Uint8Array
|
|
905
|
+
/**
|
|
906
|
+
* Get the serial number of the certificate as a hex string.
|
|
907
|
+
*
|
|
908
|
+
* The caller should free the returned data using g_free() when
|
|
909
|
+
* it is no longer required.
|
|
910
|
+
* @returns an allocated string containing the serial number as hex.
|
|
911
|
+
*/
|
|
912
|
+
get_serial_number_hex(): string | null
|
|
913
|
+
/**
|
|
914
|
+
* Get the common name of the subject of this certificate.
|
|
915
|
+
*
|
|
916
|
+
* The string returned should be freed by the caller when no longer
|
|
917
|
+
* required.
|
|
918
|
+
* @returns The allocated subject CN, or %NULL if no subject CN present.
|
|
919
|
+
*/
|
|
920
|
+
get_subject_cn(): string | null
|
|
921
|
+
/**
|
|
922
|
+
* Get the full subject DN of the certificate as a (mostly)
|
|
923
|
+
* readable string.
|
|
924
|
+
*
|
|
925
|
+
* The string returned should be freed by the caller when no longer
|
|
926
|
+
* required.
|
|
927
|
+
* @returns The allocated subject DN of the certificate.
|
|
928
|
+
*/
|
|
929
|
+
get_subject_dn(): string | null
|
|
930
|
+
/**
|
|
931
|
+
* Get a name to represent the subject of this certificate.
|
|
932
|
+
*
|
|
933
|
+
* This will try to lookup the common name, orianizational unit,
|
|
934
|
+
* organization in that order.
|
|
935
|
+
* @returns the allocated subject name, or %NULL if no subject name
|
|
936
|
+
*/
|
|
937
|
+
get_subject_name(): string | null
|
|
938
|
+
/**
|
|
939
|
+
* Get a part of the DN of the subject of this certificate.
|
|
940
|
+
*
|
|
941
|
+
* Examples of a `part` might be the 'OU' (organizational unit)
|
|
942
|
+
* or the 'CN' (common name). Only the value of that part
|
|
943
|
+
* of the DN is returned.
|
|
944
|
+
*
|
|
945
|
+
* The string returned should be freed by the caller when no longer
|
|
946
|
+
* required.
|
|
947
|
+
* @param part a DN type string or OID.
|
|
948
|
+
* @returns the allocated part of the subject DN, or %NULL if no such part is present.
|
|
949
|
+
*/
|
|
950
|
+
get_subject_part(part: string | null): string | null
|
|
951
|
+
/**
|
|
952
|
+
* Get the raw DER data for the subject DN of the certificate.
|
|
953
|
+
*
|
|
954
|
+
* The data should be freed by using g_free() when no longer required.
|
|
955
|
+
* @returns allocated memory containing the raw subject
|
|
956
|
+
*/
|
|
957
|
+
get_subject_raw(): Uint8Array
|
|
958
|
+
/**
|
|
959
|
+
* Check if `issuer` could be the issuer of this certificate. This is done by
|
|
960
|
+
* comparing the relevant subject and issuer fields. No signature check is
|
|
961
|
+
* done. Proper verification of certificates must be done via a crypto
|
|
962
|
+
* library.
|
|
963
|
+
* @param issuer a possible issuer #GcrCertificate
|
|
964
|
+
* @returns whether @issuer could be the issuer of the certificate.
|
|
965
|
+
*/
|
|
966
|
+
is_issuer(issuer: Certificate): boolean
|
|
967
|
+
/**
|
|
968
|
+
* Implementers of the #GcrCertificate mixin should call this function to notify
|
|
969
|
+
* when the certificate has changed to emit notifications on the various
|
|
970
|
+
* properties.
|
|
971
|
+
*/
|
|
972
|
+
mixin_emit_notify(): void
|
|
973
|
+
|
|
974
|
+
// Own virtual methods of Gcr-3.Gcr.Certificate
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Gets the raw DER data for an X.509 certificate.
|
|
978
|
+
* @virtual
|
|
979
|
+
* @returns raw DER data of the X.509 certificate
|
|
980
|
+
*/
|
|
981
|
+
vfunc_get_der_data(): Uint8Array
|
|
982
|
+
|
|
983
|
+
// Class property signals of Gcr-3.Gcr.Certificate
|
|
984
|
+
|
|
985
|
+
connect(sigName: "notify::description", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
986
|
+
connect_after(sigName: "notify::description", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
987
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
988
|
+
connect(sigName: "notify::expiry", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
989
|
+
connect_after(sigName: "notify::expiry", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
990
|
+
emit(sigName: "notify::expiry", ...args: any[]): void
|
|
991
|
+
connect(sigName: "notify::icon", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
992
|
+
connect_after(sigName: "notify::icon", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
993
|
+
emit(sigName: "notify::icon", ...args: any[]): void
|
|
994
|
+
connect(sigName: "notify::issuer", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
995
|
+
connect_after(sigName: "notify::issuer", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
996
|
+
emit(sigName: "notify::issuer", ...args: any[]): void
|
|
997
|
+
connect(sigName: "notify::label", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
998
|
+
connect_after(sigName: "notify::label", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
999
|
+
emit(sigName: "notify::label", ...args: any[]): void
|
|
1000
|
+
connect(sigName: "notify::markup", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
1001
|
+
connect_after(sigName: "notify::markup", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
1002
|
+
emit(sigName: "notify::markup", ...args: any[]): void
|
|
1003
|
+
connect(sigName: "notify::subject", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
1004
|
+
connect_after(sigName: "notify::subject", callback: (($obj: Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
1005
|
+
emit(sigName: "notify::subject", ...args: any[]): void
|
|
1006
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1007
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1008
|
+
emit(sigName: string, ...args: any[]): void
|
|
1009
|
+
disconnect(id: number): void
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* An interface that represents an X.509 certificate.
|
|
1014
|
+
*
|
|
1015
|
+
* Objects can implement this interface to make a certificate usable with the
|
|
1016
|
+
* GCR library.
|
|
1017
|
+
*
|
|
1018
|
+
* Various methods are available to parse out relevant bits of the certificate.
|
|
1019
|
+
* However no verification of the validity of a certificate is done here. Use
|
|
1020
|
+
* your favorite crypto library to do this.
|
|
1021
|
+
*
|
|
1022
|
+
* You can use [class`SimpleCertificate]` to simply load a certificate for which
|
|
1023
|
+
* you already have the raw certificate data.
|
|
1024
|
+
*
|
|
1025
|
+
* The #GcrCertificate interface has several properties that must be implemented.
|
|
1026
|
+
* You can use a mixin to implement these properties if desired. See the
|
|
1027
|
+
* gcr_certificate_mixin_class_init() and gcr_certificate_mixin_get_property()
|
|
1028
|
+
* functions.
|
|
1029
|
+
*
|
|
1030
|
+
* All certificates are comparable. If implementing a #GcrCertificate, you can
|
|
1031
|
+
* use GCR_CERTIFICATE_MIXIN_IMPLEMENT_COMPARABLE() to implement the #GcrComparable
|
|
1032
|
+
* interface.
|
|
1033
|
+
* @interface
|
|
1034
|
+
*/
|
|
1035
|
+
class Certificate extends GObject.Object {
|
|
1036
|
+
|
|
1037
|
+
// Own properties of Gcr-3.Gcr.Certificate
|
|
1038
|
+
|
|
1039
|
+
static name: string
|
|
1040
|
+
static $gtype: GObject.GType<Certificate>
|
|
1041
|
+
|
|
1042
|
+
// Constructors of Gcr-3.Gcr.Certificate
|
|
1043
|
+
|
|
1044
|
+
constructor(config?: Certificate.ConstructorProperties)
|
|
1045
|
+
_init(config?: Certificate.ConstructorProperties): void
|
|
1046
|
+
/**
|
|
1047
|
+
* Compare one certificate against another. If the certificates are equal
|
|
1048
|
+
* then zero is returned. If one certificate is %NULL or not a certificate,
|
|
1049
|
+
* then a non-zero value is returned.
|
|
1050
|
+
*
|
|
1051
|
+
* The return value is useful in a stable sort, but has no user logical
|
|
1052
|
+
* meaning.
|
|
1053
|
+
* @param first the certificate to compare
|
|
1054
|
+
* @param other the certificate to compare against
|
|
1055
|
+
* @returns zero if the certificates match, non-zero otherwise.
|
|
1056
|
+
*/
|
|
1057
|
+
static compare(first: Comparable | null, other: Comparable | null): number
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
module Collection {
|
|
1061
|
+
|
|
1062
|
+
// Signal callback interfaces
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Signal callback interface for `added`
|
|
1066
|
+
*/
|
|
1067
|
+
interface AddedSignalCallback {
|
|
1068
|
+
($obj: Collection, object: GObject.Object): void
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Signal callback interface for `removed`
|
|
1073
|
+
*/
|
|
1074
|
+
interface RemovedSignalCallback {
|
|
1075
|
+
($obj: Collection, object: GObject.Object): void
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
// Constructor properties interface
|
|
1080
|
+
|
|
1081
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
interface Collection {
|
|
1087
|
+
|
|
1088
|
+
// Owm methods of Gcr-3.Gcr.Collection
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Check whether the collection contains an object or not.
|
|
1092
|
+
* @param object object to check
|
|
1093
|
+
* @returns whether the collection contains this object
|
|
1094
|
+
*/
|
|
1095
|
+
contains(object: GObject.Object): boolean
|
|
1096
|
+
/**
|
|
1097
|
+
* Emit the #GcrCollection::added signal for the given object. This function
|
|
1098
|
+
* is used by implementors of this interface.
|
|
1099
|
+
* @param object The object that was added
|
|
1100
|
+
*/
|
|
1101
|
+
emit_added(object: GObject.Object): void
|
|
1102
|
+
/**
|
|
1103
|
+
* Emit the #GcrCollection::removed signal for the given object. This function
|
|
1104
|
+
* is used by implementors of this interface.
|
|
1105
|
+
* @param object The object that was removed
|
|
1106
|
+
*/
|
|
1107
|
+
emit_removed(object: GObject.Object): void
|
|
1108
|
+
/**
|
|
1109
|
+
* Get the number of objects in this collection.
|
|
1110
|
+
* @returns The number of objects.
|
|
1111
|
+
*/
|
|
1112
|
+
get_length(): number
|
|
1113
|
+
/**
|
|
1114
|
+
* Get a list of the objects in this collection.
|
|
1115
|
+
* @returns a list of the objects in this collection, which should be freed with g_list_free()
|
|
1116
|
+
*/
|
|
1117
|
+
get_objects(): GObject.Object[]
|
|
1118
|
+
|
|
1119
|
+
// Own virtual methods of Gcr-3.Gcr.Collection
|
|
1120
|
+
|
|
1121
|
+
vfunc_added(object: GObject.Object): void
|
|
1122
|
+
/**
|
|
1123
|
+
* Check whether the collection contains an object or not.
|
|
1124
|
+
* @virtual
|
|
1125
|
+
* @param object object to check
|
|
1126
|
+
* @returns whether the collection contains this object
|
|
1127
|
+
*/
|
|
1128
|
+
vfunc_contains(object: GObject.Object): boolean
|
|
1129
|
+
/**
|
|
1130
|
+
* Get the number of objects in this collection.
|
|
1131
|
+
* @virtual
|
|
1132
|
+
* @returns The number of objects.
|
|
1133
|
+
*/
|
|
1134
|
+
vfunc_get_length(): number
|
|
1135
|
+
/**
|
|
1136
|
+
* Get a list of the objects in this collection.
|
|
1137
|
+
* @virtual
|
|
1138
|
+
* @returns a list of the objects in this collection, which should be freed with g_list_free()
|
|
1139
|
+
*/
|
|
1140
|
+
vfunc_get_objects(): GObject.Object[]
|
|
1141
|
+
vfunc_removed(object: GObject.Object): void
|
|
1142
|
+
|
|
1143
|
+
// Own signals of Gcr-3.Gcr.Collection
|
|
1144
|
+
|
|
1145
|
+
connect(sigName: "added", callback: Collection.AddedSignalCallback): number
|
|
1146
|
+
connect_after(sigName: "added", callback: Collection.AddedSignalCallback): number
|
|
1147
|
+
emit(sigName: "added", object: GObject.Object, ...args: any[]): void
|
|
1148
|
+
connect(sigName: "removed", callback: Collection.RemovedSignalCallback): number
|
|
1149
|
+
connect_after(sigName: "removed", callback: Collection.RemovedSignalCallback): number
|
|
1150
|
+
emit(sigName: "removed", object: GObject.Object, ...args: any[]): void
|
|
1151
|
+
|
|
1152
|
+
// Class property signals of Gcr-3.Gcr.Collection
|
|
1153
|
+
|
|
1154
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1155
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1156
|
+
emit(sigName: string, ...args: any[]): void
|
|
1157
|
+
disconnect(id: number): void
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* A #GcrCollection is used to group a set of objects.
|
|
1162
|
+
*
|
|
1163
|
+
* This is an abstract interface which can be used to determine which objects
|
|
1164
|
+
* show up in a selector or other user interface element.
|
|
1165
|
+
*
|
|
1166
|
+
* Use [ctor`SimpleCollection`.new] to create a concrete implementation of this
|
|
1167
|
+
* interface which you can add objects to.
|
|
1168
|
+
* @interface
|
|
1169
|
+
*/
|
|
1170
|
+
class Collection extends GObject.Object {
|
|
1171
|
+
|
|
1172
|
+
// Own properties of Gcr-3.Gcr.Collection
|
|
1173
|
+
|
|
1174
|
+
static name: string
|
|
1175
|
+
static $gtype: GObject.GType<Collection>
|
|
1176
|
+
|
|
1177
|
+
// Constructors of Gcr-3.Gcr.Collection
|
|
1178
|
+
|
|
1179
|
+
constructor(config?: Collection.ConstructorProperties)
|
|
1180
|
+
_init(config?: Collection.ConstructorProperties): void
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
module Comparable {
|
|
1184
|
+
|
|
1185
|
+
// Constructor properties interface
|
|
1186
|
+
|
|
1187
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
interface Comparable {
|
|
1193
|
+
|
|
1194
|
+
// Owm methods of Gcr-3.Gcr.Comparable
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* Compare whether two objects represent the same thing. The return value can
|
|
1198
|
+
* also be used to sort the objects.
|
|
1199
|
+
* @param other Another comparable object
|
|
1200
|
+
* @returns Zero if the two objects represent the same thing, non-zero if not.
|
|
1201
|
+
*/
|
|
1202
|
+
compare(other: Comparable | null): number
|
|
1203
|
+
|
|
1204
|
+
// Own virtual methods of Gcr-3.Gcr.Comparable
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Compare whether two objects represent the same thing. The return value can
|
|
1208
|
+
* also be used to sort the objects.
|
|
1209
|
+
* @virtual
|
|
1210
|
+
* @param other Another comparable object
|
|
1211
|
+
* @returns Zero if the two objects represent the same thing, non-zero if not.
|
|
1212
|
+
*/
|
|
1213
|
+
vfunc_compare(other: Comparable | null): number
|
|
1214
|
+
|
|
1215
|
+
// Class property signals of Gcr-3.Gcr.Comparable
|
|
1216
|
+
|
|
1217
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1218
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1219
|
+
emit(sigName: string, ...args: any[]): void
|
|
1220
|
+
disconnect(id: number): void
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* An interface for comparing objects
|
|
1225
|
+
* @interface
|
|
1226
|
+
*/
|
|
1227
|
+
class Comparable extends GObject.Object {
|
|
1228
|
+
|
|
1229
|
+
// Own properties of Gcr-3.Gcr.Comparable
|
|
1230
|
+
|
|
1231
|
+
static name: string
|
|
1232
|
+
static $gtype: GObject.GType<Comparable>
|
|
1233
|
+
|
|
1234
|
+
// Constructors of Gcr-3.Gcr.Comparable
|
|
1235
|
+
|
|
1236
|
+
constructor(config?: Comparable.ConstructorProperties)
|
|
1237
|
+
_init(config?: Comparable.ConstructorProperties): void
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
module ImportInteraction {
|
|
1241
|
+
|
|
1242
|
+
// Constructor properties interface
|
|
1243
|
+
|
|
1244
|
+
interface ConstructorProperties extends Gio.TlsInteraction.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
interface ImportInteraction extends Gio.TlsInteraction {
|
|
1250
|
+
|
|
1251
|
+
// Owm methods of Gcr-3.Gcr.ImportInteraction
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Supplement attributes before import. This means prompting the user for
|
|
1255
|
+
* things like labels and the like. The needed attributes will have been passed
|
|
1256
|
+
* to gcr_import_interaction_supplement_prep().
|
|
1257
|
+
*
|
|
1258
|
+
* This method prompts the user and fills in the attributes. If the user or
|
|
1259
|
+
* cancellable cancels the operation the error should be set with %G_IO_ERROR_CANCELLED.
|
|
1260
|
+
* @param builder supplemented attributes
|
|
1261
|
+
* @param cancellable optional cancellable object
|
|
1262
|
+
* @returns %G_TLS_INTERACTION_HANDLED if successful or %G_TLS_INTERACTION_FAILED
|
|
1263
|
+
*/
|
|
1264
|
+
supplement(builder: Gck.Builder, cancellable: Gio.Cancellable | null): Gio.TlsInteractionResult
|
|
1265
|
+
/**
|
|
1266
|
+
* Asynchronously supplement attributes before import. This means prompting the
|
|
1267
|
+
* user for things like labels and the like. The needed attributes will have
|
|
1268
|
+
* been passed to gcr_import_interaction_supplement_prep().
|
|
1269
|
+
*
|
|
1270
|
+
* This method prompts the user and fills in the attributes.
|
|
1271
|
+
* @param builder supplemented attributes
|
|
1272
|
+
* @param cancellable optional cancellable object
|
|
1273
|
+
* @param callback called when the operation completes
|
|
1274
|
+
*/
|
|
1275
|
+
supplement_async(builder: Gck.Builder, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1276
|
+
/**
|
|
1277
|
+
* Complete operation to asynchronously supplement attributes before import.
|
|
1278
|
+
*
|
|
1279
|
+
* If the user or cancellable cancels the operation the error should be set
|
|
1280
|
+
* with %G_IO_ERROR_CANCELLED.
|
|
1281
|
+
* @param result the asynchronous result
|
|
1282
|
+
* @returns %G_TLS_INTERACTION_HANDLED if successful or %G_TLS_INTERACTION_FAILED
|
|
1283
|
+
*/
|
|
1284
|
+
supplement_finish(result: Gio.AsyncResult): Gio.TlsInteractionResult
|
|
1285
|
+
/**
|
|
1286
|
+
* Prepare for supplementing the given attributes before import. This means
|
|
1287
|
+
* prompting the user for things like labels and the like. The attributes
|
|
1288
|
+
* will contain attributes for values that the importer needs, either empty
|
|
1289
|
+
* or prefilled with suggested values.
|
|
1290
|
+
*
|
|
1291
|
+
* This method does not prompt the user, but rather just prepares the
|
|
1292
|
+
* interaction that these are the attributes that are needed.
|
|
1293
|
+
* @param builder attributes to supplement
|
|
1294
|
+
*/
|
|
1295
|
+
supplement_prep(builder: Gck.Builder): void
|
|
1296
|
+
|
|
1297
|
+
// Own virtual methods of Gcr-3.Gcr.ImportInteraction
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Supplement attributes before import. This means prompting the user for
|
|
1301
|
+
* things like labels and the like. The needed attributes will have been passed
|
|
1302
|
+
* to gcr_import_interaction_supplement_prep().
|
|
1303
|
+
*
|
|
1304
|
+
* This method prompts the user and fills in the attributes. If the user or
|
|
1305
|
+
* cancellable cancels the operation the error should be set with %G_IO_ERROR_CANCELLED.
|
|
1306
|
+
* @virtual
|
|
1307
|
+
* @param builder supplemented attributes
|
|
1308
|
+
* @param cancellable optional cancellable object
|
|
1309
|
+
* @returns %G_TLS_INTERACTION_HANDLED if successful or %G_TLS_INTERACTION_FAILED
|
|
1310
|
+
*/
|
|
1311
|
+
vfunc_supplement(builder: Gck.Builder, cancellable: Gio.Cancellable | null): Gio.TlsInteractionResult
|
|
1312
|
+
/**
|
|
1313
|
+
* Asynchronously supplement attributes before import. This means prompting the
|
|
1314
|
+
* user for things like labels and the like. The needed attributes will have
|
|
1315
|
+
* been passed to gcr_import_interaction_supplement_prep().
|
|
1316
|
+
*
|
|
1317
|
+
* This method prompts the user and fills in the attributes.
|
|
1318
|
+
* @virtual
|
|
1319
|
+
* @param builder supplemented attributes
|
|
1320
|
+
* @param cancellable optional cancellable object
|
|
1321
|
+
* @param callback called when the operation completes
|
|
1322
|
+
*/
|
|
1323
|
+
vfunc_supplement_async(builder: Gck.Builder, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1324
|
+
/**
|
|
1325
|
+
* Complete operation to asynchronously supplement attributes before import.
|
|
1326
|
+
*
|
|
1327
|
+
* If the user or cancellable cancels the operation the error should be set
|
|
1328
|
+
* with %G_IO_ERROR_CANCELLED.
|
|
1329
|
+
* @virtual
|
|
1330
|
+
* @param result the asynchronous result
|
|
1331
|
+
* @returns %G_TLS_INTERACTION_HANDLED if successful or %G_TLS_INTERACTION_FAILED
|
|
1332
|
+
*/
|
|
1333
|
+
vfunc_supplement_finish(result: Gio.AsyncResult): Gio.TlsInteractionResult
|
|
1334
|
+
/**
|
|
1335
|
+
* Prepare for supplementing the given attributes before import. This means
|
|
1336
|
+
* prompting the user for things like labels and the like. The attributes
|
|
1337
|
+
* will contain attributes for values that the importer needs, either empty
|
|
1338
|
+
* or prefilled with suggested values.
|
|
1339
|
+
*
|
|
1340
|
+
* This method does not prompt the user, but rather just prepares the
|
|
1341
|
+
* interaction that these are the attributes that are needed.
|
|
1342
|
+
* @virtual
|
|
1343
|
+
* @param builder attributes to supplement
|
|
1344
|
+
*/
|
|
1345
|
+
vfunc_supplement_prep(builder: Gck.Builder): void
|
|
1346
|
+
|
|
1347
|
+
// Class property signals of Gcr-3.Gcr.ImportInteraction
|
|
1348
|
+
|
|
1349
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1350
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1351
|
+
emit(sigName: string, ...args: any[]): void
|
|
1352
|
+
disconnect(id: number): void
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* This is an interface implemented by a caller performing an import. It allows
|
|
1357
|
+
* the importer to ask the caller for further information about the import.
|
|
1358
|
+
*
|
|
1359
|
+
* It must be implemented on a derived class of [class`Gio`.TlsInteraction]
|
|
1360
|
+
* @interface
|
|
1361
|
+
*/
|
|
1362
|
+
class ImportInteraction extends GObject.Object {
|
|
1363
|
+
|
|
1364
|
+
// Own properties of Gcr-3.Gcr.ImportInteraction
|
|
1365
|
+
|
|
1366
|
+
static name: string
|
|
1367
|
+
static $gtype: GObject.GType<ImportInteraction>
|
|
1368
|
+
|
|
1369
|
+
// Constructors of Gcr-3.Gcr.ImportInteraction
|
|
1370
|
+
|
|
1371
|
+
constructor(config?: ImportInteraction.ConstructorProperties)
|
|
1372
|
+
_init(config?: ImportInteraction.ConstructorProperties): void
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
module Importer {
|
|
1376
|
+
|
|
1377
|
+
// Constructor properties interface
|
|
1378
|
+
|
|
1379
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1380
|
+
|
|
1381
|
+
// Own constructor properties of Gcr-3.Gcr.Importer
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* The interaction for the importer.
|
|
1385
|
+
*/
|
|
1386
|
+
interaction?: Gio.TlsInteraction | null
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
interface Importer {
|
|
1392
|
+
|
|
1393
|
+
// Own properties of Gcr-3.Gcr.Importer
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* The icon for the importer.
|
|
1397
|
+
*/
|
|
1398
|
+
readonly icon: Gio.Icon
|
|
1399
|
+
/**
|
|
1400
|
+
* The interaction for the importer.
|
|
1401
|
+
*/
|
|
1402
|
+
interaction: Gio.TlsInteraction
|
|
1403
|
+
/**
|
|
1404
|
+
* The label for the importer.
|
|
1405
|
+
*/
|
|
1406
|
+
readonly label: string | null
|
|
1407
|
+
/**
|
|
1408
|
+
* The URI of the location imported to.
|
|
1409
|
+
*/
|
|
1410
|
+
readonly uri: string | null
|
|
1411
|
+
|
|
1412
|
+
// Owm methods of Gcr-3.Gcr.Importer
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* Get the interaction used to prompt the user when needed by this
|
|
1416
|
+
* importer.
|
|
1417
|
+
* @returns the interaction or %NULL
|
|
1418
|
+
*/
|
|
1419
|
+
get_interaction(): Gio.TlsInteraction | null
|
|
1420
|
+
/**
|
|
1421
|
+
* Import the queued items in the importer. This call will block
|
|
1422
|
+
* until the operation completes.
|
|
1423
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
1424
|
+
* @returns whether the items were imported successfully or not
|
|
1425
|
+
*/
|
|
1426
|
+
import(cancellable: Gio.Cancellable | null): boolean
|
|
1427
|
+
/**
|
|
1428
|
+
* Import the queued items in the importer. This function returns immediately
|
|
1429
|
+
* and completes asynchronously.
|
|
1430
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
1431
|
+
* @param callback called when the operation completes
|
|
1432
|
+
*/
|
|
1433
|
+
import_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1434
|
+
/**
|
|
1435
|
+
* Complete an asynchronous operation to import queued items.
|
|
1436
|
+
* @param result an asynchronous result
|
|
1437
|
+
* @returns whether the import succeeded or failed
|
|
1438
|
+
*/
|
|
1439
|
+
import_finish(result: Gio.AsyncResult): boolean
|
|
1440
|
+
/**
|
|
1441
|
+
* Queues an additional item to be imported. The parsed item is represented
|
|
1442
|
+
* by the state of the [class`Parser]` at the time of calling this method.
|
|
1443
|
+
*
|
|
1444
|
+
* If the parsed item is incompatible with the importer, then this will
|
|
1445
|
+
* fail and the item will not be queued.
|
|
1446
|
+
* @param parsed a parsed item to import
|
|
1447
|
+
* @returns whether the item was queued or not
|
|
1448
|
+
*/
|
|
1449
|
+
queue_for_parsed(parsed: Parsed): boolean
|
|
1450
|
+
/**
|
|
1451
|
+
* Set the interaction used to prompt the user when needed by this
|
|
1452
|
+
* importer.
|
|
1453
|
+
* @param interaction the interaction used by the importer
|
|
1454
|
+
*/
|
|
1455
|
+
set_interaction(interaction: Gio.TlsInteraction): void
|
|
1456
|
+
|
|
1457
|
+
// Own virtual methods of Gcr-3.Gcr.Importer
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* Import the queued items in the importer. This function returns immediately
|
|
1461
|
+
* and completes asynchronously.
|
|
1462
|
+
* @virtual
|
|
1463
|
+
* @param cancellable a #GCancellable, or %NULL
|
|
1464
|
+
* @param callback called when the operation completes
|
|
1465
|
+
*/
|
|
1466
|
+
vfunc_import_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1467
|
+
/**
|
|
1468
|
+
* Complete an asynchronous operation to import queued items.
|
|
1469
|
+
* @virtual
|
|
1470
|
+
* @param result an asynchronous result
|
|
1471
|
+
* @returns whether the import succeeded or failed
|
|
1472
|
+
*/
|
|
1473
|
+
vfunc_import_finish(result: Gio.AsyncResult): boolean
|
|
1474
|
+
vfunc_import_sync(cancellable: Gio.Cancellable | null): boolean
|
|
1475
|
+
/**
|
|
1476
|
+
* Queues an additional item to be imported. The parsed item is represented
|
|
1477
|
+
* by the state of the [class`Parser]` at the time of calling this method.
|
|
1478
|
+
*
|
|
1479
|
+
* If the parsed item is incompatible with the importer, then this will
|
|
1480
|
+
* fail and the item will not be queued.
|
|
1481
|
+
* @virtual
|
|
1482
|
+
* @param parsed a parsed item to import
|
|
1483
|
+
* @returns whether the item was queued or not
|
|
1484
|
+
*/
|
|
1485
|
+
vfunc_queue_for_parsed(parsed: Parsed): boolean
|
|
1486
|
+
|
|
1487
|
+
// Class property signals of Gcr-3.Gcr.Importer
|
|
1488
|
+
|
|
1489
|
+
connect(sigName: "notify::icon", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1490
|
+
connect_after(sigName: "notify::icon", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1491
|
+
emit(sigName: "notify::icon", ...args: any[]): void
|
|
1492
|
+
connect(sigName: "notify::interaction", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1493
|
+
connect_after(sigName: "notify::interaction", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1494
|
+
emit(sigName: "notify::interaction", ...args: any[]): void
|
|
1495
|
+
connect(sigName: "notify::label", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1496
|
+
connect_after(sigName: "notify::label", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1497
|
+
emit(sigName: "notify::label", ...args: any[]): void
|
|
1498
|
+
connect(sigName: "notify::uri", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1499
|
+
connect_after(sigName: "notify::uri", callback: (($obj: Importer, pspec: GObject.ParamSpec) => void)): number
|
|
1500
|
+
emit(sigName: "notify::uri", ...args: any[]): void
|
|
1501
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1502
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1503
|
+
emit(sigName: string, ...args: any[]): void
|
|
1504
|
+
disconnect(id: number): void
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* An interface which allows importing of certificates and keys. Each importer
|
|
1509
|
+
* is registered with a set of PKCS#11 attributes to match stuff that it can
|
|
1510
|
+
* import.
|
|
1511
|
+
*
|
|
1512
|
+
* An importer gets passed a [class`Parser]` and accesses the currently parsed
|
|
1513
|
+
* item. To create a set of importers that can import the currently parsed
|
|
1514
|
+
* item in a parser, use [func`Importer`.create_for_parsed]. The list of
|
|
1515
|
+
* importers returned has the parsed item queued for import.
|
|
1516
|
+
*
|
|
1517
|
+
* To queue additional items with a importer use
|
|
1518
|
+
* [method`Importer`.queue_for_parsed]. In addition you can try and queue an
|
|
1519
|
+
* additional item with a set of importers using the
|
|
1520
|
+
* [func`Importer`.queue_and_filter_for_parsed].
|
|
1521
|
+
*
|
|
1522
|
+
* To start the import, use [method`Importer`.import] or its async variants.
|
|
1523
|
+
* @interface
|
|
1524
|
+
*/
|
|
1525
|
+
class Importer extends GObject.Object {
|
|
1526
|
+
|
|
1527
|
+
// Own properties of Gcr-3.Gcr.Importer
|
|
1528
|
+
|
|
1529
|
+
static name: string
|
|
1530
|
+
static $gtype: GObject.GType<Importer>
|
|
1531
|
+
|
|
1532
|
+
// Constructors of Gcr-3.Gcr.Importer
|
|
1533
|
+
|
|
1534
|
+
constructor(config?: Importer.ConstructorProperties)
|
|
1535
|
+
_init(config?: Importer.ConstructorProperties): void
|
|
1536
|
+
/**
|
|
1537
|
+
* Create a set of importers which can import this parsed item.
|
|
1538
|
+
* The parsed item is represented by the state of the GcrParser at the
|
|
1539
|
+
* time of calling this method.
|
|
1540
|
+
* @param parsed a parser with a parsed item to import
|
|
1541
|
+
* @returns a list of importers which can import the parsed item, which should be freed with g_object_unref(), or %NULL if no types of importers can be created
|
|
1542
|
+
*/
|
|
1543
|
+
static create_for_parsed(parsed: Parsed): Importer[]
|
|
1544
|
+
/**
|
|
1545
|
+
* Queues an additional item to be imported in all compattible importers
|
|
1546
|
+
* in the set. The parsed item is represented by the state of the #GcrParser
|
|
1547
|
+
* at the time of calling this method.
|
|
1548
|
+
*
|
|
1549
|
+
* If the parsed item is incompatible with an importer, then that the item
|
|
1550
|
+
* will not be queued on that importer.
|
|
1551
|
+
* @param importers a set of importers
|
|
1552
|
+
* @param parsed a parsed item
|
|
1553
|
+
* @returns a new set of importers that queued the item, which should be freed with gck_list_unref_free()
|
|
1554
|
+
*/
|
|
1555
|
+
static queue_and_filter_for_parsed(importers: Importer[], parsed: Parsed): Importer[]
|
|
1556
|
+
/**
|
|
1557
|
+
* Register an importer to handle parsed items that match the given attributes.
|
|
1558
|
+
*
|
|
1559
|
+
* If `attrs` are a floating reference, then it is consumed.
|
|
1560
|
+
* @param importer_type the GType of the importer being registered
|
|
1561
|
+
* @param attrs the attributes that this importer is compatible with
|
|
1562
|
+
*/
|
|
1563
|
+
static register(importer_type: GObject.GType, attrs: Gck.Attributes): void
|
|
1564
|
+
/**
|
|
1565
|
+
* Register built-in PKCS#11 and GnuPG importers.
|
|
1566
|
+
*/
|
|
1567
|
+
static register_well_known(): void
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
module Prompt {
|
|
1571
|
+
|
|
1572
|
+
// Signal callback interfaces
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* Signal callback interface for `prompt-close`
|
|
1576
|
+
*/
|
|
1577
|
+
interface PromptCloseSignalCallback {
|
|
1578
|
+
($obj: Prompt): void
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
// Constructor properties interface
|
|
1583
|
+
|
|
1584
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1585
|
+
|
|
1586
|
+
// Own constructor properties of Gcr-3.Gcr.Prompt
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* The string handle of the caller's window.
|
|
1590
|
+
*
|
|
1591
|
+
* The caller window indicates to the prompt which window is prompting the
|
|
1592
|
+
* user. The prompt may choose to ignore this information or use it in whatever
|
|
1593
|
+
* way it sees fit.
|
|
1594
|
+
*
|
|
1595
|
+
* In X11, this will be a stringified version of the XWindow handle; in
|
|
1596
|
+
* Wayland this is the result of an export using the XDG foreign
|
|
1597
|
+
* protocol.
|
|
1598
|
+
*/
|
|
1599
|
+
caller_window?: string | null
|
|
1600
|
+
/**
|
|
1601
|
+
* The label for the cancel button in the prompt.
|
|
1602
|
+
*/
|
|
1603
|
+
cancel_label?: string | null
|
|
1604
|
+
/**
|
|
1605
|
+
* Whether the additional choice is chosen or not.
|
|
1606
|
+
*
|
|
1607
|
+
* The additional choice would have been setup using #GcrPrompt:choice-label.
|
|
1608
|
+
*/
|
|
1609
|
+
choice_chosen?: boolean | null
|
|
1610
|
+
/**
|
|
1611
|
+
* The label for the additional choice.
|
|
1612
|
+
*
|
|
1613
|
+
* If this is a non-%NULL value then an additional boolean choice will be
|
|
1614
|
+
* displayed by the prompt allowing the user to select or deselect it.
|
|
1615
|
+
*
|
|
1616
|
+
* If %NULL, then no additional choice is displayed.
|
|
1617
|
+
*
|
|
1618
|
+
* The initial value of the choice can be set with #GcrPrompt:choice-chosen.
|
|
1619
|
+
*/
|
|
1620
|
+
choice_label?: string | null
|
|
1621
|
+
/**
|
|
1622
|
+
* The label for the continue button in the prompt.
|
|
1623
|
+
*/
|
|
1624
|
+
continue_label?: string | null
|
|
1625
|
+
/**
|
|
1626
|
+
* The detailed description of the prompt.
|
|
1627
|
+
*
|
|
1628
|
+
* A prompt implementation may choose not to display this detailed description.
|
|
1629
|
+
* The prompt message should contain relevant information.
|
|
1630
|
+
*/
|
|
1631
|
+
description?: string | null
|
|
1632
|
+
/**
|
|
1633
|
+
* The prompt message for the user.
|
|
1634
|
+
*
|
|
1635
|
+
* A prompt implementation should always display this message.
|
|
1636
|
+
*/
|
|
1637
|
+
message?: string | null
|
|
1638
|
+
/**
|
|
1639
|
+
* Whether the prompt will prompt for a new password.
|
|
1640
|
+
*
|
|
1641
|
+
* This will cause the prompt implementation to ask the user to confirm the
|
|
1642
|
+
* password and/or display other relevant user interface for creating a new
|
|
1643
|
+
* password.
|
|
1644
|
+
*/
|
|
1645
|
+
password_new?: boolean | null
|
|
1646
|
+
/**
|
|
1647
|
+
* The title of the prompt.
|
|
1648
|
+
*
|
|
1649
|
+
* A prompt implementation may choose not to display the prompt title. The
|
|
1650
|
+
* #GcrPrompt:message should contain relevant information.
|
|
1651
|
+
*/
|
|
1652
|
+
title?: string | null
|
|
1653
|
+
/**
|
|
1654
|
+
* A prompt warning displayed on the prompt, or %NULL for no warning.
|
|
1655
|
+
*
|
|
1656
|
+
* This is a warning like "The password is incorrect." usually displayed to the
|
|
1657
|
+
* user about a previous 'unsuccessful' prompt.
|
|
1658
|
+
*/
|
|
1659
|
+
warning?: string | null
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
interface Prompt {
|
|
1665
|
+
|
|
1666
|
+
// Own properties of Gcr-3.Gcr.Prompt
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* The string handle of the caller's window.
|
|
1670
|
+
*
|
|
1671
|
+
* The caller window indicates to the prompt which window is prompting the
|
|
1672
|
+
* user. The prompt may choose to ignore this information or use it in whatever
|
|
1673
|
+
* way it sees fit.
|
|
1674
|
+
*
|
|
1675
|
+
* In X11, this will be a stringified version of the XWindow handle; in
|
|
1676
|
+
* Wayland this is the result of an export using the XDG foreign
|
|
1677
|
+
* protocol.
|
|
1678
|
+
*/
|
|
1679
|
+
caller_window: string | null
|
|
1680
|
+
/**
|
|
1681
|
+
* The label for the cancel button in the prompt.
|
|
1682
|
+
*/
|
|
1683
|
+
cancel_label: string | null
|
|
1684
|
+
/**
|
|
1685
|
+
* Whether the additional choice is chosen or not.
|
|
1686
|
+
*
|
|
1687
|
+
* The additional choice would have been setup using #GcrPrompt:choice-label.
|
|
1688
|
+
*/
|
|
1689
|
+
choice_chosen: boolean
|
|
1690
|
+
/**
|
|
1691
|
+
* The label for the additional choice.
|
|
1692
|
+
*
|
|
1693
|
+
* If this is a non-%NULL value then an additional boolean choice will be
|
|
1694
|
+
* displayed by the prompt allowing the user to select or deselect it.
|
|
1695
|
+
*
|
|
1696
|
+
* If %NULL, then no additional choice is displayed.
|
|
1697
|
+
*
|
|
1698
|
+
* The initial value of the choice can be set with #GcrPrompt:choice-chosen.
|
|
1699
|
+
*/
|
|
1700
|
+
choice_label: string | null
|
|
1701
|
+
/**
|
|
1702
|
+
* The label for the continue button in the prompt.
|
|
1703
|
+
*/
|
|
1704
|
+
continue_label: string | null
|
|
1705
|
+
/**
|
|
1706
|
+
* The detailed description of the prompt.
|
|
1707
|
+
*
|
|
1708
|
+
* A prompt implementation may choose not to display this detailed description.
|
|
1709
|
+
* The prompt message should contain relevant information.
|
|
1710
|
+
*/
|
|
1711
|
+
description: string | null
|
|
1712
|
+
/**
|
|
1713
|
+
* The prompt message for the user.
|
|
1714
|
+
*
|
|
1715
|
+
* A prompt implementation should always display this message.
|
|
1716
|
+
*/
|
|
1717
|
+
message: string | null
|
|
1718
|
+
/**
|
|
1719
|
+
* Whether the prompt will prompt for a new password.
|
|
1720
|
+
*
|
|
1721
|
+
* This will cause the prompt implementation to ask the user to confirm the
|
|
1722
|
+
* password and/or display other relevant user interface for creating a new
|
|
1723
|
+
* password.
|
|
1724
|
+
*/
|
|
1725
|
+
password_new: boolean
|
|
1726
|
+
/**
|
|
1727
|
+
* Indication of the password strength.
|
|
1728
|
+
*
|
|
1729
|
+
* Prompts will return a zero value if the password is empty, and a value
|
|
1730
|
+
* greater than zero if the password has any characters.
|
|
1731
|
+
*
|
|
1732
|
+
* This is only valid after a successful prompt for a password.
|
|
1733
|
+
*/
|
|
1734
|
+
readonly password_strength: number
|
|
1735
|
+
/**
|
|
1736
|
+
* The title of the prompt.
|
|
1737
|
+
*
|
|
1738
|
+
* A prompt implementation may choose not to display the prompt title. The
|
|
1739
|
+
* #GcrPrompt:message should contain relevant information.
|
|
1740
|
+
*/
|
|
1741
|
+
title: string | null
|
|
1742
|
+
/**
|
|
1743
|
+
* A prompt warning displayed on the prompt, or %NULL for no warning.
|
|
1744
|
+
*
|
|
1745
|
+
* This is a warning like "The password is incorrect." usually displayed to the
|
|
1746
|
+
* user about a previous 'unsuccessful' prompt.
|
|
1747
|
+
*/
|
|
1748
|
+
warning: string | null
|
|
1749
|
+
|
|
1750
|
+
// Owm methods of Gcr-3.Gcr.Prompt
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Closes the prompt so that in can no longer be used to prompt. The various
|
|
1754
|
+
* prompt methods will return results as if the user dismissed the prompt.
|
|
1755
|
+
*
|
|
1756
|
+
* The prompt may also be closed by the implementor of the prompt object.
|
|
1757
|
+
*
|
|
1758
|
+
* This emits the [signal`Prompt:`:prompt-close] signal on the prompt object.
|
|
1759
|
+
*/
|
|
1760
|
+
close(): void
|
|
1761
|
+
/**
|
|
1762
|
+
* Prompts for confirmation asking a cancel/continue style question.
|
|
1763
|
+
* Set the various properties on the prompt before calling this function to
|
|
1764
|
+
* represent the question correctly.
|
|
1765
|
+
*
|
|
1766
|
+
* This method will block until the a response is returned from the prompter.
|
|
1767
|
+
*
|
|
1768
|
+
* %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The
|
|
1769
|
+
* return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if
|
|
1770
|
+
* an error occurs. Check the `error` argument to tell the difference.
|
|
1771
|
+
* @param cancellable optional cancellation object
|
|
1772
|
+
* @returns the reply from the prompt
|
|
1773
|
+
*/
|
|
1774
|
+
confirm(cancellable: Gio.Cancellable | null): PromptReply
|
|
1775
|
+
/**
|
|
1776
|
+
* Prompts for confirmation asking a cancel/continue style question.
|
|
1777
|
+
* Set the various properties on the prompt before calling this method to
|
|
1778
|
+
* represent the question correctly.
|
|
1779
|
+
*
|
|
1780
|
+
* This method will return immediately and complete asynchronously.
|
|
1781
|
+
* @param cancellable optional cancellation object
|
|
1782
|
+
* @param callback called when the operation completes
|
|
1783
|
+
*/
|
|
1784
|
+
confirm_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1785
|
+
/**
|
|
1786
|
+
* Complete an operation to prompt for confirmation.
|
|
1787
|
+
*
|
|
1788
|
+
* %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The
|
|
1789
|
+
* return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if
|
|
1790
|
+
* an error occurs. Check the `error` argument to tell the difference.
|
|
1791
|
+
* @param result asynchronous result passed to callback
|
|
1792
|
+
* @returns the reply from the prompt
|
|
1793
|
+
*/
|
|
1794
|
+
confirm_finish(result: Gio.AsyncResult): PromptReply
|
|
1795
|
+
/**
|
|
1796
|
+
* Prompts for confirmation asking a cancel/continue style question.
|
|
1797
|
+
* Set the various properties on the prompt before calling this function to
|
|
1798
|
+
* represent the question correctly.
|
|
1799
|
+
*
|
|
1800
|
+
* This method will block until the a response is returned from the prompter
|
|
1801
|
+
* and will run a main loop similar to a `gtk_dialog_run()`. The application
|
|
1802
|
+
* will remain responsive but care must be taken to handle reentrancy issues.
|
|
1803
|
+
*
|
|
1804
|
+
* %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The
|
|
1805
|
+
* return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if
|
|
1806
|
+
* an error occurs. Check the `error` argument to tell the difference.
|
|
1807
|
+
* @param cancellable optional cancellation object
|
|
1808
|
+
* @returns the reply from the prompt
|
|
1809
|
+
*/
|
|
1810
|
+
confirm_run(cancellable: Gio.Cancellable | null): PromptReply
|
|
1811
|
+
/**
|
|
1812
|
+
* Get the string handle of the caller's window.
|
|
1813
|
+
*
|
|
1814
|
+
* The caller window indicates to the prompt which window is prompting the
|
|
1815
|
+
* user. The prompt may choose to ignore this information or use it in whatever
|
|
1816
|
+
* way it sees fit.
|
|
1817
|
+
* @returns a newly allocated string containing the string handle of the window.
|
|
1818
|
+
*/
|
|
1819
|
+
get_caller_window(): string | null
|
|
1820
|
+
/**
|
|
1821
|
+
* Get the label for the cancel button.
|
|
1822
|
+
*
|
|
1823
|
+
* This is the button that results in a %GCR_PROMPT_REPLY_CANCEL reply
|
|
1824
|
+
* from the prompt.
|
|
1825
|
+
* @returns a newly allocated string containing the label
|
|
1826
|
+
*/
|
|
1827
|
+
get_cancel_label(): string | null
|
|
1828
|
+
/**
|
|
1829
|
+
* Get whether the additional choice was chosen or not.
|
|
1830
|
+
*
|
|
1831
|
+
* The additional choice would have been setup using
|
|
1832
|
+
* gcr_prompt_set_choice_label().
|
|
1833
|
+
* @returns whether chosen
|
|
1834
|
+
*/
|
|
1835
|
+
get_choice_chosen(): boolean
|
|
1836
|
+
/**
|
|
1837
|
+
* Get the label for the additional choice.
|
|
1838
|
+
*
|
|
1839
|
+
* This will be %NULL if no additional choice is being displayed.
|
|
1840
|
+
* @returns a newly allocated string containing the additional choice or %NULL
|
|
1841
|
+
*/
|
|
1842
|
+
get_choice_label(): string | null
|
|
1843
|
+
/**
|
|
1844
|
+
* Get the label for the continue button.
|
|
1845
|
+
*
|
|
1846
|
+
* This is the button that results in a %GCR_PROMPT_REPLY_CONTINUE reply
|
|
1847
|
+
* from the prompt.
|
|
1848
|
+
* @returns a newly allocated string containing the label
|
|
1849
|
+
*/
|
|
1850
|
+
get_continue_label(): string | null
|
|
1851
|
+
/**
|
|
1852
|
+
* Get the detailed description of the prompt.
|
|
1853
|
+
*
|
|
1854
|
+
* A prompt implementation may choose not to display this detailed description.
|
|
1855
|
+
* The prompt message should contain relevant information.
|
|
1856
|
+
* @returns a newly allocated string containing the detailed description of the prompt
|
|
1857
|
+
*/
|
|
1858
|
+
get_description(): string | null
|
|
1859
|
+
/**
|
|
1860
|
+
* Gets the prompt message for the user.
|
|
1861
|
+
*
|
|
1862
|
+
* A prompt implementation should always display this message.
|
|
1863
|
+
* @returns a newly allocated string containing the detailed description of the prompt
|
|
1864
|
+
*/
|
|
1865
|
+
get_message(): string | null
|
|
1866
|
+
/**
|
|
1867
|
+
* Get whether the prompt will prompt for a new password.
|
|
1868
|
+
*
|
|
1869
|
+
* This will cause the prompt implementation to ask the user to confirm the
|
|
1870
|
+
* password and/or display other relevant user interface for creating a new
|
|
1871
|
+
* password.
|
|
1872
|
+
* @returns whether in new password mode or not
|
|
1873
|
+
*/
|
|
1874
|
+
get_password_new(): boolean
|
|
1875
|
+
/**
|
|
1876
|
+
* Get indication of the password strength.
|
|
1877
|
+
*
|
|
1878
|
+
* Prompts will return a zero value if the password is empty, and a value
|
|
1879
|
+
* greater than zero if the password has any characters.
|
|
1880
|
+
*
|
|
1881
|
+
* This is only valid after a successful prompt for a password.
|
|
1882
|
+
* @returns zero if the password is empty, greater than zero if not
|
|
1883
|
+
*/
|
|
1884
|
+
get_password_strength(): number
|
|
1885
|
+
/**
|
|
1886
|
+
* Gets the title of the prompt.
|
|
1887
|
+
*
|
|
1888
|
+
* A prompt implementation may choose not to display the prompt title. The
|
|
1889
|
+
* prompt message should contain relevant information.
|
|
1890
|
+
* @returns a newly allocated string containing the prompt title.
|
|
1891
|
+
*/
|
|
1892
|
+
get_title(): string | null
|
|
1893
|
+
/**
|
|
1894
|
+
* Get a prompt warning displayed on the prompt.
|
|
1895
|
+
*
|
|
1896
|
+
* This is a warning like "The password is incorrect." usually displayed to the
|
|
1897
|
+
* user about a previous 'unsuccessful' prompt.
|
|
1898
|
+
*
|
|
1899
|
+
* If this string is %NULL then no warning is displayed.
|
|
1900
|
+
* @returns a newly allocated string containing the prompt warning, or %NULL if no warning
|
|
1901
|
+
*/
|
|
1902
|
+
get_warning(): string | null
|
|
1903
|
+
/**
|
|
1904
|
+
* Prompts for password. Set the various properties on the prompt before calling
|
|
1905
|
+
* this method to explain which password should be entered.
|
|
1906
|
+
*
|
|
1907
|
+
* This method will block until the a response is returned from the prompter.
|
|
1908
|
+
*
|
|
1909
|
+
* A password will be returned if the user enters a password successfully.
|
|
1910
|
+
* The returned password is valid until the next time a method is called
|
|
1911
|
+
* to display another prompt.
|
|
1912
|
+
*
|
|
1913
|
+
* %NULL will be returned if the user cancels or if an error occurs. Check the
|
|
1914
|
+
* `error` argument to tell the difference.
|
|
1915
|
+
* @param cancellable optional cancellation object
|
|
1916
|
+
* @returns the password owned by the prompt, or %NULL
|
|
1917
|
+
*/
|
|
1918
|
+
password(cancellable: Gio.Cancellable | null): string | null
|
|
1919
|
+
/**
|
|
1920
|
+
* Prompts for password. Set the various properties on the prompt before calling
|
|
1921
|
+
* this method to explain which password should be entered.
|
|
1922
|
+
*
|
|
1923
|
+
* This method will return immediately and complete asynchronously.
|
|
1924
|
+
* @param cancellable optional cancellation object
|
|
1925
|
+
* @param callback called when the operation completes
|
|
1926
|
+
*/
|
|
1927
|
+
password_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
1928
|
+
/**
|
|
1929
|
+
* Complete an operation to prompt for a password.
|
|
1930
|
+
*
|
|
1931
|
+
* A password will be returned if the user enters a password successfully.
|
|
1932
|
+
* The returned password is valid until the next time a method is called
|
|
1933
|
+
* to display another prompt.
|
|
1934
|
+
*
|
|
1935
|
+
* %NULL will be returned if the user cancels or if an error occurs. Check the
|
|
1936
|
+
* `error` argument to tell the difference.
|
|
1937
|
+
* @param result asynchronous result passed to callback
|
|
1938
|
+
* @returns the password owned by the prompt, or %NULL
|
|
1939
|
+
*/
|
|
1940
|
+
password_finish(result: Gio.AsyncResult): string | null
|
|
1941
|
+
/**
|
|
1942
|
+
* Prompts for password. Set the various properties on the prompt before calling
|
|
1943
|
+
* this method to explain which password should be entered.
|
|
1944
|
+
*
|
|
1945
|
+
* This method will block until the a response is returned from the prompter
|
|
1946
|
+
* and will run a main loop similar to a gtk_dialog_run(). The application
|
|
1947
|
+
* will remain responsive but care must be taken to handle reentrancy issues.
|
|
1948
|
+
*
|
|
1949
|
+
* A password will be returned if the user enters a password successfully.
|
|
1950
|
+
* The returned password is valid until the next time a method is called
|
|
1951
|
+
* to display another prompt.
|
|
1952
|
+
*
|
|
1953
|
+
* %NULL will be returned if the user cancels or if an error occurs. Check the
|
|
1954
|
+
* `error` argument to tell the difference.
|
|
1955
|
+
* @param cancellable optional cancellation object
|
|
1956
|
+
* @returns the password owned by the prompt, or %NULL
|
|
1957
|
+
*/
|
|
1958
|
+
password_run(cancellable: Gio.Cancellable | null): string | null
|
|
1959
|
+
/**
|
|
1960
|
+
* Reset the contents and properties of the prompt.
|
|
1961
|
+
*/
|
|
1962
|
+
reset(): void
|
|
1963
|
+
/**
|
|
1964
|
+
* Set the string handle of the caller's window.
|
|
1965
|
+
*
|
|
1966
|
+
* The caller window indicates to the prompt which window is prompting the
|
|
1967
|
+
* user. The prompt may choose to ignore this information or use it in whatever
|
|
1968
|
+
* way it sees fit.
|
|
1969
|
+
* @param window_id the window id
|
|
1970
|
+
*/
|
|
1971
|
+
set_caller_window(window_id: string | null): void
|
|
1972
|
+
/**
|
|
1973
|
+
* Set the label for the continue button.
|
|
1974
|
+
*
|
|
1975
|
+
* This is the button that results in a %GCR_PROMPT_REPLY_CANCEL reply
|
|
1976
|
+
* from the prompt.
|
|
1977
|
+
* @param cancel_label the label
|
|
1978
|
+
*/
|
|
1979
|
+
set_cancel_label(cancel_label: string | null): void
|
|
1980
|
+
/**
|
|
1981
|
+
* Set whether the additional choice is chosen or not.
|
|
1982
|
+
*
|
|
1983
|
+
* The additional choice should be set up using gcr_prompt_set_choice_label().
|
|
1984
|
+
* @param chosen whether chosen
|
|
1985
|
+
*/
|
|
1986
|
+
set_choice_chosen(chosen: boolean): void
|
|
1987
|
+
/**
|
|
1988
|
+
* Set the label for the additional choice.
|
|
1989
|
+
*
|
|
1990
|
+
* If this is a non-%NULL value then an additional boolean choice will be
|
|
1991
|
+
* displayed by the prompt allowing the user to select or deselect it.
|
|
1992
|
+
*
|
|
1993
|
+
* The initial value of the choice can be set with the
|
|
1994
|
+
* gcr_prompt_set_choice_label() method.
|
|
1995
|
+
*
|
|
1996
|
+
* If this is %NULL, then no additional choice is being displayed.
|
|
1997
|
+
* @param choice_label the additional choice or %NULL
|
|
1998
|
+
*/
|
|
1999
|
+
set_choice_label(choice_label: string | null): void
|
|
2000
|
+
/**
|
|
2001
|
+
* Set the label for the continue button.
|
|
2002
|
+
*
|
|
2003
|
+
* This is the button that results in a %GCR_PROMPT_REPLY_CONTINUE reply
|
|
2004
|
+
* from the prompt.
|
|
2005
|
+
* @param continue_label the label
|
|
2006
|
+
*/
|
|
2007
|
+
set_continue_label(continue_label: string | null): void
|
|
2008
|
+
/**
|
|
2009
|
+
* Set the detailed description of the prompt.
|
|
2010
|
+
*
|
|
2011
|
+
* A prompt implementation may choose not to display this detailed description.
|
|
2012
|
+
* Use gcr_prompt_set_message() to set a general message containing relevant
|
|
2013
|
+
* information.
|
|
2014
|
+
* @param description the detailed description
|
|
2015
|
+
*/
|
|
2016
|
+
set_description(description: string | null): void
|
|
2017
|
+
/**
|
|
2018
|
+
* Sets the prompt message for the user.
|
|
2019
|
+
*
|
|
2020
|
+
* A prompt implementation should always display this message.
|
|
2021
|
+
* @param message the prompt message
|
|
2022
|
+
*/
|
|
2023
|
+
set_message(message: string | null): void
|
|
2024
|
+
/**
|
|
2025
|
+
* Set whether the prompt will prompt for a new password.
|
|
2026
|
+
*
|
|
2027
|
+
* This will cause the prompt implementation to ask the user to confirm the
|
|
2028
|
+
* password and/or display other relevant user interface for creating a new
|
|
2029
|
+
* password.
|
|
2030
|
+
* @param new_password whether in new password mode or not
|
|
2031
|
+
*/
|
|
2032
|
+
set_password_new(new_password: boolean): void
|
|
2033
|
+
/**
|
|
2034
|
+
* Sets the title of the prompt.
|
|
2035
|
+
*
|
|
2036
|
+
* A prompt implementation may choose not to display the prompt title. The
|
|
2037
|
+
* prompt message should contain relevant information.
|
|
2038
|
+
* @param title the prompt title
|
|
2039
|
+
*/
|
|
2040
|
+
set_title(title: string | null): void
|
|
2041
|
+
/**
|
|
2042
|
+
* Set a prompt warning displayed on the prompt.
|
|
2043
|
+
*
|
|
2044
|
+
* This is a warning like "The password is incorrect." usually displayed to the
|
|
2045
|
+
* user about a previous 'unsuccessful' prompt.
|
|
2046
|
+
*
|
|
2047
|
+
* If this string is %NULL then no warning is displayed.
|
|
2048
|
+
* @param warning the warning or %NULL
|
|
2049
|
+
*/
|
|
2050
|
+
set_warning(warning: string | null): void
|
|
2051
|
+
|
|
2052
|
+
// Own virtual methods of Gcr-3.Gcr.Prompt
|
|
2053
|
+
|
|
2054
|
+
vfunc_prompt_close(): void
|
|
2055
|
+
/**
|
|
2056
|
+
* Prompts for confirmation asking a cancel/continue style question.
|
|
2057
|
+
* Set the various properties on the prompt before calling this method to
|
|
2058
|
+
* represent the question correctly.
|
|
2059
|
+
*
|
|
2060
|
+
* This method will return immediately and complete asynchronously.
|
|
2061
|
+
* @virtual
|
|
2062
|
+
* @param cancellable optional cancellation object
|
|
2063
|
+
* @param callback called when the operation completes
|
|
2064
|
+
*/
|
|
2065
|
+
vfunc_prompt_confirm_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
2066
|
+
/**
|
|
2067
|
+
* Complete an operation to prompt for confirmation.
|
|
2068
|
+
*
|
|
2069
|
+
* %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The
|
|
2070
|
+
* return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if
|
|
2071
|
+
* an error occurs. Check the `error` argument to tell the difference.
|
|
2072
|
+
* @virtual
|
|
2073
|
+
* @param result asynchronous result passed to callback
|
|
2074
|
+
* @returns the reply from the prompt
|
|
2075
|
+
*/
|
|
2076
|
+
vfunc_prompt_confirm_finish(result: Gio.AsyncResult): PromptReply
|
|
2077
|
+
/**
|
|
2078
|
+
* Prompts for password. Set the various properties on the prompt before calling
|
|
2079
|
+
* this method to explain which password should be entered.
|
|
2080
|
+
*
|
|
2081
|
+
* This method will return immediately and complete asynchronously.
|
|
2082
|
+
* @virtual
|
|
2083
|
+
* @param cancellable optional cancellation object
|
|
2084
|
+
* @param callback called when the operation completes
|
|
2085
|
+
*/
|
|
2086
|
+
vfunc_prompt_password_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
2087
|
+
/**
|
|
2088
|
+
* Complete an operation to prompt for a password.
|
|
2089
|
+
*
|
|
2090
|
+
* A password will be returned if the user enters a password successfully.
|
|
2091
|
+
* The returned password is valid until the next time a method is called
|
|
2092
|
+
* to display another prompt.
|
|
2093
|
+
*
|
|
2094
|
+
* %NULL will be returned if the user cancels or if an error occurs. Check the
|
|
2095
|
+
* `error` argument to tell the difference.
|
|
2096
|
+
* @virtual
|
|
2097
|
+
* @param result asynchronous result passed to callback
|
|
2098
|
+
* @returns the password owned by the prompt, or %NULL
|
|
2099
|
+
*/
|
|
2100
|
+
vfunc_prompt_password_finish(result: Gio.AsyncResult): string | null
|
|
2101
|
+
|
|
2102
|
+
// Own signals of Gcr-3.Gcr.Prompt
|
|
2103
|
+
|
|
2104
|
+
connect(sigName: "prompt-close", callback: Prompt.PromptCloseSignalCallback): number
|
|
2105
|
+
connect_after(sigName: "prompt-close", callback: Prompt.PromptCloseSignalCallback): number
|
|
2106
|
+
emit(sigName: "prompt-close", ...args: any[]): void
|
|
2107
|
+
|
|
2108
|
+
// Class property signals of Gcr-3.Gcr.Prompt
|
|
2109
|
+
|
|
2110
|
+
connect(sigName: "notify::caller-window", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2111
|
+
connect_after(sigName: "notify::caller-window", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2112
|
+
emit(sigName: "notify::caller-window", ...args: any[]): void
|
|
2113
|
+
connect(sigName: "notify::cancel-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2114
|
+
connect_after(sigName: "notify::cancel-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2115
|
+
emit(sigName: "notify::cancel-label", ...args: any[]): void
|
|
2116
|
+
connect(sigName: "notify::choice-chosen", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2117
|
+
connect_after(sigName: "notify::choice-chosen", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2118
|
+
emit(sigName: "notify::choice-chosen", ...args: any[]): void
|
|
2119
|
+
connect(sigName: "notify::choice-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2120
|
+
connect_after(sigName: "notify::choice-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2121
|
+
emit(sigName: "notify::choice-label", ...args: any[]): void
|
|
2122
|
+
connect(sigName: "notify::continue-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2123
|
+
connect_after(sigName: "notify::continue-label", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2124
|
+
emit(sigName: "notify::continue-label", ...args: any[]): void
|
|
2125
|
+
connect(sigName: "notify::description", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2126
|
+
connect_after(sigName: "notify::description", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2127
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
2128
|
+
connect(sigName: "notify::message", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2129
|
+
connect_after(sigName: "notify::message", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2130
|
+
emit(sigName: "notify::message", ...args: any[]): void
|
|
2131
|
+
connect(sigName: "notify::password-new", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2132
|
+
connect_after(sigName: "notify::password-new", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2133
|
+
emit(sigName: "notify::password-new", ...args: any[]): void
|
|
2134
|
+
connect(sigName: "notify::password-strength", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2135
|
+
connect_after(sigName: "notify::password-strength", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2136
|
+
emit(sigName: "notify::password-strength", ...args: any[]): void
|
|
2137
|
+
connect(sigName: "notify::title", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2138
|
+
connect_after(sigName: "notify::title", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2139
|
+
emit(sigName: "notify::title", ...args: any[]): void
|
|
2140
|
+
connect(sigName: "notify::warning", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2141
|
+
connect_after(sigName: "notify::warning", callback: (($obj: Prompt, pspec: GObject.ParamSpec) => void)): number
|
|
2142
|
+
emit(sigName: "notify::warning", ...args: any[]): void
|
|
2143
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2144
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2145
|
+
emit(sigName: string, ...args: any[]): void
|
|
2146
|
+
disconnect(id: number): void
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* A prompt displayed to the user. It is an interface with various
|
|
2151
|
+
* implementations.
|
|
2152
|
+
*
|
|
2153
|
+
* Various properties are set on the prompt, and then the prompt is displayed
|
|
2154
|
+
* the various prompt methods like [method`Prompt`.password_run].
|
|
2155
|
+
*
|
|
2156
|
+
* A `GcrPrompt` may be used to display multiple related prompts. Most
|
|
2157
|
+
* implementions do not hide the window between display of multiple related
|
|
2158
|
+
* prompts, and the #GcrPrompt must be closed or destroyed in order to make
|
|
2159
|
+
* it go away. This allows the user to see that the prompts are related.
|
|
2160
|
+
*
|
|
2161
|
+
* Use `GcrPromptDialog` (part of gcr-ui) to create an in-process GTK+ dialog
|
|
2162
|
+
* prompt. Use [class`SystemPrompt]` to create a system prompt in a prompter
|
|
2163
|
+
* process.
|
|
2164
|
+
*
|
|
2165
|
+
* The prompt implementation will always display the [property`Prompt:`message]
|
|
2166
|
+
* property, but may choose not to display the [property`Prompt:`description] or
|
|
2167
|
+
* [property`Prompt:`title] properties.
|
|
2168
|
+
* @interface
|
|
2169
|
+
*/
|
|
2170
|
+
class Prompt extends GObject.Object {
|
|
2171
|
+
|
|
2172
|
+
// Own properties of Gcr-3.Gcr.Prompt
|
|
2173
|
+
|
|
2174
|
+
static name: string
|
|
2175
|
+
static $gtype: GObject.GType<Prompt>
|
|
2176
|
+
|
|
2177
|
+
// Constructors of Gcr-3.Gcr.Prompt
|
|
2178
|
+
|
|
2179
|
+
constructor(config?: Prompt.ConstructorProperties)
|
|
2180
|
+
_init(config?: Prompt.ConstructorProperties): void
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
module CertificateChain {
|
|
2184
|
+
|
|
2185
|
+
// Constructor properties interface
|
|
2186
|
+
|
|
2187
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
interface CertificateChain {
|
|
2193
|
+
|
|
2194
|
+
// Own properties of Gcr-3.Gcr.CertificateChain
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* The length of the certificate chain.
|
|
2198
|
+
*/
|
|
2199
|
+
readonly length: number
|
|
2200
|
+
|
|
2201
|
+
// Own fields of Gcr-3.Gcr.CertificateChain
|
|
2202
|
+
|
|
2203
|
+
parent: GObject.Object
|
|
2204
|
+
|
|
2205
|
+
// Owm methods of Gcr-3.Gcr.CertificateChain
|
|
2206
|
+
|
|
2207
|
+
/**
|
|
2208
|
+
* Add `certificate` to the chain. The order of certificates in the chain are
|
|
2209
|
+
* important. The first certificate should be the endpoint certificate, and
|
|
2210
|
+
* then come the signers (certificate authorities) each in turn. If a root
|
|
2211
|
+
* certificate authority is present, it should come last.
|
|
2212
|
+
*
|
|
2213
|
+
* Adding a certificate an already built chain (see
|
|
2214
|
+
* gcr_certificate_chain_build()) resets the type of the certificate chain
|
|
2215
|
+
* to %GCR_CERTIFICATE_CHAIN_UNKNOWN
|
|
2216
|
+
* @param certificate a #GcrCertificate to add to the chain
|
|
2217
|
+
*/
|
|
2218
|
+
add(certificate: Certificate): void
|
|
2219
|
+
/**
|
|
2220
|
+
* Complete a certificate chain. Once a certificate chain has been built
|
|
2221
|
+
* its status can be examined.
|
|
2222
|
+
*
|
|
2223
|
+
* This operation will lookup missing certificates in PKCS#11
|
|
2224
|
+
* modules and also that each certificate in the chain is the signer of the
|
|
2225
|
+
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
|
|
2226
|
+
* is found, then the chain is considered built. Any extra certificates are
|
|
2227
|
+
* removed from the chain.
|
|
2228
|
+
*
|
|
2229
|
+
* It's important to understand that building of a certificate chain does not
|
|
2230
|
+
* constitute verifying that chain. This is merely the first step towards
|
|
2231
|
+
* trust verification.
|
|
2232
|
+
*
|
|
2233
|
+
* The `purpose` is a string like %GCR_PURPOSE_CLIENT_AUTH and is the purpose
|
|
2234
|
+
* for which the certificate chain will be used. Trust anchors are looked up
|
|
2235
|
+
* for this purpose. This argument is required.
|
|
2236
|
+
*
|
|
2237
|
+
* The `peer` is usually the host name of the peer whith which this certificate
|
|
2238
|
+
* chain is being used. It is used to look up pinned certificates that have
|
|
2239
|
+
* been stored for this peer. If %NULL then no pinned certificates will
|
|
2240
|
+
* be considered.
|
|
2241
|
+
*
|
|
2242
|
+
* If the %GCR_CERTIFICATE_CHAIN_NO_LOOKUPS flag is specified then no
|
|
2243
|
+
* lookups for anchors or pinned certificates are done, and the resulting chain
|
|
2244
|
+
* will be neither anchored or pinned. Additionally no missing certificate
|
|
2245
|
+
* authorities are looked up in PKCS#11
|
|
2246
|
+
*
|
|
2247
|
+
* This call will block, see gcr_certificate_chain_build_async() for the
|
|
2248
|
+
* asynchronous version.
|
|
2249
|
+
* @param purpose the purpose the certificate chain will be used for
|
|
2250
|
+
* @param peer the peer the certificate chain will be used with, or %NULL
|
|
2251
|
+
* @param flags chain completion flags
|
|
2252
|
+
* @param cancellable a #GCancellable or %NULL
|
|
2253
|
+
* @returns whether the operation completed successfully
|
|
2254
|
+
*/
|
|
2255
|
+
build(purpose: string | null, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null): boolean
|
|
2256
|
+
/**
|
|
2257
|
+
* Complete a certificate chain. Once a certificate chain has been built
|
|
2258
|
+
* its status can be examined.
|
|
2259
|
+
*
|
|
2260
|
+
* This will lookup missing certificates in PKCS#11
|
|
2261
|
+
* modules and also that each certificate in the chain is the signer of the
|
|
2262
|
+
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
|
|
2263
|
+
* is found, then the chain is considered built. Any extra certificates are
|
|
2264
|
+
* removed from the chain.
|
|
2265
|
+
*
|
|
2266
|
+
* It's important to understand that building of a certificate chain does not
|
|
2267
|
+
* constitute verifying that chain. This is merely the first step towards
|
|
2268
|
+
* trust verification.
|
|
2269
|
+
*
|
|
2270
|
+
* The `purpose` is a string like %GCR_PURPOSE_CLIENT_AUTH and is the purpose
|
|
2271
|
+
* for which the certificate chain will be used. Trust anchors are looked up
|
|
2272
|
+
* for this purpose. This argument is required.
|
|
2273
|
+
*
|
|
2274
|
+
* The `peer` is usually the host name of the peer whith which this certificate
|
|
2275
|
+
* chain is being used. It is used to look up pinned certificates that have
|
|
2276
|
+
* been stored for this peer. If %NULL then no pinned certificates will
|
|
2277
|
+
* be considered.
|
|
2278
|
+
*
|
|
2279
|
+
* If the %GCR_CERTIFICATE_CHAIN_NO_LOOKUPS flag is specified then no
|
|
2280
|
+
* lookups for anchors or pinned certificates are done, and the resulting chain
|
|
2281
|
+
* will be neither anchored or pinned. Additionally no missing certificate
|
|
2282
|
+
* authorities are looked up in PKCS#11
|
|
2283
|
+
*
|
|
2284
|
+
* When the operation is finished, `callback` will be called. You can then call
|
|
2285
|
+
* gcr_certificate_chain_build_finish() to get the result of the operation.
|
|
2286
|
+
* @param purpose the purpose the certificate chain will be used for
|
|
2287
|
+
* @param peer the peer the certificate chain will be used with, or %NULL
|
|
2288
|
+
* @param flags chain completion flags
|
|
2289
|
+
* @param cancellable a #GCancellable or %NULL
|
|
2290
|
+
* @param callback this will be called when the operation completes.
|
|
2291
|
+
*/
|
|
2292
|
+
build_async(purpose: string | null, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
2293
|
+
/**
|
|
2294
|
+
* Finishes an asynchronous operation started by
|
|
2295
|
+
* gcr_certificate_chain_build_async().
|
|
2296
|
+
* @param result the #GAsyncResult passed to the callback
|
|
2297
|
+
* @returns whether the operation succeeded
|
|
2298
|
+
*/
|
|
2299
|
+
build_finish(result: Gio.AsyncResult): boolean
|
|
2300
|
+
/**
|
|
2301
|
+
* If the certificate chain has been built and is of status
|
|
2302
|
+
* %GCR_CERTIFICATE_CHAIN_ANCHORED, then this will return the anchor
|
|
2303
|
+
* certificate that was found. This is not necessarily a root certificate
|
|
2304
|
+
* authority. If an intermediate certificate authority in the chain was
|
|
2305
|
+
* found to be anchored, then that certificate will be returned.
|
|
2306
|
+
*
|
|
2307
|
+
* If an anchor is returned it does not mean that the certificate chain has
|
|
2308
|
+
* been verified, but merely that an anchor has been found.
|
|
2309
|
+
* @returns the anchor certificate, or %NULL if not anchored.
|
|
2310
|
+
*/
|
|
2311
|
+
get_anchor(): Certificate
|
|
2312
|
+
/**
|
|
2313
|
+
* Get a certificate in the chain. It is an error to call this function
|
|
2314
|
+
* with an invalid index.
|
|
2315
|
+
* @param index index of the certificate to get
|
|
2316
|
+
* @returns the certificate
|
|
2317
|
+
*/
|
|
2318
|
+
get_certificate(index: number): Certificate
|
|
2319
|
+
/**
|
|
2320
|
+
* Get the endpoint certificate in the chain. This is always the first
|
|
2321
|
+
* certificate in the chain. The endpoint certificate cannot be anchored.
|
|
2322
|
+
* @returns the endpoint certificate, or %NULL if the chain is empty
|
|
2323
|
+
*/
|
|
2324
|
+
get_endpoint(): Certificate
|
|
2325
|
+
/**
|
|
2326
|
+
* Get the length of the certificate chain.
|
|
2327
|
+
* @returns the length of the certificate chain
|
|
2328
|
+
*/
|
|
2329
|
+
get_length(): number
|
|
2330
|
+
/**
|
|
2331
|
+
* Get the status of a certificate chain. If the certificate chain has not
|
|
2332
|
+
* been built, then the status will be %GCR_CERTIFICATE_CHAIN_UNKNOWN.
|
|
2333
|
+
*
|
|
2334
|
+
* A status of %GCR_CERTIFICATE_CHAIN_ANCHORED does not mean that the
|
|
2335
|
+
* certificate chain has been verified, but merely that an anchor has been
|
|
2336
|
+
* found.
|
|
2337
|
+
* @returns the status of the certificate chain.
|
|
2338
|
+
*/
|
|
2339
|
+
get_status(): CertificateChainStatus
|
|
2340
|
+
|
|
2341
|
+
// Class property signals of Gcr-3.Gcr.CertificateChain
|
|
2342
|
+
|
|
2343
|
+
connect(sigName: "notify::length", callback: (($obj: CertificateChain, pspec: GObject.ParamSpec) => void)): number
|
|
2344
|
+
connect_after(sigName: "notify::length", callback: (($obj: CertificateChain, pspec: GObject.ParamSpec) => void)): number
|
|
2345
|
+
emit(sigName: "notify::length", ...args: any[]): void
|
|
2346
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2347
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2348
|
+
emit(sigName: string, ...args: any[]): void
|
|
2349
|
+
disconnect(id: number): void
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
/**
|
|
2353
|
+
* Represents a chain of certificates, normally used to
|
|
2354
|
+
* validate the trust in a certificate. An X.509 certificate chain has one
|
|
2355
|
+
* endpoint certificate (the one for which trust is being verified) and then
|
|
2356
|
+
* in turn the certificate that issued each previous certificate in the chain.
|
|
2357
|
+
*
|
|
2358
|
+
* This functionality is for building of certificate chains not for validating
|
|
2359
|
+
* them. Use your favorite crypto library to validate trust in a certificate
|
|
2360
|
+
* chain once its built.
|
|
2361
|
+
*
|
|
2362
|
+
* The order of certificates in the chain should be first the endpoint
|
|
2363
|
+
* certificates and then the signing certificates.
|
|
2364
|
+
*
|
|
2365
|
+
* Create a new certificate chain with [ctor`CertificateChain`.new] and then
|
|
2366
|
+
* add the certificates with [method`CertificateChain`.add].
|
|
2367
|
+
*
|
|
2368
|
+
* You can then use [method`CertificateChain`.build] to build the remainder of
|
|
2369
|
+
* the chain. This will lookup missing certificates in PKCS#11 modules and
|
|
2370
|
+
* also check that each certificate in the chain is the signer of the previous
|
|
2371
|
+
* one. If a trust anchor, pinned certificate, or self-signed certificate is
|
|
2372
|
+
* found, then the chain is considered built. Any extra certificates are
|
|
2373
|
+
* removed from the chain.
|
|
2374
|
+
*
|
|
2375
|
+
* Once the certificate chain has been built, you can access its status
|
|
2376
|
+
* through [method`CertificateChain`.get_status]. The status signifies whether
|
|
2377
|
+
* the chain is anchored on a trust root, self-signed, incomplete etc. See
|
|
2378
|
+
* [enum`CertificateChainStatus]` for information on the various statuses.
|
|
2379
|
+
*
|
|
2380
|
+
* It's important to understand that the building of a certificate chain is
|
|
2381
|
+
* merely the first step towards verifying trust in a certificate.
|
|
2382
|
+
* @class
|
|
2383
|
+
*/
|
|
2384
|
+
class CertificateChain extends GObject.Object {
|
|
2385
|
+
|
|
2386
|
+
// Own properties of Gcr-3.Gcr.CertificateChain
|
|
2387
|
+
|
|
2388
|
+
static name: string
|
|
2389
|
+
static $gtype: GObject.GType<CertificateChain>
|
|
2390
|
+
|
|
2391
|
+
// Constructors of Gcr-3.Gcr.CertificateChain
|
|
2392
|
+
|
|
2393
|
+
constructor(config?: CertificateChain.ConstructorProperties)
|
|
2394
|
+
/**
|
|
2395
|
+
* Create a new #GcrCertificateChain.
|
|
2396
|
+
* @constructor
|
|
2397
|
+
* @returns a newly allocated certificate chain
|
|
2398
|
+
*/
|
|
2399
|
+
constructor()
|
|
2400
|
+
/**
|
|
2401
|
+
* Create a new #GcrCertificateChain.
|
|
2402
|
+
* @constructor
|
|
2403
|
+
* @returns a newly allocated certificate chain
|
|
2404
|
+
*/
|
|
2405
|
+
static new(): CertificateChain
|
|
2406
|
+
_init(config?: CertificateChain.ConstructorProperties): void
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
module CertificateRequest {
|
|
2410
|
+
|
|
2411
|
+
// Constructor properties interface
|
|
2412
|
+
|
|
2413
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
2414
|
+
|
|
2415
|
+
// Own constructor properties of Gcr-3.Gcr.CertificateRequest
|
|
2416
|
+
|
|
2417
|
+
/**
|
|
2418
|
+
* The private key that this certificate request is for.
|
|
2419
|
+
*/
|
|
2420
|
+
private_key?: Gck.Object | null
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
interface CertificateRequest {
|
|
2426
|
+
|
|
2427
|
+
// Own properties of Gcr-3.Gcr.CertificateRequest
|
|
2428
|
+
|
|
2429
|
+
/**
|
|
2430
|
+
* The private key that this certificate request is for.
|
|
2431
|
+
*/
|
|
2432
|
+
readonly private_key: Gck.Object
|
|
2433
|
+
|
|
2434
|
+
// Owm methods of Gcr-3.Gcr.CertificateRequest
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* Complete and sign a certificate request, so that it can be encoded
|
|
2438
|
+
* and sent to a certificate authority.
|
|
2439
|
+
*
|
|
2440
|
+
* This call may block as it signs the request using the private key.
|
|
2441
|
+
* @param cancellable a cancellation object
|
|
2442
|
+
* @returns whether certificate request was successfully completed or not
|
|
2443
|
+
*/
|
|
2444
|
+
complete(cancellable: Gio.Cancellable | null): boolean
|
|
2445
|
+
/**
|
|
2446
|
+
* Asynchronously complete and sign a certificate request, so that it can
|
|
2447
|
+
* be encoded and sent to a certificate authority.
|
|
2448
|
+
*
|
|
2449
|
+
* This call will return immediately and complete later.
|
|
2450
|
+
* @param cancellable a cancellation object
|
|
2451
|
+
* @param callback called when the operation completes
|
|
2452
|
+
*/
|
|
2453
|
+
complete_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
2454
|
+
/**
|
|
2455
|
+
* Finish an asynchronous operation to complete and sign a certificate
|
|
2456
|
+
* request.
|
|
2457
|
+
* @param result result of the asynchronous operation
|
|
2458
|
+
* @returns whether certificate request was successfully completed or not
|
|
2459
|
+
*/
|
|
2460
|
+
complete_finish(result: Gio.AsyncResult): boolean
|
|
2461
|
+
/**
|
|
2462
|
+
* Encode the certificate request. It must have been completed with
|
|
2463
|
+
* [method`CertificateRequest`.complete] or
|
|
2464
|
+
* [method`CertificateRequest`.complete_async].
|
|
2465
|
+
*
|
|
2466
|
+
* If `textual` is %FALSE, the output is a DER encoded certificate request.
|
|
2467
|
+
*
|
|
2468
|
+
* If `textual` is %TRUE, the output is encoded as text. For PKCS#10 requests
|
|
2469
|
+
* this is done using the OpenSSL style PEM encoding.
|
|
2470
|
+
* @param textual whether to encode output as text
|
|
2471
|
+
* @returns the encoded certificate request
|
|
2472
|
+
*/
|
|
2473
|
+
encode(textual: boolean): Uint8Array
|
|
2474
|
+
/**
|
|
2475
|
+
* Get the format of this certificate request.
|
|
2476
|
+
* @returns the format
|
|
2477
|
+
*/
|
|
2478
|
+
get_format(): CertificateRequestFormat
|
|
2479
|
+
/**
|
|
2480
|
+
* Get the private key this certificate request is for.
|
|
2481
|
+
* @returns the private key,
|
|
2482
|
+
*/
|
|
2483
|
+
get_private_key(): Gck.Object
|
|
2484
|
+
/**
|
|
2485
|
+
* Set the common name encoded in the certificate request.
|
|
2486
|
+
* @param cn common name to set on the request
|
|
2487
|
+
*/
|
|
2488
|
+
set_cn(cn: string | null): void
|
|
2489
|
+
|
|
2490
|
+
// Class property signals of Gcr-3.Gcr.CertificateRequest
|
|
2491
|
+
|
|
2492
|
+
connect(sigName: "notify::private-key", callback: (($obj: CertificateRequest, pspec: GObject.ParamSpec) => void)): number
|
|
2493
|
+
connect_after(sigName: "notify::private-key", callback: (($obj: CertificateRequest, pspec: GObject.ParamSpec) => void)): number
|
|
2494
|
+
emit(sigName: "notify::private-key", ...args: any[]): void
|
|
2495
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2496
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2497
|
+
emit(sigName: string, ...args: any[]): void
|
|
2498
|
+
disconnect(id: number): void
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
/**
|
|
2502
|
+
* An object that allows creation of certificate requests. A certificate
|
|
2503
|
+
* request is sent to a certificate authority to request an X.509 certificate.
|
|
2504
|
+
*
|
|
2505
|
+
* Use [func`CertificateRequest`.prepare] to create a blank certificate
|
|
2506
|
+
* request for a given private key. Set the common name on the certificate
|
|
2507
|
+
* request with [method`CertificateRequest`.set_cn], and then sign the request
|
|
2508
|
+
* with [method`CertificateRequest`.complete_async].
|
|
2509
|
+
* @class
|
|
2510
|
+
*/
|
|
2511
|
+
class CertificateRequest extends GObject.Object {
|
|
2512
|
+
|
|
2513
|
+
// Own properties of Gcr-3.Gcr.CertificateRequest
|
|
2514
|
+
|
|
2515
|
+
static name: string
|
|
2516
|
+
static $gtype: GObject.GType<CertificateRequest>
|
|
2517
|
+
|
|
2518
|
+
// Constructors of Gcr-3.Gcr.CertificateRequest
|
|
2519
|
+
|
|
2520
|
+
constructor(config?: CertificateRequest.ConstructorProperties)
|
|
2521
|
+
_init(config?: CertificateRequest.ConstructorProperties): void
|
|
2522
|
+
/**
|
|
2523
|
+
* Check whether [class`CertificateRequest]` is capable of creating a request
|
|
2524
|
+
* for the given `private_key`.
|
|
2525
|
+
* @param private_key a private key
|
|
2526
|
+
* @param cancellable cancellation object
|
|
2527
|
+
* @returns whether a request can be created
|
|
2528
|
+
*/
|
|
2529
|
+
static capable(private_key: Gck.Object, cancellable: Gio.Cancellable | null): boolean
|
|
2530
|
+
/**
|
|
2531
|
+
* Asynchronously check whether [class`CertificateRequest]` is capable of
|
|
2532
|
+
* creating a request for the given `private_key`.
|
|
2533
|
+
* @param private_key a private key
|
|
2534
|
+
* @param cancellable cancellation object
|
|
2535
|
+
* @param callback will be called when the operation completes
|
|
2536
|
+
*/
|
|
2537
|
+
static capable_async(private_key: Gck.Object, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<CertificateRequest> | null): void
|
|
2538
|
+
/**
|
|
2539
|
+
* Get the result for asynchronously check whether [class`CertificateRequest]` is
|
|
2540
|
+
* capable of creating a request for the given `private_key`.
|
|
2541
|
+
* @param result asynchronous result
|
|
2542
|
+
* @returns whether a request can be created
|
|
2543
|
+
*/
|
|
2544
|
+
static capable_finish(result: Gio.AsyncResult): boolean
|
|
2545
|
+
/**
|
|
2546
|
+
* Create a new certificate request, in the given format for the private key.
|
|
2547
|
+
* @param format the format for the certificate request
|
|
2548
|
+
* @param private_key the private key the the certificate is being requested for
|
|
2549
|
+
* @returns a new #GcrCertificate request
|
|
2550
|
+
*/
|
|
2551
|
+
static prepare(format: CertificateRequestFormat, private_key: Gck.Object): CertificateRequest
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
module FilterCollection {
|
|
2555
|
+
|
|
2556
|
+
// Constructor properties interface
|
|
2557
|
+
|
|
2558
|
+
interface ConstructorProperties extends Collection.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
2559
|
+
|
|
2560
|
+
// Own constructor properties of Gcr-3.Gcr.FilterCollection
|
|
2561
|
+
|
|
2562
|
+
underlying?: Collection | null
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
interface FilterCollection extends Collection {
|
|
2568
|
+
|
|
2569
|
+
// Own properties of Gcr-3.Gcr.FilterCollection
|
|
2570
|
+
|
|
2571
|
+
readonly underlying: Collection
|
|
2572
|
+
|
|
2573
|
+
// Own fields of Gcr-3.Gcr.FilterCollection
|
|
2574
|
+
|
|
2575
|
+
parent: GObject.Object
|
|
2576
|
+
|
|
2577
|
+
// Owm methods of Gcr-3.Gcr.FilterCollection
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* Get the collection that is being filtered by this filter collection.
|
|
2581
|
+
* @returns the underlying collection
|
|
2582
|
+
*/
|
|
2583
|
+
get_underlying(): Collection
|
|
2584
|
+
/**
|
|
2585
|
+
* Refilter all objects in the underlying collection. Call this function if
|
|
2586
|
+
* the filter callback function changes its filtering criteria.
|
|
2587
|
+
*/
|
|
2588
|
+
refilter(): void
|
|
2589
|
+
/**
|
|
2590
|
+
* Set the callback used to filter the objects in the underlying collection.
|
|
2591
|
+
* The callback should return %TRUE if an object should appear in the
|
|
2592
|
+
* filtered collection.
|
|
2593
|
+
*
|
|
2594
|
+
* If a %NULL callback is set, then all underlynig objects will appear in the
|
|
2595
|
+
* filtered collection.
|
|
2596
|
+
*
|
|
2597
|
+
* This will refilter the collection.
|
|
2598
|
+
* @param callback function to call for each object
|
|
2599
|
+
*/
|
|
2600
|
+
set_callback(callback: FilterCollectionFunc | null): void
|
|
2601
|
+
|
|
2602
|
+
// Class property signals of Gcr-3.Gcr.FilterCollection
|
|
2603
|
+
|
|
2604
|
+
connect(sigName: "notify::underlying", callback: (($obj: FilterCollection, pspec: GObject.ParamSpec) => void)): number
|
|
2605
|
+
connect_after(sigName: "notify::underlying", callback: (($obj: FilterCollection, pspec: GObject.ParamSpec) => void)): number
|
|
2606
|
+
emit(sigName: "notify::underlying", ...args: any[]): void
|
|
2607
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2608
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2609
|
+
emit(sigName: string, ...args: any[]): void
|
|
2610
|
+
disconnect(id: number): void
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
/**
|
|
2614
|
+
* A collection which filters a [iface`Collection]`.
|
|
2615
|
+
*
|
|
2616
|
+
* An implementation of [iface`Collection]` which filters objects from another
|
|
2617
|
+
* underlying collection. Use [ctor`FilterCollection`.new_with_callback]
|
|
2618
|
+
* to create a new filter collection.
|
|
2619
|
+
*
|
|
2620
|
+
* The callback will determine the criteria for whether an object shows through
|
|
2621
|
+
* the filter or not.
|
|
2622
|
+
* @class
|
|
2623
|
+
*/
|
|
2624
|
+
class FilterCollection extends GObject.Object {
|
|
2625
|
+
|
|
2626
|
+
// Own properties of Gcr-3.Gcr.FilterCollection
|
|
2627
|
+
|
|
2628
|
+
static name: string
|
|
2629
|
+
static $gtype: GObject.GType<FilterCollection>
|
|
2630
|
+
|
|
2631
|
+
// Constructors of Gcr-3.Gcr.FilterCollection
|
|
2632
|
+
|
|
2633
|
+
constructor(config?: FilterCollection.ConstructorProperties)
|
|
2634
|
+
/**
|
|
2635
|
+
* Create a new #GcrFilterCollection.
|
|
2636
|
+
*
|
|
2637
|
+
* The callback should return %TRUE if an object should appear in the
|
|
2638
|
+
* filtered collection.
|
|
2639
|
+
*
|
|
2640
|
+
* If a %NULL callback is set, then all underlynig objects will appear in the
|
|
2641
|
+
* filtered collection.
|
|
2642
|
+
* @constructor
|
|
2643
|
+
* @param underlying the underlying collection
|
|
2644
|
+
* @param callback function to call for each object
|
|
2645
|
+
* @returns a newly allocated filtered collection, which should be freed with g_object_unref()
|
|
2646
|
+
*/
|
|
2647
|
+
static new_with_callback(underlying: Collection, callback: FilterCollectionFunc | null): FilterCollection
|
|
2648
|
+
_init(config?: FilterCollection.ConstructorProperties): void
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
module Parser {
|
|
2652
|
+
|
|
2653
|
+
// Signal callback interfaces
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Signal callback interface for `authenticate`
|
|
2657
|
+
*/
|
|
2658
|
+
interface AuthenticateSignalCallback {
|
|
2659
|
+
($obj: Parser, count: number): boolean
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
/**
|
|
2663
|
+
* Signal callback interface for `parsed`
|
|
2664
|
+
*/
|
|
2665
|
+
interface ParsedSignalCallback {
|
|
2666
|
+
($obj: Parser): void
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
|
|
2670
|
+
// Constructor properties interface
|
|
2671
|
+
|
|
2672
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
interface Parser {
|
|
2678
|
+
|
|
2679
|
+
// Own properties of Gcr-3.Gcr.Parser
|
|
2680
|
+
|
|
2681
|
+
/**
|
|
2682
|
+
* Get the attributes that make up the currently parsed item. This is
|
|
2683
|
+
* generally only valid during a #GcrParser::parsed signal.
|
|
2684
|
+
*/
|
|
2685
|
+
readonly parsed_attributes: Gck.Attributes
|
|
2686
|
+
/**
|
|
2687
|
+
* The description of the type of the currently parsed item. This is generally
|
|
2688
|
+
* only valid during a #GcrParser::parsed signal.
|
|
2689
|
+
*/
|
|
2690
|
+
readonly parsed_description: string | null
|
|
2691
|
+
/**
|
|
2692
|
+
* The label of the currently parsed item. This is generally
|
|
2693
|
+
* only valid during a #GcrParser::parsed signal.
|
|
2694
|
+
*/
|
|
2695
|
+
readonly parsed_label: string | null
|
|
2696
|
+
|
|
2697
|
+
// Own fields of Gcr-3.Gcr.Parser
|
|
2698
|
+
|
|
2699
|
+
parent: GObject.Object
|
|
2700
|
+
|
|
2701
|
+
// Owm methods of Gcr-3.Gcr.Parser
|
|
2702
|
+
|
|
2703
|
+
/**
|
|
2704
|
+
* Add a password to the set of passwords to try when parsing locked or encrypted
|
|
2705
|
+
* items. This is usually called from the #GcrParser::authenticate signal.
|
|
2706
|
+
* @param password a password to try
|
|
2707
|
+
*/
|
|
2708
|
+
add_password(password: string | null): void
|
|
2709
|
+
/**
|
|
2710
|
+
* Disable parsing of the given format. Use %GCR_FORMAT_ALL to disable all the formats.
|
|
2711
|
+
* @param format The format identifier
|
|
2712
|
+
*/
|
|
2713
|
+
format_disable(format: DataFormat): void
|
|
2714
|
+
/**
|
|
2715
|
+
* Enable parsing of the given format. Use %GCR_FORMAT_ALL to enable all the formats.
|
|
2716
|
+
* @param format The format identifier
|
|
2717
|
+
*/
|
|
2718
|
+
format_enable(format: DataFormat): void
|
|
2719
|
+
/**
|
|
2720
|
+
* Check whether the given format is supported by the parser.
|
|
2721
|
+
* @param format The format identifier
|
|
2722
|
+
* @returns Whether the format is supported.
|
|
2723
|
+
*/
|
|
2724
|
+
format_supported(format: DataFormat): boolean
|
|
2725
|
+
/**
|
|
2726
|
+
* Get the filename of the parser item.
|
|
2727
|
+
* @returns the filename set on the parser, or %NULL
|
|
2728
|
+
*/
|
|
2729
|
+
get_filename(): string | null
|
|
2730
|
+
/**
|
|
2731
|
+
* Get the currently parsed item
|
|
2732
|
+
* @returns the currently parsed item
|
|
2733
|
+
*/
|
|
2734
|
+
get_parsed(): Parsed
|
|
2735
|
+
/**
|
|
2736
|
+
* Get the attributes which make up the currently parsed item. This is generally
|
|
2737
|
+
* only valid during the #GcrParser::parsed signal.
|
|
2738
|
+
* @returns the attributes for the current item, which are owned by the parser and should not be freed
|
|
2739
|
+
*/
|
|
2740
|
+
get_parsed_attributes(): Gck.Attributes | null
|
|
2741
|
+
/**
|
|
2742
|
+
* Get the raw data block that represents this parsed object. This is only
|
|
2743
|
+
* valid during the #GcrParser::parsed signal.
|
|
2744
|
+
* @returns the raw data block of the currently parsed item; the value is owned by the parser and should not be freed
|
|
2745
|
+
*/
|
|
2746
|
+
get_parsed_block(): Uint8Array | null
|
|
2747
|
+
/**
|
|
2748
|
+
* Get the raw data block that represents this parsed object. This is only
|
|
2749
|
+
* valid during the #GcrParser::parsed signal.
|
|
2750
|
+
* @returns the raw data block of the currently parsed item
|
|
2751
|
+
*/
|
|
2752
|
+
get_parsed_bytes(): GLib.Bytes
|
|
2753
|
+
/**
|
|
2754
|
+
* Get a description for the type of the currently parsed item. This is generally
|
|
2755
|
+
* only valid during the #GcrParser::parsed signal.
|
|
2756
|
+
* @returns the description for the current item; this is owned by the parser and should not be freed
|
|
2757
|
+
*/
|
|
2758
|
+
get_parsed_description(): string | null
|
|
2759
|
+
/**
|
|
2760
|
+
* Get the format of the raw data block that represents this parsed object.
|
|
2761
|
+
* This corresponds with the data returned from gcr_parser_get_parsed_block().
|
|
2762
|
+
*
|
|
2763
|
+
* This is only valid during the #GcrParser::parsed signal.
|
|
2764
|
+
* @returns the data format of the currently parsed item
|
|
2765
|
+
*/
|
|
2766
|
+
get_parsed_format(): DataFormat
|
|
2767
|
+
/**
|
|
2768
|
+
* Get the label of the currently parsed item. This is generally only valid
|
|
2769
|
+
* during the #GcrParser::parsed signal.
|
|
2770
|
+
* @returns the label of the currently parsed item. The value is owned by the parser and should not be freed.
|
|
2771
|
+
*/
|
|
2772
|
+
get_parsed_label(): string | null
|
|
2773
|
+
/**
|
|
2774
|
+
* Parse the data. The #GcrParser::parsed and #GcrParser::authenticate signals
|
|
2775
|
+
* may fire during the parsing.
|
|
2776
|
+
* @param data the data to parse
|
|
2777
|
+
* @returns Whether the data was parsed successfully or not.
|
|
2778
|
+
*/
|
|
2779
|
+
parse_bytes(data: GLib.Bytes): boolean
|
|
2780
|
+
/**
|
|
2781
|
+
* Parse the data. The #GcrParser::parsed and #GcrParser::authenticate signals
|
|
2782
|
+
* may fire during the parsing.
|
|
2783
|
+
*
|
|
2784
|
+
* A copy of the data will be made. Use gcr_parser_parse_bytes() to avoid this.
|
|
2785
|
+
* @param data the data to parse
|
|
2786
|
+
* @returns Whether the data was parsed successfully or not.
|
|
2787
|
+
*/
|
|
2788
|
+
parse_data(data: Uint8Array): boolean
|
|
2789
|
+
/**
|
|
2790
|
+
* Parse items from the data in a #GInputStream. This function may block while
|
|
2791
|
+
* reading from the input stream. Use gcr_parser_parse_stream_async() for
|
|
2792
|
+
* a non-blocking variant.
|
|
2793
|
+
*
|
|
2794
|
+
* The #GcrParser::parsed and #GcrParser::authenticate signals
|
|
2795
|
+
* may fire during the parsing.
|
|
2796
|
+
* @param input The input stream
|
|
2797
|
+
* @param cancellable An optional cancellation object
|
|
2798
|
+
* @returns Whether the parsing completed successfully or not.
|
|
2799
|
+
*/
|
|
2800
|
+
parse_stream(input: Gio.InputStream, cancellable: Gio.Cancellable | null): boolean
|
|
2801
|
+
/**
|
|
2802
|
+
* Parse items from the data in a #GInputStream. This function completes
|
|
2803
|
+
* asyncronously and doesn't block.
|
|
2804
|
+
*
|
|
2805
|
+
* The #GcrParser::parsed and #GcrParser::authenticate signals
|
|
2806
|
+
* may fire during the parsing.
|
|
2807
|
+
* @param input The input stream
|
|
2808
|
+
* @param cancellable An optional cancellation object
|
|
2809
|
+
* @param callback Called when the operation result is ready.
|
|
2810
|
+
*/
|
|
2811
|
+
parse_stream_async(input: Gio.InputStream, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
2812
|
+
/**
|
|
2813
|
+
* Complete an operation to parse a stream.
|
|
2814
|
+
* @param result The operation result
|
|
2815
|
+
* @returns Whether the parsing completed successfully or not.
|
|
2816
|
+
*/
|
|
2817
|
+
parse_stream_finish(result: Gio.AsyncResult): boolean
|
|
2818
|
+
/**
|
|
2819
|
+
* Sets the filename of the parser item.
|
|
2820
|
+
* @param filename a string of the filename of the parser item
|
|
2821
|
+
*/
|
|
2822
|
+
set_filename(filename: string | null): void
|
|
2823
|
+
|
|
2824
|
+
// Own virtual methods of Gcr-3.Gcr.Parser
|
|
2825
|
+
|
|
2826
|
+
vfunc_authenticate(count: number): boolean
|
|
2827
|
+
vfunc_parsed(): void
|
|
2828
|
+
|
|
2829
|
+
// Own signals of Gcr-3.Gcr.Parser
|
|
2830
|
+
|
|
2831
|
+
connect(sigName: "authenticate", callback: Parser.AuthenticateSignalCallback): number
|
|
2832
|
+
connect_after(sigName: "authenticate", callback: Parser.AuthenticateSignalCallback): number
|
|
2833
|
+
emit(sigName: "authenticate", count: number, ...args: any[]): void
|
|
2834
|
+
connect(sigName: "parsed", callback: Parser.ParsedSignalCallback): number
|
|
2835
|
+
connect_after(sigName: "parsed", callback: Parser.ParsedSignalCallback): number
|
|
2836
|
+
emit(sigName: "parsed", ...args: any[]): void
|
|
2837
|
+
|
|
2838
|
+
// Class property signals of Gcr-3.Gcr.Parser
|
|
2839
|
+
|
|
2840
|
+
connect(sigName: "notify::parsed-attributes", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2841
|
+
connect_after(sigName: "notify::parsed-attributes", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2842
|
+
emit(sigName: "notify::parsed-attributes", ...args: any[]): void
|
|
2843
|
+
connect(sigName: "notify::parsed-description", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2844
|
+
connect_after(sigName: "notify::parsed-description", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2845
|
+
emit(sigName: "notify::parsed-description", ...args: any[]): void
|
|
2846
|
+
connect(sigName: "notify::parsed-label", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2847
|
+
connect_after(sigName: "notify::parsed-label", callback: (($obj: Parser, pspec: GObject.ParamSpec) => void)): number
|
|
2848
|
+
emit(sigName: "notify::parsed-label", ...args: any[]): void
|
|
2849
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2850
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2851
|
+
emit(sigName: string, ...args: any[]): void
|
|
2852
|
+
disconnect(id: number): void
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
/**
|
|
2856
|
+
* A parser for parsing various types of files or data.
|
|
2857
|
+
*
|
|
2858
|
+
* A `GcrParser` can parse various certificate and key files such as OpenSSL
|
|
2859
|
+
* PEM files, DER encoded certifictes, PKCS#8 keys and so on. Each various
|
|
2860
|
+
* format is identified by a value in the [enum`DataFormat]` enumeration.
|
|
2861
|
+
*
|
|
2862
|
+
* In order to parse data, a new parser is created with gcr_parser_new() and
|
|
2863
|
+
* then the [signal`Parser:`:authenticate] and [signal`Parser:`:parsed] signals
|
|
2864
|
+
* should be connected to. Data is then fed to the parser via
|
|
2865
|
+
* [method`Parser`.parse_data] or [method`Parser`.parse_stream].
|
|
2866
|
+
*
|
|
2867
|
+
* During the [signal`Parser:`:parsed] signal the attributes that make up the
|
|
2868
|
+
* currently parsed item can be retrieved using the
|
|
2869
|
+
* [method`Parser`.get_parsed_attributes] function.
|
|
2870
|
+
* @class
|
|
2871
|
+
*/
|
|
2872
|
+
class Parser extends GObject.Object {
|
|
2873
|
+
|
|
2874
|
+
// Own properties of Gcr-3.Gcr.Parser
|
|
2875
|
+
|
|
2876
|
+
static name: string
|
|
2877
|
+
static $gtype: GObject.GType<Parser>
|
|
2878
|
+
|
|
2879
|
+
// Constructors of Gcr-3.Gcr.Parser
|
|
2880
|
+
|
|
2881
|
+
constructor(config?: Parser.ConstructorProperties)
|
|
2882
|
+
/**
|
|
2883
|
+
* Create a new #GcrParser
|
|
2884
|
+
* @constructor
|
|
2885
|
+
* @returns a newly allocated #GcrParser
|
|
2886
|
+
*/
|
|
2887
|
+
constructor()
|
|
2888
|
+
/**
|
|
2889
|
+
* Create a new #GcrParser
|
|
2890
|
+
* @constructor
|
|
2891
|
+
* @returns a newly allocated #GcrParser
|
|
2892
|
+
*/
|
|
2893
|
+
static new(): Parser
|
|
2894
|
+
_init(config?: Parser.ConstructorProperties): void
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
module Pkcs11Certificate {
|
|
2898
|
+
|
|
2899
|
+
// Constructor properties interface
|
|
2900
|
+
|
|
2901
|
+
interface ConstructorProperties extends Certificate.ConstructorProperties, Comparable.ConstructorProperties, Gck.Object.ConstructorProperties {
|
|
2902
|
+
|
|
2903
|
+
// Own constructor properties of Gcr-3.Gcr.Pkcs11Certificate
|
|
2904
|
+
|
|
2905
|
+
/**
|
|
2906
|
+
* Automatically loaded attributes for this certificate.
|
|
2907
|
+
*/
|
|
2908
|
+
attributes?: Gck.Attributes | null
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
interface Pkcs11Certificate extends Certificate, Comparable {
|
|
2914
|
+
|
|
2915
|
+
// Own properties of Gcr-3.Gcr.Pkcs11Certificate
|
|
2916
|
+
|
|
2917
|
+
/**
|
|
2918
|
+
* Automatically loaded attributes for this certificate.
|
|
2919
|
+
*/
|
|
2920
|
+
readonly attributes: Gck.Attributes
|
|
2921
|
+
|
|
2922
|
+
// Own fields of Gcr-3.Gcr.Pkcs11Certificate
|
|
2923
|
+
|
|
2924
|
+
parent: Gck.Object & GObject.Object
|
|
2925
|
+
|
|
2926
|
+
// Owm methods of Gcr-3.Gcr.Pkcs11Certificate
|
|
2927
|
+
|
|
2928
|
+
/**
|
|
2929
|
+
* Access the automatically loaded attributes for this certificate.
|
|
2930
|
+
* @returns the certificate attributes
|
|
2931
|
+
*/
|
|
2932
|
+
get_attributes(): Gck.Attributes
|
|
2933
|
+
|
|
2934
|
+
// Conflicting methods
|
|
2935
|
+
|
|
2936
|
+
/**
|
|
2937
|
+
* Get the data for the specified attribute from the object. For convenience
|
|
2938
|
+
* the returned data has a null terminator.
|
|
2939
|
+
*
|
|
2940
|
+
* This call may block for an indefinite period.
|
|
2941
|
+
* @param attr_type The attribute to get data for.
|
|
2942
|
+
* @param cancellable A #GCancellable or %NULL
|
|
2943
|
+
* @returns the resulting PKCS#11 attribute data, or %NULL if an error occurred
|
|
2944
|
+
*/
|
|
2945
|
+
get_data(attr_type: number, cancellable: Gio.Cancellable | null): Uint8Array
|
|
2946
|
+
|
|
2947
|
+
// Overloads of get_data
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
2951
|
+
* @param key name of the key for that association
|
|
2952
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2953
|
+
*/
|
|
2954
|
+
get_data(key: string | null): any | null
|
|
2955
|
+
/**
|
|
2956
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
2957
|
+
* @param key name of the key for that association
|
|
2958
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2959
|
+
*/
|
|
2960
|
+
get_data(key: string | null): any | null
|
|
2961
|
+
|
|
2962
|
+
// Class property signals of Gcr-3.Gcr.Pkcs11Certificate
|
|
2963
|
+
|
|
2964
|
+
connect(sigName: "notify::attributes", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2965
|
+
connect_after(sigName: "notify::attributes", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2966
|
+
emit(sigName: "notify::attributes", ...args: any[]): void
|
|
2967
|
+
connect(sigName: "notify::handle", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2968
|
+
connect_after(sigName: "notify::handle", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2969
|
+
emit(sigName: "notify::handle", ...args: any[]): void
|
|
2970
|
+
connect(sigName: "notify::module", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2971
|
+
connect_after(sigName: "notify::module", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2972
|
+
emit(sigName: "notify::module", ...args: any[]): void
|
|
2973
|
+
connect(sigName: "notify::session", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2974
|
+
connect_after(sigName: "notify::session", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2975
|
+
emit(sigName: "notify::session", ...args: any[]): void
|
|
2976
|
+
connect(sigName: "notify::description", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2977
|
+
connect_after(sigName: "notify::description", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2978
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
2979
|
+
connect(sigName: "notify::expiry", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2980
|
+
connect_after(sigName: "notify::expiry", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2981
|
+
emit(sigName: "notify::expiry", ...args: any[]): void
|
|
2982
|
+
connect(sigName: "notify::icon", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2983
|
+
connect_after(sigName: "notify::icon", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2984
|
+
emit(sigName: "notify::icon", ...args: any[]): void
|
|
2985
|
+
connect(sigName: "notify::issuer", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2986
|
+
connect_after(sigName: "notify::issuer", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2987
|
+
emit(sigName: "notify::issuer", ...args: any[]): void
|
|
2988
|
+
connect(sigName: "notify::label", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2989
|
+
connect_after(sigName: "notify::label", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2990
|
+
emit(sigName: "notify::label", ...args: any[]): void
|
|
2991
|
+
connect(sigName: "notify::markup", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2992
|
+
connect_after(sigName: "notify::markup", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2993
|
+
emit(sigName: "notify::markup", ...args: any[]): void
|
|
2994
|
+
connect(sigName: "notify::subject", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2995
|
+
connect_after(sigName: "notify::subject", callback: (($obj: Pkcs11Certificate, pspec: GObject.ParamSpec) => void)): number
|
|
2996
|
+
emit(sigName: "notify::subject", ...args: any[]): void
|
|
2997
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
2998
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
2999
|
+
emit(sigName: string, ...args: any[]): void
|
|
3000
|
+
disconnect(id: number): void
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* A certificate loaded from a PKCS#11 storage.
|
|
3005
|
+
* It is also a valid [class`Gck`.Object] and can be used as such.
|
|
3006
|
+
*
|
|
3007
|
+
* Use gcr_pkcs11_certificate_lookup_issuer() to lookup the issuer of a given
|
|
3008
|
+
* certificate in the PKCS#11 store.
|
|
3009
|
+
*
|
|
3010
|
+
* Various common PKCS#11 certificate attributes are automatically loaded and
|
|
3011
|
+
* are available via gcr_pkcs11_certificate_get_attributes().
|
|
3012
|
+
* @class
|
|
3013
|
+
*/
|
|
3014
|
+
class Pkcs11Certificate extends Gck.Object {
|
|
3015
|
+
|
|
3016
|
+
// Own properties of Gcr-3.Gcr.Pkcs11Certificate
|
|
3017
|
+
|
|
3018
|
+
static name: string
|
|
3019
|
+
static $gtype: GObject.GType<Pkcs11Certificate>
|
|
3020
|
+
|
|
3021
|
+
// Constructors of Gcr-3.Gcr.Pkcs11Certificate
|
|
3022
|
+
|
|
3023
|
+
constructor(config?: Pkcs11Certificate.ConstructorProperties)
|
|
3024
|
+
_init(config?: Pkcs11Certificate.ConstructorProperties): void
|
|
3025
|
+
/**
|
|
3026
|
+
* Lookup a the issuer of a `certificate` in the PKCS#11 storage. The
|
|
3027
|
+
* lookup is done using the issuer DN of the certificate. No certificate chain
|
|
3028
|
+
* verification is done. Use a crypto library to make trust decisions.
|
|
3029
|
+
*
|
|
3030
|
+
* This call may block, see gcr_pkcs11_certificate_lookup_issuer() for the
|
|
3031
|
+
* non-blocking version.
|
|
3032
|
+
*
|
|
3033
|
+
* Will return %NULL if no issuer certificate is found. Use `error` to determine
|
|
3034
|
+
* if an error occurred.
|
|
3035
|
+
* @param certificate a #GcrCertificate
|
|
3036
|
+
* @param cancellable a #GCancellable
|
|
3037
|
+
* @returns a new #GcrPkcs11Certificate, or %NULL
|
|
3038
|
+
*/
|
|
3039
|
+
static lookup_issuer(certificate: Certificate, cancellable: Gio.Cancellable | null): Certificate
|
|
3040
|
+
/**
|
|
3041
|
+
* Lookup a the issuer of a `certificate` in the PKCS#11 storage. The
|
|
3042
|
+
* lookup is done using the issuer DN of the certificate. No certificate chain
|
|
3043
|
+
* verification is done. Use a crypto library to make trust decisions.
|
|
3044
|
+
*
|
|
3045
|
+
* When the operation is finished, callback will be called. You can then call
|
|
3046
|
+
* gcr_pkcs11_certificate_lookup_issuer_finish() to get the result of the
|
|
3047
|
+
* operation.
|
|
3048
|
+
* @param certificate a #GcrCertificate
|
|
3049
|
+
* @param cancellable a #GCancellable
|
|
3050
|
+
* @param callback a #GAsyncReadyCallback to call when the operation completes
|
|
3051
|
+
*/
|
|
3052
|
+
static lookup_issuer_async(certificate: Certificate, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Pkcs11Certificate> | null): void
|
|
3053
|
+
/**
|
|
3054
|
+
* Finishes an asynchronous operation started by
|
|
3055
|
+
* gcr_pkcs11_certificate_lookup_issuer_async().
|
|
3056
|
+
*
|
|
3057
|
+
* Will return %NULL if no issuer certificate is found. Use `error` to determine
|
|
3058
|
+
* if an error occurred.
|
|
3059
|
+
* @param result the #GAsyncResult passed to the callback
|
|
3060
|
+
* @returns a new #GcrPkcs11Certificate, or %NULL
|
|
3061
|
+
*/
|
|
3062
|
+
static lookup_issuer_finish(result: Gio.AsyncResult): Certificate
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
module SecretExchange {
|
|
3066
|
+
|
|
3067
|
+
// Constructor properties interface
|
|
3068
|
+
|
|
3069
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
3070
|
+
|
|
3071
|
+
// Own constructor properties of Gcr-3.Gcr.SecretExchange
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* The protocol being used for the exchange.
|
|
3075
|
+
*
|
|
3076
|
+
* Will be %NULL if no protocol was specified when creating this object,
|
|
3077
|
+
* and either [method`SecretExchange`.begin] or [method`SecretExchange`.receive]
|
|
3078
|
+
* have not been called successfully.
|
|
3079
|
+
*/
|
|
3080
|
+
protocol?: string | null
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
interface SecretExchange {
|
|
3086
|
+
|
|
3087
|
+
// Own properties of Gcr-3.Gcr.SecretExchange
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* The protocol being used for the exchange.
|
|
3091
|
+
*
|
|
3092
|
+
* Will be %NULL if no protocol was specified when creating this object,
|
|
3093
|
+
* and either [method`SecretExchange`.begin] or [method`SecretExchange`.receive]
|
|
3094
|
+
* have not been called successfully.
|
|
3095
|
+
*/
|
|
3096
|
+
readonly protocol: string | null
|
|
3097
|
+
|
|
3098
|
+
// Owm methods of Gcr-3.Gcr.SecretExchange
|
|
3099
|
+
|
|
3100
|
+
/**
|
|
3101
|
+
* Begin the secret exchange. The resulting string should be sent to the other
|
|
3102
|
+
* side of the exchange. The other side should use [method`SecretExchange`.receive]
|
|
3103
|
+
* to process the string.
|
|
3104
|
+
* @returns A newly allocated string to be sent to the other side of the secret exchange
|
|
3105
|
+
*/
|
|
3106
|
+
begin(): string | null
|
|
3107
|
+
/**
|
|
3108
|
+
* Will return %NULL if no protocol was specified, and either
|
|
3109
|
+
* [method`SecretExchange`.begin] or [method`SecretExchange`.receive] have not
|
|
3110
|
+
* been called successfully.
|
|
3111
|
+
* @returns the protocol or %NULL
|
|
3112
|
+
*/
|
|
3113
|
+
get_protocol(): string | null
|
|
3114
|
+
/**
|
|
3115
|
+
* Returns the last secret received. If no secret has yet been received this
|
|
3116
|
+
* will return %NULL. The string is owned by the #GcrSecretExchange object
|
|
3117
|
+
* and will be valid until the next time that gcr_secret_exchange_receive()
|
|
3118
|
+
* is called on this object, or the object is destroyed.
|
|
3119
|
+
*
|
|
3120
|
+
* Depending on the secret passed into the other side of the secret exchange,
|
|
3121
|
+
* the result may be a binary string. It does however have a null terminator,
|
|
3122
|
+
* so if you're certain that it is does not contain arbitrary binary data,
|
|
3123
|
+
* it can be used as a string.
|
|
3124
|
+
* @returns the last secret received
|
|
3125
|
+
*/
|
|
3126
|
+
get_secret(): string[]
|
|
3127
|
+
/**
|
|
3128
|
+
* Receive a string from the other side of secret exchange. This string will
|
|
3129
|
+
* have been created by [method`SecretExchange`.begin] or
|
|
3130
|
+
* [method`SecretExchange`.send].
|
|
3131
|
+
*
|
|
3132
|
+
* After this call completes successfully the value returned from
|
|
3133
|
+
* gcr_secret_exchange_get_secret() will have changed.
|
|
3134
|
+
* @param exchange the string received
|
|
3135
|
+
* @returns whether the string was successfully parsed and received
|
|
3136
|
+
*/
|
|
3137
|
+
receive(exchange: string | null): boolean
|
|
3138
|
+
/**
|
|
3139
|
+
* Send a reply to the other side of the secret exchange, optionally sending a
|
|
3140
|
+
* secret.
|
|
3141
|
+
*
|
|
3142
|
+
* [method`SecretExchange`.receive] must have been successfully called at least
|
|
3143
|
+
* once on this object. In other words this object must have received data
|
|
3144
|
+
* from the other side of the secret exchange, before we can send a secret.
|
|
3145
|
+
* @param secret optionally, a secret to send to the other side
|
|
3146
|
+
* @param secret_len length of `secret,` or -1 if null terminated
|
|
3147
|
+
* @returns a newly allocated string to be sent to the other side of the secret exchange
|
|
3148
|
+
*/
|
|
3149
|
+
send(secret: string | null, secret_len: number): string | null
|
|
3150
|
+
|
|
3151
|
+
// Own virtual methods of Gcr-3.Gcr.SecretExchange
|
|
3152
|
+
|
|
3153
|
+
vfunc_derive_transport_key(peer: number, n_peer: number): boolean
|
|
3154
|
+
vfunc_generate_exchange_key(scheme: string | null, public_key: number, n_public_key: number): boolean
|
|
3155
|
+
|
|
3156
|
+
// Class property signals of Gcr-3.Gcr.SecretExchange
|
|
3157
|
+
|
|
3158
|
+
connect(sigName: "notify::protocol", callback: (($obj: SecretExchange, pspec: GObject.ParamSpec) => void)): number
|
|
3159
|
+
connect_after(sigName: "notify::protocol", callback: (($obj: SecretExchange, pspec: GObject.ParamSpec) => void)): number
|
|
3160
|
+
emit(sigName: "notify::protocol", ...args: any[]): void
|
|
3161
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3162
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3163
|
+
emit(sigName: string, ...args: any[]): void
|
|
3164
|
+
disconnect(id: number): void
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* Allows exchange of secrets between two processes on the same system without
|
|
3169
|
+
* exposing those secrets to things like loggers, non-pageable memory etc.
|
|
3170
|
+
*
|
|
3171
|
+
* This does not protect against active attacks like MITM attacks.
|
|
3172
|
+
*
|
|
3173
|
+
* Each side creates a secret exchange object, and one of the sides calls
|
|
3174
|
+
* [method`SecretExchange`.begin]. This creates a string, which should be passed
|
|
3175
|
+
* to the other side. Each side passes the strings it receives into
|
|
3176
|
+
* [method`SecretExchange`.receive].
|
|
3177
|
+
*
|
|
3178
|
+
* In order to send a reply (either with or without a secret) use
|
|
3179
|
+
* [method`SecretExchange`.send]. A side must have successfully called
|
|
3180
|
+
* [method`SecretExchange`.receive] before it can use
|
|
3181
|
+
* [method`SecretExchange`.send].
|
|
3182
|
+
*
|
|
3183
|
+
* The secret exchange objects can be used for multiple iterations of the
|
|
3184
|
+
* conversation, or for just one request/reply. The only limitation being that
|
|
3185
|
+
* the initial request cannot contain a secret.
|
|
3186
|
+
*
|
|
3187
|
+
* Caveat: Information about the approximate length (rounded up to the nearest
|
|
3188
|
+
* 16 bytes) may be leaked. If this is considered inacceptable, do not use
|
|
3189
|
+
* [class`SecretExchange]`.
|
|
3190
|
+
* @class
|
|
3191
|
+
*/
|
|
3192
|
+
class SecretExchange extends GObject.Object {
|
|
3193
|
+
|
|
3194
|
+
// Own properties of Gcr-3.Gcr.SecretExchange
|
|
3195
|
+
|
|
3196
|
+
static name: string
|
|
3197
|
+
static $gtype: GObject.GType<SecretExchange>
|
|
3198
|
+
|
|
3199
|
+
// Constructors of Gcr-3.Gcr.SecretExchange
|
|
3200
|
+
|
|
3201
|
+
constructor(config?: SecretExchange.ConstructorProperties)
|
|
3202
|
+
/**
|
|
3203
|
+
* Create a new secret exchange object.
|
|
3204
|
+
*
|
|
3205
|
+
* Specify a protocol of %NULL to allow any protocol. This is especially
|
|
3206
|
+
* relevant on the side of the exchange that does not call
|
|
3207
|
+
* [method`SecretExchange`.begin], that is the originator. Currently the only
|
|
3208
|
+
* protocol supported is %GCR_SECRET_EXCHANGE_PROTOCOL_1.
|
|
3209
|
+
* @constructor
|
|
3210
|
+
* @param protocol the exchange protocol to use
|
|
3211
|
+
* @returns A new #GcrSecretExchange object
|
|
3212
|
+
*/
|
|
3213
|
+
constructor(protocol: string | null)
|
|
3214
|
+
/**
|
|
3215
|
+
* Create a new secret exchange object.
|
|
3216
|
+
*
|
|
3217
|
+
* Specify a protocol of %NULL to allow any protocol. This is especially
|
|
3218
|
+
* relevant on the side of the exchange that does not call
|
|
3219
|
+
* [method`SecretExchange`.begin], that is the originator. Currently the only
|
|
3220
|
+
* protocol supported is %GCR_SECRET_EXCHANGE_PROTOCOL_1.
|
|
3221
|
+
* @constructor
|
|
3222
|
+
* @param protocol the exchange protocol to use
|
|
3223
|
+
* @returns A new #GcrSecretExchange object
|
|
3224
|
+
*/
|
|
3225
|
+
static new(protocol: string | null): SecretExchange
|
|
3226
|
+
_init(config?: SecretExchange.ConstructorProperties): void
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
module SimpleCertificate {
|
|
3230
|
+
|
|
3231
|
+
// Constructor properties interface
|
|
3232
|
+
|
|
3233
|
+
interface ConstructorProperties extends Certificate.ConstructorProperties, Comparable.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
interface SimpleCertificate extends Certificate, Comparable {
|
|
3239
|
+
|
|
3240
|
+
// Own fields of Gcr-3.Gcr.SimpleCertificate
|
|
3241
|
+
|
|
3242
|
+
parent: GObject.Object
|
|
3243
|
+
|
|
3244
|
+
// Class property signals of Gcr-3.Gcr.SimpleCertificate
|
|
3245
|
+
|
|
3246
|
+
connect(sigName: "notify::description", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3247
|
+
connect_after(sigName: "notify::description", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3248
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
3249
|
+
connect(sigName: "notify::expiry", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3250
|
+
connect_after(sigName: "notify::expiry", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3251
|
+
emit(sigName: "notify::expiry", ...args: any[]): void
|
|
3252
|
+
connect(sigName: "notify::icon", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3253
|
+
connect_after(sigName: "notify::icon", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3254
|
+
emit(sigName: "notify::icon", ...args: any[]): void
|
|
3255
|
+
connect(sigName: "notify::issuer", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3256
|
+
connect_after(sigName: "notify::issuer", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3257
|
+
emit(sigName: "notify::issuer", ...args: any[]): void
|
|
3258
|
+
connect(sigName: "notify::label", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3259
|
+
connect_after(sigName: "notify::label", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3260
|
+
emit(sigName: "notify::label", ...args: any[]): void
|
|
3261
|
+
connect(sigName: "notify::markup", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3262
|
+
connect_after(sigName: "notify::markup", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3263
|
+
emit(sigName: "notify::markup", ...args: any[]): void
|
|
3264
|
+
connect(sigName: "notify::subject", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3265
|
+
connect_after(sigName: "notify::subject", callback: (($obj: SimpleCertificate, pspec: GObject.ParamSpec) => void)): number
|
|
3266
|
+
emit(sigName: "notify::subject", ...args: any[]): void
|
|
3267
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3268
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3269
|
+
emit(sigName: string, ...args: any[]): void
|
|
3270
|
+
disconnect(id: number): void
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
/**
|
|
3274
|
+
* An implementation of [iface`Certificate]` which loads a certificate from DER
|
|
3275
|
+
* data already located in memory.
|
|
3276
|
+
*
|
|
3277
|
+
* To create an object, use the [ctor`SimpleCertificate`.new] or
|
|
3278
|
+
* [ctor`SimpleCertificate`.new_static] functions.
|
|
3279
|
+
* @class
|
|
3280
|
+
*/
|
|
3281
|
+
class SimpleCertificate extends GObject.Object {
|
|
3282
|
+
|
|
3283
|
+
// Own properties of Gcr-3.Gcr.SimpleCertificate
|
|
3284
|
+
|
|
3285
|
+
static name: string
|
|
3286
|
+
static $gtype: GObject.GType<SimpleCertificate>
|
|
3287
|
+
|
|
3288
|
+
// Constructors of Gcr-3.Gcr.SimpleCertificate
|
|
3289
|
+
|
|
3290
|
+
constructor(config?: SimpleCertificate.ConstructorProperties)
|
|
3291
|
+
/**
|
|
3292
|
+
* Create a new #GcrSimpleCertificate for the raw DER data. The `data` memory is
|
|
3293
|
+
* copied so you can dispose of it after this function returns.
|
|
3294
|
+
* @constructor
|
|
3295
|
+
* @param data the raw DER certificate data
|
|
3296
|
+
* @returns a new #GcrSimpleCertificate
|
|
3297
|
+
*/
|
|
3298
|
+
constructor(data: Uint8Array)
|
|
3299
|
+
/**
|
|
3300
|
+
* Create a new #GcrSimpleCertificate for the raw DER data. The `data` memory is
|
|
3301
|
+
* copied so you can dispose of it after this function returns.
|
|
3302
|
+
* @constructor
|
|
3303
|
+
* @param data the raw DER certificate data
|
|
3304
|
+
* @returns a new #GcrSimpleCertificate
|
|
3305
|
+
*/
|
|
3306
|
+
static new(data: Uint8Array): SimpleCertificate
|
|
3307
|
+
_init(config?: SimpleCertificate.ConstructorProperties): void
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
module SimpleCollection {
|
|
3311
|
+
|
|
3312
|
+
// Constructor properties interface
|
|
3313
|
+
|
|
3314
|
+
interface ConstructorProperties extends Collection.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
interface SimpleCollection extends Collection {
|
|
3320
|
+
|
|
3321
|
+
// Own fields of Gcr-3.Gcr.SimpleCollection
|
|
3322
|
+
|
|
3323
|
+
parent: GObject.Object
|
|
3324
|
+
|
|
3325
|
+
// Owm methods of Gcr-3.Gcr.SimpleCollection
|
|
3326
|
+
|
|
3327
|
+
/**
|
|
3328
|
+
* Add an object to this collection
|
|
3329
|
+
* @param object The object to add
|
|
3330
|
+
*/
|
|
3331
|
+
add(object: GObject.Object): void
|
|
3332
|
+
/**
|
|
3333
|
+
* Remove an object from the collection.
|
|
3334
|
+
* @param object The object to remove from the collection
|
|
3335
|
+
*/
|
|
3336
|
+
remove(object: GObject.Object): void
|
|
3337
|
+
|
|
3338
|
+
// Class property signals of Gcr-3.Gcr.SimpleCollection
|
|
3339
|
+
|
|
3340
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3341
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3342
|
+
emit(sigName: string, ...args: any[]): void
|
|
3343
|
+
disconnect(id: number): void
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
/**
|
|
3347
|
+
* A simple implementation of [iface`Collection]`, which you can add and remove
|
|
3348
|
+
* objects from.
|
|
3349
|
+
*
|
|
3350
|
+
* You can use [method`SimpleCollection`.add] to add objects, and
|
|
3351
|
+
* [method`SimpleCollection`.remove] to remove them again.
|
|
3352
|
+
* @class
|
|
3353
|
+
*/
|
|
3354
|
+
class SimpleCollection extends GObject.Object {
|
|
3355
|
+
|
|
3356
|
+
// Own properties of Gcr-3.Gcr.SimpleCollection
|
|
3357
|
+
|
|
3358
|
+
static name: string
|
|
3359
|
+
static $gtype: GObject.GType<SimpleCollection>
|
|
3360
|
+
|
|
3361
|
+
// Constructors of Gcr-3.Gcr.SimpleCollection
|
|
3362
|
+
|
|
3363
|
+
constructor(config?: SimpleCollection.ConstructorProperties)
|
|
3364
|
+
/**
|
|
3365
|
+
* Create a new #GcrSimpleCollection.
|
|
3366
|
+
* @constructor
|
|
3367
|
+
* @returns a newly allocated collection, which should be freed with g_object_unref()
|
|
3368
|
+
*/
|
|
3369
|
+
constructor()
|
|
3370
|
+
/**
|
|
3371
|
+
* Create a new #GcrSimpleCollection.
|
|
3372
|
+
* @constructor
|
|
3373
|
+
* @returns a newly allocated collection, which should be freed with g_object_unref()
|
|
3374
|
+
*/
|
|
3375
|
+
static new(): SimpleCollection
|
|
3376
|
+
_init(config?: SimpleCollection.ConstructorProperties): void
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
module SshAskpass {
|
|
3380
|
+
|
|
3381
|
+
// Constructor properties interface
|
|
3382
|
+
|
|
3383
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
3384
|
+
|
|
3385
|
+
// Own constructor properties of Gcr-3.Gcr.SshAskpass
|
|
3386
|
+
|
|
3387
|
+
/**
|
|
3388
|
+
* The interaction used to prompt for passwords.
|
|
3389
|
+
*/
|
|
3390
|
+
interaction?: Gio.TlsInteraction | null
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
interface SshAskpass {
|
|
3396
|
+
|
|
3397
|
+
// Own properties of Gcr-3.Gcr.SshAskpass
|
|
3398
|
+
|
|
3399
|
+
/**
|
|
3400
|
+
* The interaction used to prompt for passwords.
|
|
3401
|
+
*/
|
|
3402
|
+
readonly interaction: Gio.TlsInteraction
|
|
3403
|
+
|
|
3404
|
+
// Owm methods of Gcr-3.Gcr.SshAskpass
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* Get the interaction associated with this object.
|
|
3408
|
+
* @returns the interaction
|
|
3409
|
+
*/
|
|
3410
|
+
get_interaction(): Gio.TlsInteraction
|
|
3411
|
+
|
|
3412
|
+
// Class property signals of Gcr-3.Gcr.SshAskpass
|
|
3413
|
+
|
|
3414
|
+
connect(sigName: "notify::interaction", callback: (($obj: SshAskpass, pspec: GObject.ParamSpec) => void)): number
|
|
3415
|
+
connect_after(sigName: "notify::interaction", callback: (($obj: SshAskpass, pspec: GObject.ParamSpec) => void)): number
|
|
3416
|
+
emit(sigName: "notify::interaction", ...args: any[]): void
|
|
3417
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3418
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3419
|
+
emit(sigName: string, ...args: any[]): void
|
|
3420
|
+
disconnect(id: number): void
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* When used as the setup function while spawning an ssh command like ssh-add
|
|
3425
|
+
* or ssh, this allows callbacks for passwords on the provided interaction.
|
|
3426
|
+
* @class
|
|
3427
|
+
*/
|
|
3428
|
+
class SshAskpass extends GObject.Object {
|
|
3429
|
+
|
|
3430
|
+
// Own properties of Gcr-3.Gcr.SshAskpass
|
|
3431
|
+
|
|
3432
|
+
static name: string
|
|
3433
|
+
static $gtype: GObject.GType<SshAskpass>
|
|
3434
|
+
|
|
3435
|
+
// Constructors of Gcr-3.Gcr.SshAskpass
|
|
3436
|
+
|
|
3437
|
+
constructor(config?: SshAskpass.ConstructorProperties)
|
|
3438
|
+
/**
|
|
3439
|
+
* Create a new GcrSshAskpass object which can be used to spawn an
|
|
3440
|
+
* ssh command and prompt for any necessary passwords.
|
|
3441
|
+
*
|
|
3442
|
+
* Use the gcr_ssh_askpass_child_setup() function as a callback with
|
|
3443
|
+
* g_spawn_sync(), g_spawn_async() or g_spawn_async_with_pipes().
|
|
3444
|
+
* @constructor
|
|
3445
|
+
* @param interaction the interaction to use for prompting paswords
|
|
3446
|
+
* @returns A new #GcrSshAskpass object
|
|
3447
|
+
*/
|
|
3448
|
+
constructor(interaction: Gio.TlsInteraction)
|
|
3449
|
+
/**
|
|
3450
|
+
* Create a new GcrSshAskpass object which can be used to spawn an
|
|
3451
|
+
* ssh command and prompt for any necessary passwords.
|
|
3452
|
+
*
|
|
3453
|
+
* Use the gcr_ssh_askpass_child_setup() function as a callback with
|
|
3454
|
+
* g_spawn_sync(), g_spawn_async() or g_spawn_async_with_pipes().
|
|
3455
|
+
* @constructor
|
|
3456
|
+
* @param interaction the interaction to use for prompting paswords
|
|
3457
|
+
* @returns A new #GcrSshAskpass object
|
|
3458
|
+
*/
|
|
3459
|
+
static new(interaction: Gio.TlsInteraction): SshAskpass
|
|
3460
|
+
_init(config?: SshAskpass.ConstructorProperties): void
|
|
3461
|
+
/**
|
|
3462
|
+
* Use this function as a callback setup function passed to g_spawn_sync(),
|
|
3463
|
+
* g_spawn_async(), g_spawn_async_with_pipes().
|
|
3464
|
+
* @param askpass a #GcrSshAskpass object
|
|
3465
|
+
*/
|
|
3466
|
+
static child_setup(askpass: any | null): void
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
module SystemPrompt {
|
|
3470
|
+
|
|
3471
|
+
// Constructor properties interface
|
|
3472
|
+
|
|
3473
|
+
interface ConstructorProperties extends Prompt.ConstructorProperties, Gio.AsyncInitable.ConstructorProperties, Gio.Initable.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
3474
|
+
|
|
3475
|
+
// Own constructor properties of Gcr-3.Gcr.SystemPrompt
|
|
3476
|
+
|
|
3477
|
+
/**
|
|
3478
|
+
* The DBus bus name of the prompter to use for prompting, or %NULL
|
|
3479
|
+
* for the default prompter.
|
|
3480
|
+
*/
|
|
3481
|
+
bus_name?: string | null
|
|
3482
|
+
/**
|
|
3483
|
+
* The #GcrSecretExchange to use when transferring passwords. A default
|
|
3484
|
+
* secret exchange will be used if this is not set.
|
|
3485
|
+
*/
|
|
3486
|
+
secret_exchange?: SecretExchange | null
|
|
3487
|
+
/**
|
|
3488
|
+
* The timeout in seconds to wait when opening the prompt.
|
|
3489
|
+
*/
|
|
3490
|
+
timeout_seconds?: number | null
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
interface SystemPrompt extends Prompt, Gio.AsyncInitable, Gio.Initable {
|
|
3496
|
+
|
|
3497
|
+
// Own properties of Gcr-3.Gcr.SystemPrompt
|
|
3498
|
+
|
|
3499
|
+
/**
|
|
3500
|
+
* The DBus bus name of the prompter to use for prompting, or %NULL
|
|
3501
|
+
* for the default prompter.
|
|
3502
|
+
*/
|
|
3503
|
+
readonly bus_name: string | null
|
|
3504
|
+
/**
|
|
3505
|
+
* The #GcrSecretExchange to use when transferring passwords. A default
|
|
3506
|
+
* secret exchange will be used if this is not set.
|
|
3507
|
+
*/
|
|
3508
|
+
secret_exchange: SecretExchange
|
|
3509
|
+
/**
|
|
3510
|
+
* The timeout in seconds to wait when opening the prompt.
|
|
3511
|
+
*/
|
|
3512
|
+
readonly timeout_seconds: number
|
|
3513
|
+
|
|
3514
|
+
// Own fields of Gcr-3.Gcr.SystemPrompt
|
|
3515
|
+
|
|
3516
|
+
parent: GObject.Object
|
|
3517
|
+
|
|
3518
|
+
// Owm methods of Gcr-3.Gcr.SystemPrompt
|
|
3519
|
+
|
|
3520
|
+
/**
|
|
3521
|
+
* Close this prompt. After calling this function, no further prompts will
|
|
3522
|
+
* succeed on this object. The prompt object is not unreferenced by this
|
|
3523
|
+
* function, and you must unreference it once done.
|
|
3524
|
+
*
|
|
3525
|
+
* This call may block, use the gcr_system_prompt_close_async() to perform
|
|
3526
|
+
* this action indefinitely.
|
|
3527
|
+
*
|
|
3528
|
+
* Whether or not this function returns %TRUE, the system prompt object is
|
|
3529
|
+
* still closed and may not be further used.
|
|
3530
|
+
* @param cancellable an optional cancellation object
|
|
3531
|
+
* @returns whether close was cleanly completed
|
|
3532
|
+
*/
|
|
3533
|
+
close(cancellable: Gio.Cancellable | null): boolean
|
|
3534
|
+
|
|
3535
|
+
// Overloads of close
|
|
3536
|
+
|
|
3537
|
+
/**
|
|
3538
|
+
* Closes the prompt so that in can no longer be used to prompt. The various
|
|
3539
|
+
* prompt methods will return results as if the user dismissed the prompt.
|
|
3540
|
+
*
|
|
3541
|
+
* The prompt may also be closed by the implementor of the prompt object.
|
|
3542
|
+
*
|
|
3543
|
+
* This emits the [signal`Prompt:`:prompt-close] signal on the prompt object.
|
|
3544
|
+
*/
|
|
3545
|
+
close(): void
|
|
3546
|
+
/**
|
|
3547
|
+
* Close this prompt asynchronously. After calling this function, no further
|
|
3548
|
+
* methods may be called on this object. The prompt object is not unreferenced
|
|
3549
|
+
* by this function, and you must unreference it once done.
|
|
3550
|
+
*
|
|
3551
|
+
* This call returns immediately and completes asynchronously.
|
|
3552
|
+
* @param cancellable an optional cancellation object
|
|
3553
|
+
* @param callback called when the operation completes
|
|
3554
|
+
*/
|
|
3555
|
+
close_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
3556
|
+
/**
|
|
3557
|
+
* Complete operation to close this prompt.
|
|
3558
|
+
*
|
|
3559
|
+
* Whether or not this function returns %TRUE, the system prompt object is
|
|
3560
|
+
* still closed and may not be further used.
|
|
3561
|
+
* @param result asynchronous operation result
|
|
3562
|
+
* @returns whether close was cleanly completed
|
|
3563
|
+
*/
|
|
3564
|
+
close_finish(result: Gio.AsyncResult): boolean
|
|
3565
|
+
/**
|
|
3566
|
+
* Get the current [class`SecretExchange]` used to transfer secrets in this prompt.
|
|
3567
|
+
* @returns the secret exchange
|
|
3568
|
+
*/
|
|
3569
|
+
get_secret_exchange(): SecretExchange
|
|
3570
|
+
|
|
3571
|
+
// Class property signals of Gcr-3.Gcr.SystemPrompt
|
|
3572
|
+
|
|
3573
|
+
connect(sigName: "notify::bus-name", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3574
|
+
connect_after(sigName: "notify::bus-name", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3575
|
+
emit(sigName: "notify::bus-name", ...args: any[]): void
|
|
3576
|
+
connect(sigName: "notify::secret-exchange", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3577
|
+
connect_after(sigName: "notify::secret-exchange", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3578
|
+
emit(sigName: "notify::secret-exchange", ...args: any[]): void
|
|
3579
|
+
connect(sigName: "notify::timeout-seconds", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3580
|
+
connect_after(sigName: "notify::timeout-seconds", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3581
|
+
emit(sigName: "notify::timeout-seconds", ...args: any[]): void
|
|
3582
|
+
connect(sigName: "notify::caller-window", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3583
|
+
connect_after(sigName: "notify::caller-window", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3584
|
+
emit(sigName: "notify::caller-window", ...args: any[]): void
|
|
3585
|
+
connect(sigName: "notify::cancel-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3586
|
+
connect_after(sigName: "notify::cancel-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3587
|
+
emit(sigName: "notify::cancel-label", ...args: any[]): void
|
|
3588
|
+
connect(sigName: "notify::choice-chosen", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3589
|
+
connect_after(sigName: "notify::choice-chosen", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3590
|
+
emit(sigName: "notify::choice-chosen", ...args: any[]): void
|
|
3591
|
+
connect(sigName: "notify::choice-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3592
|
+
connect_after(sigName: "notify::choice-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3593
|
+
emit(sigName: "notify::choice-label", ...args: any[]): void
|
|
3594
|
+
connect(sigName: "notify::continue-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3595
|
+
connect_after(sigName: "notify::continue-label", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3596
|
+
emit(sigName: "notify::continue-label", ...args: any[]): void
|
|
3597
|
+
connect(sigName: "notify::description", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3598
|
+
connect_after(sigName: "notify::description", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3599
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
3600
|
+
connect(sigName: "notify::message", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3601
|
+
connect_after(sigName: "notify::message", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3602
|
+
emit(sigName: "notify::message", ...args: any[]): void
|
|
3603
|
+
connect(sigName: "notify::password-new", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3604
|
+
connect_after(sigName: "notify::password-new", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3605
|
+
emit(sigName: "notify::password-new", ...args: any[]): void
|
|
3606
|
+
connect(sigName: "notify::password-strength", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3607
|
+
connect_after(sigName: "notify::password-strength", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3608
|
+
emit(sigName: "notify::password-strength", ...args: any[]): void
|
|
3609
|
+
connect(sigName: "notify::title", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3610
|
+
connect_after(sigName: "notify::title", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3611
|
+
emit(sigName: "notify::title", ...args: any[]): void
|
|
3612
|
+
connect(sigName: "notify::warning", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3613
|
+
connect_after(sigName: "notify::warning", callback: (($obj: SystemPrompt, pspec: GObject.ParamSpec) => void)): number
|
|
3614
|
+
emit(sigName: "notify::warning", ...args: any[]): void
|
|
3615
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3616
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3617
|
+
emit(sigName: string, ...args: any[]): void
|
|
3618
|
+
disconnect(id: number): void
|
|
3619
|
+
}
|
|
3620
|
+
|
|
3621
|
+
/**
|
|
3622
|
+
* A [iface`Prompt]` implementation which calls to the system prompter to
|
|
3623
|
+
* display prompts in a system modal fashion.
|
|
3624
|
+
*
|
|
3625
|
+
* Since the system prompter usually only displays one prompt at a time, you
|
|
3626
|
+
* may have to wait for the prompt to be displayed. Use [func`SystemPrompt`.open]
|
|
3627
|
+
* or a related function to open a prompt. Since this can take a long time, you
|
|
3628
|
+
* should always check that the prompt is still needed after it is opened. A
|
|
3629
|
+
* previous prompt may have already provided the information needed and you
|
|
3630
|
+
* may no longer need to prompt.
|
|
3631
|
+
*
|
|
3632
|
+
* Use [method`SystemPrompt`.close] to close the prompt when you're done with it.
|
|
3633
|
+
* @class
|
|
3634
|
+
*/
|
|
3635
|
+
class SystemPrompt extends GObject.Object {
|
|
3636
|
+
|
|
3637
|
+
// Own properties of Gcr-3.Gcr.SystemPrompt
|
|
3638
|
+
|
|
3639
|
+
static name: string
|
|
3640
|
+
static $gtype: GObject.GType<SystemPrompt>
|
|
3641
|
+
|
|
3642
|
+
// Constructors of Gcr-3.Gcr.SystemPrompt
|
|
3643
|
+
|
|
3644
|
+
constructor(config?: SystemPrompt.ConstructorProperties)
|
|
3645
|
+
_init(config?: SystemPrompt.ConstructorProperties): void
|
|
3646
|
+
static error_get_domain(): GLib.Quark
|
|
3647
|
+
/**
|
|
3648
|
+
* Opens a system prompt with the default prompter.
|
|
3649
|
+
*
|
|
3650
|
+
* Most system prompters only allow showing one prompt at a time, and if
|
|
3651
|
+
* another prompt is shown then this method will block for up to
|
|
3652
|
+
* `timeout_seconds` seconds. If `timeout_seconds` is equal to -1, then this
|
|
3653
|
+
* will block indefinitely until the prompt can be opened. If `timeout_seconds`
|
|
3654
|
+
* expires, then this function will fail with a %GCR_SYSTEM_PROMPT_IN_PROGRESS
|
|
3655
|
+
* error.
|
|
3656
|
+
* @param timeout_seconds the number of seconds to wait to access the prompt, or -1
|
|
3657
|
+
* @param cancellable optional cancellation object
|
|
3658
|
+
* @returns the prompt, or %NULL if prompt could not be opened
|
|
3659
|
+
*/
|
|
3660
|
+
static open(timeout_seconds: number, cancellable: Gio.Cancellable | null): SystemPrompt
|
|
3661
|
+
/**
|
|
3662
|
+
* Asynchronously open a system prompt with the default system prompter.
|
|
3663
|
+
*
|
|
3664
|
+
* Most system prompters only allow showing one prompt at a time, and if
|
|
3665
|
+
* another prompt is shown then this method will block for up to
|
|
3666
|
+
* `timeout_seconds` seconds. If `timeout_seconds` is equal to -1, then this
|
|
3667
|
+
* will block indefinitely until the prompt can be opened. If `timeout_seconds`
|
|
3668
|
+
* expires, then this operation will fail with a %GCR_SYSTEM_PROMPT_IN_PROGRESS
|
|
3669
|
+
* error.
|
|
3670
|
+
* @param timeout_seconds the number of seconds to wait to access the prompt, or -1
|
|
3671
|
+
* @param cancellable optional cancellation object
|
|
3672
|
+
* @param callback called when the operation completes
|
|
3673
|
+
*/
|
|
3674
|
+
static open_async(timeout_seconds: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<SystemPrompt> | null): void
|
|
3675
|
+
/**
|
|
3676
|
+
* Complete an operation to asynchronously open a system prompt.
|
|
3677
|
+
* @param result the asynchronous result
|
|
3678
|
+
* @returns the prompt, or %NULL if prompt could not be opened
|
|
3679
|
+
*/
|
|
3680
|
+
static open_finish(result: Gio.AsyncResult): SystemPrompt
|
|
3681
|
+
/**
|
|
3682
|
+
* Opens a system prompt. If prompter_name is %NULL, then the default
|
|
3683
|
+
* system prompter is used.
|
|
3684
|
+
*
|
|
3685
|
+
* Most system prompters only allow showing one prompt at a time, and if
|
|
3686
|
+
* another prompt is shown then this method will block for up to
|
|
3687
|
+
* `timeout_seconds` seconds. If `timeout_seconds` is equal to -1, then this
|
|
3688
|
+
* will block indefinitely until the prompt can be opened. If `timeout_seconds`
|
|
3689
|
+
* expires, then this function will fail with a %GCR_SYSTEM_PROMPT_IN_PROGRESS
|
|
3690
|
+
* error.
|
|
3691
|
+
* @param prompter_name the prompter dbus name
|
|
3692
|
+
* @param timeout_seconds the number of seconds to wait to access the prompt, or -1
|
|
3693
|
+
* @param cancellable optional cancellation object
|
|
3694
|
+
* @returns the prompt, or %NULL if prompt could not be opened
|
|
3695
|
+
*/
|
|
3696
|
+
static open_for_prompter(prompter_name: string | null, timeout_seconds: number, cancellable: Gio.Cancellable | null): SystemPrompt
|
|
3697
|
+
/**
|
|
3698
|
+
* Opens a system prompt asynchronously. If prompter_name is %NULL, then the
|
|
3699
|
+
* default system prompter is used.
|
|
3700
|
+
*
|
|
3701
|
+
* Most system prompters only allow showing one prompt at a time, and if
|
|
3702
|
+
* another prompt is shown then this method will block for up to
|
|
3703
|
+
* `timeout_seconds` seconds. If `timeout_seconds` is equal to -1, then this
|
|
3704
|
+
* will block indefinitely until the prompt can be opened. If `timeout_seconds`
|
|
3705
|
+
* expires, then this operation will fail with a %GCR_SYSTEM_PROMPT_IN_PROGRESS
|
|
3706
|
+
* error.
|
|
3707
|
+
* @param prompter_name the prompter D-Bus name
|
|
3708
|
+
* @param timeout_seconds the number of seconds to wait to access the prompt, or -1
|
|
3709
|
+
* @param cancellable optional cancellation object
|
|
3710
|
+
* @param callback called when the operation completes
|
|
3711
|
+
*/
|
|
3712
|
+
static open_for_prompter_async(prompter_name: string | null, timeout_seconds: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<SystemPrompt> | null): void
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
module SystemPrompter {
|
|
3716
|
+
|
|
3717
|
+
// Signal callback interfaces
|
|
3718
|
+
|
|
3719
|
+
/**
|
|
3720
|
+
* Signal callback interface for `new-prompt`
|
|
3721
|
+
*/
|
|
3722
|
+
interface NewPromptSignalCallback {
|
|
3723
|
+
($obj: SystemPrompter): Prompt
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3726
|
+
|
|
3727
|
+
// Constructor properties interface
|
|
3728
|
+
|
|
3729
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
3730
|
+
|
|
3731
|
+
// Own constructor properties of Gcr-3.Gcr.SystemPrompter
|
|
3732
|
+
|
|
3733
|
+
/**
|
|
3734
|
+
* The #GType for prompts created by this prompter. This must be a
|
|
3735
|
+
* #GcrPrompt implementation.
|
|
3736
|
+
*/
|
|
3737
|
+
prompt_type?: GObject.GType | null
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
interface SystemPrompter {
|
|
3743
|
+
|
|
3744
|
+
// Own properties of Gcr-3.Gcr.SystemPrompter
|
|
3745
|
+
|
|
3746
|
+
/**
|
|
3747
|
+
* The #GType for prompts created by this prompter. This must be a
|
|
3748
|
+
* #GcrPrompt implementation.
|
|
3749
|
+
*/
|
|
3750
|
+
readonly prompt_type: GObject.GType
|
|
3751
|
+
/**
|
|
3752
|
+
* Whether the prompter is prompting or not.
|
|
3753
|
+
*/
|
|
3754
|
+
readonly prompting: boolean
|
|
3755
|
+
|
|
3756
|
+
// Own fields of Gcr-3.Gcr.SystemPrompter
|
|
3757
|
+
|
|
3758
|
+
parent: GObject.Object
|
|
3759
|
+
|
|
3760
|
+
// Owm methods of Gcr-3.Gcr.SystemPrompter
|
|
3761
|
+
|
|
3762
|
+
/**
|
|
3763
|
+
* Get the mode for this prompter.
|
|
3764
|
+
*
|
|
3765
|
+
* Most system prompters only display one prompt at a time and therefore
|
|
3766
|
+
* return %GCR_SYSTEM_PROMPTER_SINGLE.
|
|
3767
|
+
* @returns the prompter mode
|
|
3768
|
+
*/
|
|
3769
|
+
get_mode(): SystemPrompterMode
|
|
3770
|
+
/**
|
|
3771
|
+
* Get the #GType for prompts created by this prompter.
|
|
3772
|
+
*
|
|
3773
|
+
* The returned #GType will be a #GcrPrompt implementation.
|
|
3774
|
+
* @returns the prompt #GType
|
|
3775
|
+
*/
|
|
3776
|
+
get_prompt_type(): GObject.GType
|
|
3777
|
+
/**
|
|
3778
|
+
* Get whether prompting or not.
|
|
3779
|
+
* @returns whether prompting or not
|
|
3780
|
+
*/
|
|
3781
|
+
get_prompting(): boolean
|
|
3782
|
+
/**
|
|
3783
|
+
* Register this system prompter on the DBus `connection`.
|
|
3784
|
+
*
|
|
3785
|
+
* This makes the prompter available for clients to call. The prompter will
|
|
3786
|
+
* remain registered until gcr_system_prompter_unregister() is called, or the
|
|
3787
|
+
* prompter is unreferenced.
|
|
3788
|
+
* @param connection a DBus connection
|
|
3789
|
+
*/
|
|
3790
|
+
register(connection: Gio.DBusConnection): void
|
|
3791
|
+
/**
|
|
3792
|
+
* Unregister this system prompter on the DBus `connection`.
|
|
3793
|
+
*
|
|
3794
|
+
* The prompter must have previously been registered with gcr_system_prompter_register().
|
|
3795
|
+
*
|
|
3796
|
+
* If `wait` is set then this function will wait until all prompts have been closed
|
|
3797
|
+
* or cancelled. This is usually only used by tests.
|
|
3798
|
+
* @param wait whether to wait for closing prompts
|
|
3799
|
+
*/
|
|
3800
|
+
unregister(wait: boolean): void
|
|
3801
|
+
|
|
3802
|
+
// Own signals of Gcr-3.Gcr.SystemPrompter
|
|
3803
|
+
|
|
3804
|
+
connect(sigName: "new-prompt", callback: SystemPrompter.NewPromptSignalCallback): number
|
|
3805
|
+
connect_after(sigName: "new-prompt", callback: SystemPrompter.NewPromptSignalCallback): number
|
|
3806
|
+
emit(sigName: "new-prompt", ...args: any[]): void
|
|
3807
|
+
|
|
3808
|
+
// Class property signals of Gcr-3.Gcr.SystemPrompter
|
|
3809
|
+
|
|
3810
|
+
connect(sigName: "notify::prompt-type", callback: (($obj: SystemPrompter, pspec: GObject.ParamSpec) => void)): number
|
|
3811
|
+
connect_after(sigName: "notify::prompt-type", callback: (($obj: SystemPrompter, pspec: GObject.ParamSpec) => void)): number
|
|
3812
|
+
emit(sigName: "notify::prompt-type", ...args: any[]): void
|
|
3813
|
+
connect(sigName: "notify::prompting", callback: (($obj: SystemPrompter, pspec: GObject.ParamSpec) => void)): number
|
|
3814
|
+
connect_after(sigName: "notify::prompting", callback: (($obj: SystemPrompter, pspec: GObject.ParamSpec) => void)): number
|
|
3815
|
+
emit(sigName: "notify::prompting", ...args: any[]): void
|
|
3816
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3817
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3818
|
+
emit(sigName: string, ...args: any[]): void
|
|
3819
|
+
disconnect(id: number): void
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* A prompter used by implementations of system prompts.
|
|
3824
|
+
*
|
|
3825
|
+
* This is a D-Bus service which is rarely implemented. Use [class`SystemPrompt]`
|
|
3826
|
+
* to display system prompts.
|
|
3827
|
+
*
|
|
3828
|
+
* The system prompter service responds to D-Bus requests to create system
|
|
3829
|
+
* prompts and creates #GcrPrompt type objects to display those prompts.
|
|
3830
|
+
*
|
|
3831
|
+
* Pass the GType of the implementation of [iface`Prompt]` to
|
|
3832
|
+
* [ctor`SystemPrompter`.new].
|
|
3833
|
+
* @class
|
|
3834
|
+
*/
|
|
3835
|
+
class SystemPrompter extends GObject.Object {
|
|
3836
|
+
|
|
3837
|
+
// Own properties of Gcr-3.Gcr.SystemPrompter
|
|
3838
|
+
|
|
3839
|
+
static name: string
|
|
3840
|
+
static $gtype: GObject.GType<SystemPrompter>
|
|
3841
|
+
|
|
3842
|
+
// Constructors of Gcr-3.Gcr.SystemPrompter
|
|
3843
|
+
|
|
3844
|
+
constructor(config?: SystemPrompter.ConstructorProperties)
|
|
3845
|
+
/**
|
|
3846
|
+
* Create a new system prompter service. This prompter won't do anything unless
|
|
3847
|
+
* you connect to its signals and show appropriate prompts.
|
|
3848
|
+
*
|
|
3849
|
+
* If `prompt_type` is zero, then the new-prompt signal must be handled and
|
|
3850
|
+
* return a valid prompt object implementing the #GcrPrompt interface.
|
|
3851
|
+
*
|
|
3852
|
+
* If `prompt_type` is non-zero then the #GType must implement the #GcrPrompt
|
|
3853
|
+
* interface.
|
|
3854
|
+
* @constructor
|
|
3855
|
+
* @param mode the mode for the prompt
|
|
3856
|
+
* @param prompt_type the gobject type for prompts created by this prompter
|
|
3857
|
+
* @returns a new prompter service
|
|
3858
|
+
*/
|
|
3859
|
+
constructor(mode: SystemPrompterMode, prompt_type: GObject.GType)
|
|
3860
|
+
/**
|
|
3861
|
+
* Create a new system prompter service. This prompter won't do anything unless
|
|
3862
|
+
* you connect to its signals and show appropriate prompts.
|
|
3863
|
+
*
|
|
3864
|
+
* If `prompt_type` is zero, then the new-prompt signal must be handled and
|
|
3865
|
+
* return a valid prompt object implementing the #GcrPrompt interface.
|
|
3866
|
+
*
|
|
3867
|
+
* If `prompt_type` is non-zero then the #GType must implement the #GcrPrompt
|
|
3868
|
+
* interface.
|
|
3869
|
+
* @constructor
|
|
3870
|
+
* @param mode the mode for the prompt
|
|
3871
|
+
* @param prompt_type the gobject type for prompts created by this prompter
|
|
3872
|
+
* @returns a new prompter service
|
|
3873
|
+
*/
|
|
3874
|
+
static new(mode: SystemPrompterMode, prompt_type: GObject.GType): SystemPrompter
|
|
3875
|
+
_init(config?: SystemPrompter.ConstructorProperties): void
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
module UnionCollection {
|
|
3879
|
+
|
|
3880
|
+
// Constructor properties interface
|
|
3881
|
+
|
|
3882
|
+
interface ConstructorProperties extends Collection.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
}
|
|
3886
|
+
|
|
3887
|
+
interface UnionCollection extends Collection {
|
|
3888
|
+
|
|
3889
|
+
// Own fields of Gcr-3.Gcr.UnionCollection
|
|
3890
|
+
|
|
3891
|
+
parent: GObject.Object
|
|
3892
|
+
|
|
3893
|
+
// Owm methods of Gcr-3.Gcr.UnionCollection
|
|
3894
|
+
|
|
3895
|
+
/**
|
|
3896
|
+
* Add objects from this collection to the union
|
|
3897
|
+
* @param collection The collection whose objects to add
|
|
3898
|
+
*/
|
|
3899
|
+
add(collection: Collection): void
|
|
3900
|
+
/**
|
|
3901
|
+
* Get the collections that have been added to this union.
|
|
3902
|
+
* @returns collections added to the union
|
|
3903
|
+
*/
|
|
3904
|
+
elements(): Collection[]
|
|
3905
|
+
/**
|
|
3906
|
+
* Check whether the collection is present in the union.
|
|
3907
|
+
* @param collection the collection to check
|
|
3908
|
+
* @returns whether present or not
|
|
3909
|
+
*/
|
|
3910
|
+
have(collection: Collection): boolean
|
|
3911
|
+
/**
|
|
3912
|
+
* Remove an object from the collection.
|
|
3913
|
+
* @param collection The collection whose objects to remove
|
|
3914
|
+
*/
|
|
3915
|
+
remove(collection: Collection): void
|
|
3916
|
+
/**
|
|
3917
|
+
* Return the number of collections in this union. This does not reflect
|
|
3918
|
+
* the number of objects in the combined collection.
|
|
3919
|
+
* @returns number of collections inlcuded
|
|
3920
|
+
*/
|
|
3921
|
+
size(): number
|
|
3922
|
+
/**
|
|
3923
|
+
* Add objects from this collection to the union. Do not add an additional
|
|
3924
|
+
* reference to the collection.
|
|
3925
|
+
* @param collection The collection whose objects to add
|
|
3926
|
+
*/
|
|
3927
|
+
take(collection: Collection): void
|
|
3928
|
+
|
|
3929
|
+
// Class property signals of Gcr-3.Gcr.UnionCollection
|
|
3930
|
+
|
|
3931
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
3932
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
3933
|
+
emit(sigName: string, ...args: any[]): void
|
|
3934
|
+
disconnect(id: number): void
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
/**
|
|
3938
|
+
* An implementation of #GcrCollection, which combines the objects in
|
|
3939
|
+
* other [iface`Collection]`s. Use [method`UnionCollection`.add] to add and
|
|
3940
|
+
* [method`UnionCollection`.remove] to remove them.
|
|
3941
|
+
* @class
|
|
3942
|
+
*/
|
|
3943
|
+
class UnionCollection extends GObject.Object {
|
|
3944
|
+
|
|
3945
|
+
// Own properties of Gcr-3.Gcr.UnionCollection
|
|
3946
|
+
|
|
3947
|
+
static name: string
|
|
3948
|
+
static $gtype: GObject.GType<UnionCollection>
|
|
3949
|
+
|
|
3950
|
+
// Constructors of Gcr-3.Gcr.UnionCollection
|
|
3951
|
+
|
|
3952
|
+
constructor(config?: UnionCollection.ConstructorProperties)
|
|
3953
|
+
/**
|
|
3954
|
+
* Create a new #GcrUnionCollection.
|
|
3955
|
+
* @constructor
|
|
3956
|
+
* @returns a newly allocated collection, which should be freed with g_object_unref()
|
|
3957
|
+
*/
|
|
3958
|
+
constructor()
|
|
3959
|
+
/**
|
|
3960
|
+
* Create a new #GcrUnionCollection.
|
|
3961
|
+
* @constructor
|
|
3962
|
+
* @returns a newly allocated collection, which should be freed with g_object_unref()
|
|
3963
|
+
*/
|
|
3964
|
+
static new(): UnionCollection
|
|
3965
|
+
_init(config?: UnionCollection.ConstructorProperties): void
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3968
|
+
interface CertificateChainClass {
|
|
3969
|
+
|
|
3970
|
+
// Own fields of Gcr-3.Gcr.CertificateChainClass
|
|
3971
|
+
|
|
3972
|
+
/**
|
|
3973
|
+
* The parent class
|
|
3974
|
+
* @field
|
|
3975
|
+
*/
|
|
3976
|
+
parent_class: GObject.ObjectClass
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
/**
|
|
3980
|
+
* The class for #GcrCertificateChain.
|
|
3981
|
+
* @record
|
|
3982
|
+
*/
|
|
3983
|
+
abstract class CertificateChainClass {
|
|
3984
|
+
|
|
3985
|
+
// Own properties of Gcr-3.Gcr.CertificateChainClass
|
|
3986
|
+
|
|
3987
|
+
static name: string
|
|
3988
|
+
}
|
|
3989
|
+
|
|
3990
|
+
interface CertificateChainPrivate {
|
|
3991
|
+
}
|
|
3992
|
+
|
|
3993
|
+
class CertificateChainPrivate {
|
|
3994
|
+
|
|
3995
|
+
// Own properties of Gcr-3.Gcr.CertificateChainPrivate
|
|
3996
|
+
|
|
3997
|
+
static name: string
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
interface CertificateIface {
|
|
4001
|
+
|
|
4002
|
+
// Own fields of Gcr-3.Gcr.CertificateIface
|
|
4003
|
+
|
|
4004
|
+
/**
|
|
4005
|
+
* the parent interface type
|
|
4006
|
+
* @field
|
|
4007
|
+
*/
|
|
4008
|
+
parent: GObject.TypeInterface
|
|
4009
|
+
get_der_data: (self: Certificate) => Uint8Array
|
|
4010
|
+
}
|
|
4011
|
+
|
|
4012
|
+
/**
|
|
4013
|
+
* The interface that implementors of #GcrCertificate must implement.
|
|
4014
|
+
* @record
|
|
4015
|
+
*/
|
|
4016
|
+
abstract class CertificateIface {
|
|
4017
|
+
|
|
4018
|
+
// Own properties of Gcr-3.Gcr.CertificateIface
|
|
4019
|
+
|
|
4020
|
+
static name: string
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
interface CertificateRequestClass {
|
|
4024
|
+
|
|
4025
|
+
// Own fields of Gcr-3.Gcr.CertificateRequestClass
|
|
4026
|
+
|
|
4027
|
+
parent_class: GObject.ObjectClass
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
abstract class CertificateRequestClass {
|
|
4031
|
+
|
|
4032
|
+
// Own properties of Gcr-3.Gcr.CertificateRequestClass
|
|
4033
|
+
|
|
4034
|
+
static name: string
|
|
4035
|
+
}
|
|
4036
|
+
|
|
4037
|
+
interface CollectionIface {
|
|
4038
|
+
|
|
4039
|
+
// Own fields of Gcr-3.Gcr.CollectionIface
|
|
4040
|
+
|
|
4041
|
+
parent: GObject.TypeInterface
|
|
4042
|
+
added: (self: Collection, object: GObject.Object) => void
|
|
4043
|
+
removed: (self: Collection, object: GObject.Object) => void
|
|
4044
|
+
get_length: (self: Collection) => number
|
|
4045
|
+
get_objects: (self: Collection) => GObject.Object[]
|
|
4046
|
+
contains: (self: Collection, object: GObject.Object) => boolean
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
abstract class CollectionIface {
|
|
4050
|
+
|
|
4051
|
+
// Own properties of Gcr-3.Gcr.CollectionIface
|
|
4052
|
+
|
|
4053
|
+
static name: string
|
|
4054
|
+
}
|
|
4055
|
+
|
|
4056
|
+
interface Column {
|
|
4057
|
+
|
|
4058
|
+
// Own fields of Gcr-3.Gcr.Column
|
|
4059
|
+
|
|
4060
|
+
property_name: string | null
|
|
4061
|
+
property_type: GObject.GType
|
|
4062
|
+
column_type: GObject.GType
|
|
4063
|
+
label: string | null
|
|
4064
|
+
flags: ColumnFlags
|
|
4065
|
+
transformer: GObject.ValueTransform
|
|
4066
|
+
user_data: any
|
|
4067
|
+
}
|
|
4068
|
+
|
|
4069
|
+
class Column {
|
|
4070
|
+
|
|
4071
|
+
// Own properties of Gcr-3.Gcr.Column
|
|
4072
|
+
|
|
4073
|
+
static name: string
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
interface ComparableIface {
|
|
4077
|
+
|
|
4078
|
+
// Own fields of Gcr-3.Gcr.ComparableIface
|
|
4079
|
+
|
|
4080
|
+
/**
|
|
4081
|
+
* type interface
|
|
4082
|
+
* @field
|
|
4083
|
+
*/
|
|
4084
|
+
parent: GObject.TypeInterface
|
|
4085
|
+
compare: (self: Comparable, other: Comparable | null) => number
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
/**
|
|
4089
|
+
* The interface to implement for [iface`Comparable]`
|
|
4090
|
+
* @record
|
|
4091
|
+
*/
|
|
4092
|
+
abstract class ComparableIface {
|
|
4093
|
+
|
|
4094
|
+
// Own properties of Gcr-3.Gcr.ComparableIface
|
|
4095
|
+
|
|
4096
|
+
static name: string
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
interface FilterCollectionClass {
|
|
4100
|
+
|
|
4101
|
+
// Own fields of Gcr-3.Gcr.FilterCollectionClass
|
|
4102
|
+
|
|
4103
|
+
/**
|
|
4104
|
+
* the parent class
|
|
4105
|
+
* @field
|
|
4106
|
+
*/
|
|
4107
|
+
parent_class: GObject.ObjectClass
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
/**
|
|
4111
|
+
* The class struct for [class`FilterCollection]`.
|
|
4112
|
+
* @record
|
|
4113
|
+
*/
|
|
4114
|
+
abstract class FilterCollectionClass {
|
|
4115
|
+
|
|
4116
|
+
// Own properties of Gcr-3.Gcr.FilterCollectionClass
|
|
4117
|
+
|
|
4118
|
+
static name: string
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
interface FilterCollectionPrivate {
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4124
|
+
class FilterCollectionPrivate {
|
|
4125
|
+
|
|
4126
|
+
// Own properties of Gcr-3.Gcr.FilterCollectionPrivate
|
|
4127
|
+
|
|
4128
|
+
static name: string
|
|
4129
|
+
}
|
|
4130
|
+
|
|
4131
|
+
interface ImportInteractionIface {
|
|
4132
|
+
|
|
4133
|
+
// Own fields of Gcr-3.Gcr.ImportInteractionIface
|
|
4134
|
+
|
|
4135
|
+
/**
|
|
4136
|
+
* parent interface
|
|
4137
|
+
* @field
|
|
4138
|
+
*/
|
|
4139
|
+
parent: GObject.TypeInterface
|
|
4140
|
+
supplement_prep: (interaction: ImportInteraction, builder: Gck.Builder) => void
|
|
4141
|
+
supplement: (interaction: ImportInteraction, builder: Gck.Builder, cancellable: Gio.Cancellable | null) => Gio.TlsInteractionResult
|
|
4142
|
+
supplement_async: (interaction: ImportInteraction, builder: Gck.Builder, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null) => void
|
|
4143
|
+
supplement_finish: (interaction: ImportInteraction, result: Gio.AsyncResult) => Gio.TlsInteractionResult
|
|
4144
|
+
}
|
|
4145
|
+
|
|
4146
|
+
/**
|
|
4147
|
+
* Interface implemented by implementations of [iface`ImportInteraction]`.
|
|
4148
|
+
* @record
|
|
4149
|
+
*/
|
|
4150
|
+
abstract class ImportInteractionIface {
|
|
4151
|
+
|
|
4152
|
+
// Own properties of Gcr-3.Gcr.ImportInteractionIface
|
|
4153
|
+
|
|
4154
|
+
static name: string
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
interface ImporterIface {
|
|
4158
|
+
|
|
4159
|
+
// Own fields of Gcr-3.Gcr.ImporterIface
|
|
4160
|
+
|
|
4161
|
+
/**
|
|
4162
|
+
* parent interface
|
|
4163
|
+
* @field
|
|
4164
|
+
*/
|
|
4165
|
+
parent: GObject.TypeInterface
|
|
4166
|
+
queue_for_parsed: (importer: Importer, parsed: Parsed) => boolean
|
|
4167
|
+
import_sync: (importer: Importer, cancellable: Gio.Cancellable | null) => boolean
|
|
4168
|
+
import_async: (importer: Importer, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null) => void
|
|
4169
|
+
import_finish: (importer: Importer, result: Gio.AsyncResult) => boolean
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
/**
|
|
4173
|
+
* Interface implemented for a #GcrImporter.
|
|
4174
|
+
* @record
|
|
4175
|
+
*/
|
|
4176
|
+
abstract class ImporterIface {
|
|
4177
|
+
|
|
4178
|
+
// Own properties of Gcr-3.Gcr.ImporterIface
|
|
4179
|
+
|
|
4180
|
+
static name: string
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
interface Parsed {
|
|
4184
|
+
|
|
4185
|
+
// Owm methods of Gcr-3.Gcr.Parsed
|
|
4186
|
+
|
|
4187
|
+
/**
|
|
4188
|
+
* Get the attributes which make up the parsed item.
|
|
4189
|
+
* @returns the attributes for the item; these are owned by the parsed item and should not be freed
|
|
4190
|
+
*/
|
|
4191
|
+
get_attributes(): Gck.Attributes | null
|
|
4192
|
+
/**
|
|
4193
|
+
* Get the raw data block for the parsed item.
|
|
4194
|
+
* @returns the raw data of the parsed item, or %NULL
|
|
4195
|
+
*/
|
|
4196
|
+
get_bytes(): GLib.Bytes
|
|
4197
|
+
/**
|
|
4198
|
+
* Get the raw data block for the parsed item.
|
|
4199
|
+
* @returns the raw data of the parsed item, or %NULL
|
|
4200
|
+
*/
|
|
4201
|
+
get_data(): Uint8Array | null
|
|
4202
|
+
/**
|
|
4203
|
+
* Get the descirption for a parsed item.
|
|
4204
|
+
* @returns the description
|
|
4205
|
+
*/
|
|
4206
|
+
get_description(): string | null
|
|
4207
|
+
/**
|
|
4208
|
+
* Get the filename of the parsed item.
|
|
4209
|
+
* @returns the filename of the parsed item, or %NULL
|
|
4210
|
+
*/
|
|
4211
|
+
get_filename(): string | null
|
|
4212
|
+
/**
|
|
4213
|
+
* Get the format of the parsed item.
|
|
4214
|
+
* @returns the data format of the item
|
|
4215
|
+
*/
|
|
4216
|
+
get_format(): DataFormat
|
|
4217
|
+
/**
|
|
4218
|
+
* Get the label for the parsed item.
|
|
4219
|
+
* @returns the label for the item
|
|
4220
|
+
*/
|
|
4221
|
+
get_label(): string | null
|
|
4222
|
+
/**
|
|
4223
|
+
* Add a reference to a parsed item. An item may not be shared across threads
|
|
4224
|
+
* until it has been referenced at least once.
|
|
4225
|
+
* @returns the parsed item
|
|
4226
|
+
*/
|
|
4227
|
+
ref(): Parsed
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
/**
|
|
4231
|
+
* A parsed item parsed by a #GcrParser.
|
|
4232
|
+
* @record
|
|
4233
|
+
*/
|
|
4234
|
+
class Parsed {
|
|
4235
|
+
|
|
4236
|
+
// Own properties of Gcr-3.Gcr.Parsed
|
|
4237
|
+
|
|
4238
|
+
static name: string
|
|
4239
|
+
|
|
4240
|
+
// Constructors of Gcr-3.Gcr.Parsed
|
|
4241
|
+
|
|
4242
|
+
/**
|
|
4243
|
+
* Unreferences a parsed item which was referenced with gcr_parsed_ref()
|
|
4244
|
+
* @param parsed a parsed item
|
|
4245
|
+
*/
|
|
4246
|
+
static unref(parsed: any | null): void
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
interface ParserClass {
|
|
4250
|
+
|
|
4251
|
+
// Own fields of Gcr-3.Gcr.ParserClass
|
|
4252
|
+
|
|
4253
|
+
/**
|
|
4254
|
+
* The parent class
|
|
4255
|
+
* @field
|
|
4256
|
+
*/
|
|
4257
|
+
parent_class: GObject.ObjectClass
|
|
4258
|
+
authenticate: (self: Parser, count: number) => boolean
|
|
4259
|
+
parsed: (self: Parser) => void
|
|
4260
|
+
}
|
|
4261
|
+
|
|
4262
|
+
/**
|
|
4263
|
+
* The class for #GcrParser
|
|
4264
|
+
* @record
|
|
4265
|
+
*/
|
|
4266
|
+
abstract class ParserClass {
|
|
4267
|
+
|
|
4268
|
+
// Own properties of Gcr-3.Gcr.ParserClass
|
|
4269
|
+
|
|
4270
|
+
static name: string
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
interface ParserPrivate {
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4276
|
+
class ParserPrivate {
|
|
4277
|
+
|
|
4278
|
+
// Own properties of Gcr-3.Gcr.ParserPrivate
|
|
4279
|
+
|
|
4280
|
+
static name: string
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
interface Pkcs11CertificateClass {
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
abstract class Pkcs11CertificateClass {
|
|
4287
|
+
|
|
4288
|
+
// Own properties of Gcr-3.Gcr.Pkcs11CertificateClass
|
|
4289
|
+
|
|
4290
|
+
static name: string
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
interface Pkcs11CertificatePrivate {
|
|
4294
|
+
}
|
|
4295
|
+
|
|
4296
|
+
class Pkcs11CertificatePrivate {
|
|
4297
|
+
|
|
4298
|
+
// Own properties of Gcr-3.Gcr.Pkcs11CertificatePrivate
|
|
4299
|
+
|
|
4300
|
+
static name: string
|
|
4301
|
+
}
|
|
4302
|
+
|
|
4303
|
+
interface PromptIface {
|
|
4304
|
+
|
|
4305
|
+
// Own fields of Gcr-3.Gcr.PromptIface
|
|
4306
|
+
|
|
4307
|
+
/**
|
|
4308
|
+
* parent interface
|
|
4309
|
+
* @field
|
|
4310
|
+
*/
|
|
4311
|
+
parent_iface: GObject.TypeInterface
|
|
4312
|
+
prompt_password_async: (prompt: Prompt, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null) => void
|
|
4313
|
+
prompt_password_finish: (prompt: Prompt, result: Gio.AsyncResult) => string | null
|
|
4314
|
+
prompt_confirm_async: (prompt: Prompt, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null) => void
|
|
4315
|
+
prompt_confirm_finish: (prompt: Prompt, result: Gio.AsyncResult) => PromptReply
|
|
4316
|
+
prompt_close: (prompt: Prompt) => void
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
/**
|
|
4320
|
+
* The interface for implementing [class`Prompt]`.
|
|
4321
|
+
* @record
|
|
4322
|
+
*/
|
|
4323
|
+
abstract class PromptIface {
|
|
4324
|
+
|
|
4325
|
+
// Own properties of Gcr-3.Gcr.PromptIface
|
|
4326
|
+
|
|
4327
|
+
static name: string
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
interface SecretExchangeClass {
|
|
4331
|
+
|
|
4332
|
+
// Own fields of Gcr-3.Gcr.SecretExchangeClass
|
|
4333
|
+
|
|
4334
|
+
generate_exchange_key: (exchange: SecretExchange, scheme: string | null, public_key: number, n_public_key: number) => boolean
|
|
4335
|
+
derive_transport_key: (exchange: SecretExchange, peer: number, n_peer: number) => boolean
|
|
4336
|
+
}
|
|
4337
|
+
|
|
4338
|
+
abstract class SecretExchangeClass {
|
|
4339
|
+
|
|
4340
|
+
// Own properties of Gcr-3.Gcr.SecretExchangeClass
|
|
4341
|
+
|
|
4342
|
+
static name: string
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
interface SecretExchangePrivate {
|
|
4346
|
+
}
|
|
4347
|
+
|
|
4348
|
+
class SecretExchangePrivate {
|
|
4349
|
+
|
|
4350
|
+
// Own properties of Gcr-3.Gcr.SecretExchangePrivate
|
|
4351
|
+
|
|
4352
|
+
static name: string
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4355
|
+
interface SimpleCertificateClass {
|
|
4356
|
+
|
|
4357
|
+
// Own fields of Gcr-3.Gcr.SimpleCertificateClass
|
|
4358
|
+
|
|
4359
|
+
parent_class: GObject.ObjectClass
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4362
|
+
abstract class SimpleCertificateClass {
|
|
4363
|
+
|
|
4364
|
+
// Own properties of Gcr-3.Gcr.SimpleCertificateClass
|
|
4365
|
+
|
|
4366
|
+
static name: string
|
|
4367
|
+
}
|
|
4368
|
+
|
|
4369
|
+
interface SimpleCertificatePrivate {
|
|
4370
|
+
}
|
|
4371
|
+
|
|
4372
|
+
class SimpleCertificatePrivate {
|
|
4373
|
+
|
|
4374
|
+
// Own properties of Gcr-3.Gcr.SimpleCertificatePrivate
|
|
4375
|
+
|
|
4376
|
+
static name: string
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
interface SimpleCollectionClass {
|
|
4380
|
+
|
|
4381
|
+
// Own fields of Gcr-3.Gcr.SimpleCollectionClass
|
|
4382
|
+
|
|
4383
|
+
parent_class: GObject.ObjectClass
|
|
4384
|
+
}
|
|
4385
|
+
|
|
4386
|
+
abstract class SimpleCollectionClass {
|
|
4387
|
+
|
|
4388
|
+
// Own properties of Gcr-3.Gcr.SimpleCollectionClass
|
|
4389
|
+
|
|
4390
|
+
static name: string
|
|
4391
|
+
}
|
|
4392
|
+
|
|
4393
|
+
interface SimpleCollectionPrivate {
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
class SimpleCollectionPrivate {
|
|
4397
|
+
|
|
4398
|
+
// Own properties of Gcr-3.Gcr.SimpleCollectionPrivate
|
|
4399
|
+
|
|
4400
|
+
static name: string
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
interface SshAskpassClass {
|
|
4404
|
+
|
|
4405
|
+
// Own fields of Gcr-3.Gcr.SshAskpassClass
|
|
4406
|
+
|
|
4407
|
+
parent_class: GObject.ObjectClass
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
abstract class SshAskpassClass {
|
|
4411
|
+
|
|
4412
|
+
// Own properties of Gcr-3.Gcr.SshAskpassClass
|
|
4413
|
+
|
|
4414
|
+
static name: string
|
|
4415
|
+
}
|
|
4416
|
+
|
|
4417
|
+
interface SystemPromptClass {
|
|
4418
|
+
|
|
4419
|
+
// Own fields of Gcr-3.Gcr.SystemPromptClass
|
|
4420
|
+
|
|
4421
|
+
parent_class: GObject.ObjectClass
|
|
4422
|
+
}
|
|
4423
|
+
|
|
4424
|
+
abstract class SystemPromptClass {
|
|
4425
|
+
|
|
4426
|
+
// Own properties of Gcr-3.Gcr.SystemPromptClass
|
|
4427
|
+
|
|
4428
|
+
static name: string
|
|
4429
|
+
}
|
|
4430
|
+
|
|
4431
|
+
interface SystemPromptPrivate {
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
class SystemPromptPrivate {
|
|
4435
|
+
|
|
4436
|
+
// Own properties of Gcr-3.Gcr.SystemPromptPrivate
|
|
4437
|
+
|
|
4438
|
+
static name: string
|
|
4439
|
+
}
|
|
4440
|
+
|
|
4441
|
+
interface SystemPrompterClass {
|
|
4442
|
+
|
|
4443
|
+
// Own fields of Gcr-3.Gcr.SystemPrompterClass
|
|
4444
|
+
|
|
4445
|
+
/**
|
|
4446
|
+
* parent class
|
|
4447
|
+
* @field
|
|
4448
|
+
*/
|
|
4449
|
+
parent_class: GObject.ObjectClass
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
/**
|
|
4453
|
+
* The class for #GcrSystemPrompter.
|
|
4454
|
+
* @record
|
|
4455
|
+
*/
|
|
4456
|
+
abstract class SystemPrompterClass {
|
|
4457
|
+
|
|
4458
|
+
// Own properties of Gcr-3.Gcr.SystemPrompterClass
|
|
4459
|
+
|
|
4460
|
+
static name: string
|
|
4461
|
+
}
|
|
4462
|
+
|
|
4463
|
+
interface SystemPrompterPrivate {
|
|
4464
|
+
}
|
|
4465
|
+
|
|
4466
|
+
class SystemPrompterPrivate {
|
|
4467
|
+
|
|
4468
|
+
// Own properties of Gcr-3.Gcr.SystemPrompterPrivate
|
|
4469
|
+
|
|
4470
|
+
static name: string
|
|
4471
|
+
}
|
|
4472
|
+
|
|
4473
|
+
interface UnionCollectionClass {
|
|
4474
|
+
|
|
4475
|
+
// Own fields of Gcr-3.Gcr.UnionCollectionClass
|
|
4476
|
+
|
|
4477
|
+
parent_class: GObject.ObjectClass
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
abstract class UnionCollectionClass {
|
|
4481
|
+
|
|
4482
|
+
// Own properties of Gcr-3.Gcr.UnionCollectionClass
|
|
4483
|
+
|
|
4484
|
+
static name: string
|
|
4485
|
+
}
|
|
4486
|
+
|
|
4487
|
+
interface UnionCollectionPrivate {
|
|
4488
|
+
}
|
|
4489
|
+
|
|
4490
|
+
class UnionCollectionPrivate {
|
|
4491
|
+
|
|
4492
|
+
// Own properties of Gcr-3.Gcr.UnionCollectionPrivate
|
|
4493
|
+
|
|
4494
|
+
static name: string
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
/**
|
|
4498
|
+
* Name of the imported GIR library
|
|
4499
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
4500
|
+
*/
|
|
4501
|
+
const __name__: string
|
|
4502
|
+
/**
|
|
4503
|
+
* Version of the imported GIR library
|
|
4504
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
4505
|
+
*/
|
|
4506
|
+
const __version__: string
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4509
|
+
export default Gcr;
|
|
4510
|
+
// END
|