@girs/gcr-4 4.0.0-3.0.4 → 4.0.4

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