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