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