/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
import '@girs/gjs';
// Module dependencies
import type Gio from '@girs/gio-2.0';
import type GObject from '@girs/gobject-2.0';
import type GLib from '@girs/glib-2.0';
import type GModule from '@girs/gmodule-2.0';
import type Gck from '@girs/gck-2';
export namespace Gcr {
/**
* Gcr-4
*/
/**
* The status of a built certificate chain. Will be set to
* {@link Gcr.CertificateChainStatus.UNKNOWN} for certificate chains that have not been
* built.
* @gir-type Enum
*/
enum CertificateChainStatus {
/**
* The certificate chain's status is unknown.
* When a chain is not yet built it has this status. If a chain is modified after
* being built, it has this status.
*/
UNKNOWN,
/**
* A full chain could not be loaded. The
* chain does not end with a self-signed certificate, a trusted anchor, or a
* pinned certificate.
*/
INCOMPLETE,
/**
* The certificate chain contains a revoked
* or otherwise explicitly distrusted certificate. The entire chain should
* be distrusted.
*/
DISTRUSTED,
/**
* The chain ends with a self-signed
* certificate. No trust anchor was found.
*/
SELFSIGNED,
/**
* The chain represents a pinned certificate. A
* pinned certificate is an exception which trusts a given certificate
* explicitly for a purpose and communication with a certain peer.
*/
PINNED,
/**
* The chain ends with an anchored
* certificate. The anchored certificate is not necessarily self-signed.
*/
ANCHORED,
}
/**
* The format of a certificate request. Currently only PKCS#10 is supported.
* @gir-type Enum
*/
enum CertificateRequestFormat {
/**
* certificate request is in PKCS#10 format
*/
CERTIFICATE_REQUEST_PKCS10,
}
/**
* Values responding to error codes for parsing and serializing data.
* @gir-type Enum
*/
enum DataError {
/**
* Failed to parse or serialize the data
*/
FAILURE,
/**
* The data was unrecognized or unsupported
*/
UNRECOGNIZED,
/**
* The operation was cancelled
*/
CANCELLED,
/**
* The data was encrypted or locked and could not be unlocked.
*/
LOCKED,
}
/**
* The various format identifiers.
* @gir-type Enum
*/
enum DataFormat {
/**
* Represents all the formats, when enabling or disabling
*/
ALL,
/**
* Not a valid format
*/
INVALID,
/**
* DER encoded private key
*/
DER_PRIVATE_KEY,
/**
* DER encoded RSA private key
*/
DER_PRIVATE_KEY_RSA,
/**
* DER encoded DSA private key
*/
DER_PRIVATE_KEY_DSA,
/**
* DER encoded EC private key
*/
DER_PRIVATE_KEY_EC,
/**
* DER encoded SubjectPublicKeyInfo
*/
DER_SUBJECT_PUBLIC_KEY,
/**
* DER encoded X.509 certificate
*/
DER_CERTIFICATE_X509,
/**
* DER encoded PKCS#7 container file which can contain certificates
*/
DER_PKCS7,
/**
* DER encoded PKCS#8 file which can contain a key
*/
DER_PKCS8,
/**
* Unencrypted DER encoded PKCS#8 file which can contain a key
*/
DER_PKCS8_PLAIN,
/**
* Encrypted DER encoded PKCS#8 file which can contain a key
*/
DER_PKCS8_ENCRYPTED,
/**
* DER encoded PKCS#10 certificate request file
*/
DER_PKCS10,
/**
* DER encoded SPKAC as generated by HTML5 keygen element
*/
DER_SPKAC,
/**
* OpenSSL style SPKAC data
*/
BASE64_SPKAC,
/**
* DER encoded PKCS#12 file which can contain certificates and/or keys
*/
DER_PKCS12,
/**
* OpenSSH v1 or v2 public key
*/
OPENSSH_PUBLIC,
/**
* OpenPGP key packet(s)
*/
OPENPGP_PACKET,
/**
* OpenPGP public or private key armor encoded data
*/
OPENPGP_ARMOR,
/**
* An OpenSSL style PEM file with unspecified contents
*/
PEM,
/**
* An OpenSSL style PEM file with a private RSA key
*/
PEM_PRIVATE_KEY_RSA,
/**
* An OpenSSL style PEM file with a private DSA key
*/
PEM_PRIVATE_KEY_DSA,
/**
* An OpenSSL style PEM file with an X.509 certificate
*/
PEM_CERTIFICATE_X509,
/**
* An OpenSSL style PEM file containing PKCS#7
*/
PEM_PKCS7,
/**
* Unencrypted OpenSSL style PEM file containing PKCS#8
*/
PEM_PKCS8_PLAIN,
/**
* Encrypted OpenSSL style PEM file containing PKCS#8
*/
PEM_PKCS8_ENCRYPTED,
/**
* An OpenSSL style PEM file containing PKCS#12
*/
PEM_PKCS12,
/**
* An OpenSSL style PEM file with a private key
*/
PEM_PRIVATE_KEY,
/**
* An OpenSSL style PEM file containing PKCS#10
*/
PEM_PKCS10,
/**
* An OpenSSL style PEM file with a private EC key
*/
PEM_PRIVATE_KEY_EC,
/**
* An OpenSSL style PEM file containing a SubjectPublicKeyInfo
*/
PEM_PUBLIC_KEY,
}
/**
* Various replies returned by {@link Prompt.confirm} and friends.
* @gir-type Enum
*/
enum PromptReply {
/**
* the prompt was cancelled
*/
CANCEL,
/**
* the user replied with 'ok'
*/
CONTINUE,
}
/**
* No error returned by the {@link Gcr.SystemPrompt} is suitable for display or
* to the user.
*
* If the system prompter can only show one prompt at a time, and there is
* already a prompt being displayed, and the timeout waiting to open the
* prompt expires, then {@link Gcr.SystemPromptError.SYSTEM_PROMPT_IN_PROGRESS} is returned.
* @gir-type Enum
*/
enum SystemPromptError {
/**
* another prompt is already in progress
*/
SYSTEM_PROMPT_IN_PROGRESS,
}
/**
* The mode for the system prompter. Most system prompters can only show
* one prompt at a time and would use the {@link Gcr.SystemPrompterMode.SINGLE} mode.
* @gir-type Enum
*/
enum SystemPrompterMode {
/**
* only one prompt shown at a time
*/
SINGLE,
/**
* more than one prompt shown at a time
*/
MULTIPLE,
}
/**
* The major version number of the Gcr library.
*/
const MAJOR_VERSION: number;
/**
* The micro version number of the Gcr library.
*/
const MICRO_VERSION: number;
/**
* The minor version number of the Gcr library.
*/
const MINOR_VERSION: number;
/**
* The purpose used to verify the client certificate in a TLS connection.
*/
const PURPOSE_CLIENT_AUTH: string;
/**
* The purpose used to verify certificate used for the signature on signed code.
*/
const PURPOSE_CODE_SIGNING: string;
/**
* The purpose used to verify certificates that are used in email communication
* such as S/MIME.
*/
const PURPOSE_EMAIL: string;
/**
* The purpose used to verify the server certificate in a TLS connection. This
* is the most common purpose in use.
*/
const PURPOSE_SERVER_AUTH: string;
/**
* The current secret exchange protocol. Key agreement is done using DH with the
* 1536 bit IKE parameter group. Keys are derived using SHA256 with HKDF. The
* transport encryption is done with 128 bit AES.
*/
const SECRET_EXCHANGE_PROTOCOL_1: string;
const UNLOCK_OPTION_ALWAYS: string;
const UNLOCK_OPTION_IDLE: string;
const UNLOCK_OPTION_SESSION: string;
const UNLOCK_OPTION_TIMEOUT: string;
function data_error_get_domain(): GLib.Quark;
/**
* Create a key fingerprint for a certificate, public key or private key.
* Note that this is not a fingerprint of certificate data, which you would
* use `gcr_certificate_get_fingerprint()` for.
* @param attrs attributes for key or certificate
* @param checksum_type the type of fingerprint to create
* @returns the fingerprint or `null` if the input was invalid.
*/
function fingerprint_from_attributes(attrs: Gck.Attributes, checksum_type: GLib.ChecksumType): Uint8Array | null;
/**
* Create a key fingerprint for a DER encoded subjectPublicKeyInfo. The
* fingerprint is created so that it will be identical for a key and its
* corresponding certificate.
*
* Note that in the case of certificates this is not a fingerprint of the
* actual certificate data, but rather of the public key contained in a
* certificate.
* @param key_info DER encoded subjectPublicKeyInfo structure
* @param checksum_type the type of fingerprint to create
* @returns the fingerprint or `null` if the input was invalid.
*/
function fingerprint_from_subject_public_key_info(key_info: Uint8Array | string, checksum_type: GLib.ChecksumType): Uint8Array | null;
/**
* Create a set of importers which can import this parsed item.
*
* The parsed item is represented by the state of the {@link Gcr.Parser} at the
* time of calling this method.
* @param parsed a parser with a parsed item to import
* @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
*/
function importer_create_for_parsed(parsed: Parsed): Importer[];
/**
* Queues an additional item to be imported in all compattible importers
* in the set. The parsed item is represented by the state of the {@link Gcr.Parser}
* at the time of calling this method.
*
* If the parsed item is incompatible with an importer, then that the item
* will not be queued on that importer.
* @param importers a set of importers
* @param parsed a parsed item
* @returns a new set of importers that queued the item.
*/
function importer_queue_and_filter_for_parsed(importers: Importer[], parsed: Parsed): Importer[];
/**
* Register an importer to handle parsed items that match the given attributes.
* @param importer_type the GType of the importer being registered
* @param attrs the attributes that this importer is compatible with
*/
function importer_register(importer_type: GObject.GType, attrs: Gck.Attributes): void;
/**
* Register built-in PKCS#11 and GnuPG importers.
*/
function importer_register_well_known(): void;
/**
* Disconnect the mock prompter
*/
function mock_prompter_disconnect(): void;
/**
* Queue an expected response on the mock prompter.
*
* Expects any prompt, and closes the prompt when it gets it.
*/
function mock_prompter_expect_close(): void;
/**
* Queue an expected response on the mock prompter.
*
* Expects a confirmation prompt, and then cancels that prompt.
*/
function mock_prompter_expect_confirm_cancel(): void;
/**
* Queue an expected response on the mock prompter.
*
* Expects a password prompt, and then cancels that prompt.
*/
function mock_prompter_expect_password_cancel(): void;
/**
* Get the delay in milliseconds before the mock prompter completes
* an expected prompt.
* @returns the delay
*/
function mock_prompter_get_delay_msec(): number;
/**
* Check if the mock prompter is expecting a response. This will be `true`
* when one of the gcr_mock_prompter_expect_xxx()
* functions have been used to queue an expected prompt, but that prompt
* response has not be 'used' yet.
* @returns whether expecting a prompt
*/
function mock_prompter_is_expecting(): boolean;
/**
* Check if the mock prompter is showing any prompts.
* @returns whether prompting
*/
function mock_prompter_is_prompting(): boolean;
/**
* Set the delay in milliseconds before the mock prompter completes
* an expected prompt.
* @param delay_msec prompt response delay in milliseconds
*/
function mock_prompter_set_delay_msec(delay_msec: number): void;
/**
* Start the mock prompter. This is often used from the
* setup() function of tests.
*
* Starts the mock prompter in an additional thread. Use the returned DBus bus
* name with `gcr_system_prompt_open_for_prompter()` to connect to this prompter.
* @returns the bus name that the mock prompter is listening on
*/
function mock_prompter_start(): string;
/**
* Stop the mock prompter. This is often used from the
* teardown() function of tests.
*/
function mock_prompter_stop(): void;
/**
* Unreferences a parsed item which was referenced with `gcr_parsed_ref()`
* @param parsed a parsed item
*/
function parsed_unref(parsed: null): void;
/**
* Add a {@link Gck.Module} to the list of PKCS#11 modules that are used by the
* GCR library.
*
* It is not normally necessary to call this function. The available
* PKCS#11 modules installed on the system are automatically loaded
* by the GCR library.
* @param module a {@link Gck.Module}
*/
function pkcs11_add_module(module: Gck.Module): void;
/**
* Initialize a PKCS#11 module and add it to the modules that are
* used by the GCR library. Note that is an error to initialize the same
* PKCS#11 module twice.
*
* It is not normally necessary to call this function. The available
* PKCS#11 modules installed on the system are automatically loaded
* by the GCR library.
* @param module_path the full file path of the PKCS#11 module
* @param unused unused
* @returns whether the module was sucessfully added.
*/
function pkcs11_add_module_from_file(module_path: string, unused: null): boolean;
/**
* List all the PKCS#11 modules that are used by the GCR library.
* Each module is a {@link Gck.Module} object.
*
* An empty list of modules will be returned if {@link pkcs11_set_modules},
* or {@link pkcs11_initialize} has not yet run.
* @returns a newly allocated list of {@link Gck.Module} objects
*/
function pkcs11_get_modules(): Gck.Module[];
/**
* List all the PKCS#11 slots that are used by the GCR library for lookup
* of trust assertions. Each slot is a {@link Gck.Slot} object.
*
* This will return an empty list if the {@link pkcs11_initialize} function has
* not yet been called.
* @returns a list of {@link Gck.Slot} objects to use for lookup of trust, or the empty list if not initialized or no appropriate trust stores could be found.
*/
function pkcs11_get_trust_lookup_slots(): Gck.Slot[];
/**
* Get the PKCS#11 URIs that are used to identify which slots to use for
* lookup trust assertions.
* @returns the uri which identifies trust storage slot
*/
function pkcs11_get_trust_lookup_uris(): string[] | null;
/**
* Selects an appropriate PKCS#11 slot to store trust assertions. The slot
* to use is normally configured automatically by the system.
*
* This will only return a valid result after the {@link pkcs11_initialize}
* method has been called.
*
* When done with the {@link Gck.Slot}, use `g_object_unref()` to release it.
* @returns the {@link Gck.Slot} to use for trust assertions, or null if not initialized or no appropriate trust store could be found.
*/
function pkcs11_get_trust_store_slot(): Gck.Slot | null;
/**
* Get the PKCS#11 URI that is used to identify which slot to use for
* storing trust storage.
* @returns the uri which identifies trust storage slot
*/
function pkcs11_get_trust_store_uri(): string | null;
/**
* Asynchronously initialize the registered PKCS#11 modules.
* @param cancellable optional cancellable used to cancel the operation
* @returns whether the operation was successful or not.
*/
function pkcs11_initialize(cancellable: Gio.Cancellable | null): boolean;
/**
* Asynchronously initialize the registered PKCS#11 modules.
* @param cancellable optional cancellable used to cancel the operation
*/
function pkcs11_initialize_async(cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously initialize the registered PKCS#11 modules.
* @param cancellable optional cancellable used to cancel the operation
* @param callback callback which will be called when the operation completes
*/
function pkcs11_initialize_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously initialize the registered PKCS#11 modules.
* @param cancellable optional cancellable used to cancel the operation
* @param callback callback which will be called when the operation completes
*/
function pkcs11_initialize_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Complete the asynchronous operation to initialize the registered PKCS#11
* modules.
* @param result the asynchronous result
* @returns whether the operation was successful or not.
*/
function pkcs11_initialize_finish(result: Gio.AsyncResult): boolean;
/**
* Set the list of PKCS#11 modules that are used by the GCR library.
* Each module in the list is a {@link Gck.Module} object.
*
* It is not normally necessary to call this function. The available
* PKCS#11 modules installed on the system are automatically loaded
* by the GCR library.
* @param modules a list of PKCS#11 modules
*/
function pkcs11_set_modules(modules: Gck.Module[]): void;
/**
* Set the PKCS#11 URIs that are used to identify which slots to use for
* lookup of trust assertions.
*
* It is not normally necessary to call this function. The relevant
* PKCS#11 slots are automatically configured by the GCR library.
* @param pkcs11_uris the uris which identifies trust lookup slots
*/
function pkcs11_set_trust_lookup_uris(pkcs11_uris: string | null): void;
/**
* Set the PKCS#11 URI that is used to identify which slot to use for
* storing trust assertions.
*
* It is not normally necessary to call this function. The relevant
* PKCS#11 slot is automatically configured by the GCR library.
* @param pkcs11_uri the uri which identifies trust storage slot
*/
function pkcs11_set_trust_store_uri(pkcs11_uri: string | null): void;
/**
* Add a pinned `certificate` for connections to `peer` for `purpose`. A pinned
* certificate overrides all other certificate verification and should be
* used with care.
*
* If the same pinned certificate already exists, then this operation
* does not add another, and succeeds without error.
*
* This call may block, see {@link Gcr.trust_add_pinned_certificate_async} for
* the non-blocking version.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @returns `true` if the pinned certificate is recorded successfully
*/
function trust_add_pinned_certificate(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): boolean;
/**
* Add a pinned certificate for communication with `peer` for `purpose`. A pinned
* certificate overrides all other certificate verification and should be used
* with care.
*
* If the same pinned certificate already exists, then this operation
* does not add another, and succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_add_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
*/
function trust_add_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Add a pinned certificate for communication with `peer` for `purpose`. A pinned
* certificate overrides all other certificate verification and should be used
* with care.
*
* If the same pinned certificate already exists, then this operation
* does not add another, and succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_add_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_add_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Add a pinned certificate for communication with `peer` for `purpose`. A pinned
* certificate overrides all other certificate verification and should be used
* with care.
*
* If the same pinned certificate already exists, then this operation
* does not add another, and succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_add_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_add_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* {@link Gcr.trust_add_pinned_certificate_async}.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns `true` if the pinned certificate is recorded successfully
*/
function trust_add_pinned_certificate_finish(result: Gio.AsyncResult): boolean;
/**
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
* anchor is used to verify the signatures on other certificates when verifying
* a certificate chain. Also known as a trusted certificate authority.
*
* This call may block, see {@link Gcr.trust_is_certificate_anchored_async} for
* the non-blocking version.
*
* In the case of an error, `false` is also returned. Check `error` to detect
* if an error occurred.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param cancellable a {@link Gio.Cancellable}
* @returns `true` if the certificate is a trust anchor
*/
function trust_is_certificate_anchored(certificate: Certificate, purpose: string, cancellable: Gio.Cancellable | null): boolean;
/**
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
* anchor is used to verify the signatures on other certificates when verifying
* a certificate chain. Also known as a trusted certificate authority.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_anchored_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param cancellable a {@link Gio.Cancellable}
*/
function trust_is_certificate_anchored_async(certificate: Certificate, purpose: string, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
* anchor is used to verify the signatures on other certificates when verifying
* a certificate chain. Also known as a trusted certificate authority.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_anchored_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_anchored_async(certificate: Certificate, purpose: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Check if the `certificate` is a trust anchor for the given `purpose`. A trust
* anchor is used to verify the signatures on other certificates when verifying
* a certificate chain. Also known as a trusted certificate authority.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_anchored_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_anchored_async(certificate: Certificate, purpose: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* {@link Gcr.trust_is_certificate_anchored_async}.
*
* In the case of an error, `false` is also returned. Check `error` to detect
* if an error occurred.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns `true` if the certificate is a trust anchor
*/
function trust_is_certificate_anchored_finish(result: Gio.AsyncResult): boolean;
/**
* Checks whether the certificate that can be uniquely identified with the
* given `serial_nr` and `issuer` is marked as distrusted (for example by the
* user, or because it's part of a CRL).
*
* Since we can't directly use {@link Certificate} to fetch these values, you
* need to call these with the raw serial number and issuer as provided by the
* PKCS#11 fields `CKA_SERIAL_NR` and `CKA_ISSUER`.
* @param serial_nr The serial number of the certificate
* @param issuer The raw issuer
* @param cancellable a {@link Gio.Cancellable} or `null`
* @returns `true` if the certificate is marked as distrusted
*/
function trust_is_certificate_distrusted(serial_nr: Uint8Array | string, issuer: Uint8Array | string, cancellable: Gio.Cancellable | null): boolean;
/**
* Asynchronously checks whether the certificate that can be uniquely
* identified with the given `serial_nr` and `issuer` is marked as distrusted
* (for example by the user, or because it's part of a CRL).
*
* Since we can't directly use {@link Certificate} to fetch these values, you
* need to call these with the raw serial number and issuer as provided by the
* PKCS#11 fields `CKA_SERIAL_NR` and `CKA_ISSUER`.
*
* When the operation is finished, `callback` will be called. You can then call
* {@link trust_is_certificate_distrusted_finish} to get the result of the
* operation.
* @param serial_nr The serial number of the certificate
* @param issuer The raw issuer
* @param cancellable a {@link Gio.Cancellable} or `null`
*/
function trust_is_certificate_distrusted_async(serial_nr: Uint8Array | string, issuer: Uint8Array | string, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously checks whether the certificate that can be uniquely
* identified with the given `serial_nr` and `issuer` is marked as distrusted
* (for example by the user, or because it's part of a CRL).
*
* Since we can't directly use {@link Certificate} to fetch these values, you
* need to call these with the raw serial number and issuer as provided by the
* PKCS#11 fields `CKA_SERIAL_NR` and `CKA_ISSUER`.
*
* When the operation is finished, `callback` will be called. You can then call
* {@link trust_is_certificate_distrusted_finish} to get the result of the
* operation.
* @param serial_nr The serial number of the certificate
* @param issuer The raw issuer
* @param cancellable a {@link Gio.Cancellable} or `null`
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_distrusted_async(serial_nr: Uint8Array | string, issuer: Uint8Array | string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously checks whether the certificate that can be uniquely
* identified with the given `serial_nr` and `issuer` is marked as distrusted
* (for example by the user, or because it's part of a CRL).
*
* Since we can't directly use {@link Certificate} to fetch these values, you
* need to call these with the raw serial number and issuer as provided by the
* PKCS#11 fields `CKA_SERIAL_NR` and `CKA_ISSUER`.
*
* When the operation is finished, `callback` will be called. You can then call
* {@link trust_is_certificate_distrusted_finish} to get the result of the
* operation.
* @param serial_nr The serial number of the certificate
* @param issuer The raw issuer
* @param cancellable a {@link Gio.Cancellable} or `null`
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_distrusted_async(serial_nr: Uint8Array | string, issuer: Uint8Array | string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* {@link trust_is_certificate_distrusted_async}.
*
* In the case of an error, `false` is also returned. Check `error` to detect
* if an error occurred.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns `true` if the certificate is a trust anchor
*/
function trust_is_certificate_distrusted_finish(result: Gio.AsyncResult): boolean;
/**
* Check if `certificate` is pinned for `purpose` to communicate with `peer`.
* A pinned certificate overrides all other certificate verification.
*
* This call may block, see {@link Gcr.trust_is_certificate_pinned_async} for
* the non-blocking version.
*
* In the case of an error, `false` is also returned. Check `error` to detect
* if an error occurred.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param peer the peer for this pinned
* @param cancellable a {@link Gio.Cancellable}
* @returns `true` if the certificate is pinned for the host and purpose
*/
function trust_is_certificate_pinned(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): boolean;
/**
* Check if `certificate` is pinned for `purpose` to communicate with `peer`. A
* pinned certificate overrides all other certificate verification.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_pinned_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param peer the peer for this pinned
* @param cancellable a {@link Gio.Cancellable}
*/
function trust_is_certificate_pinned_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Check if `certificate` is pinned for `purpose` to communicate with `peer`. A
* pinned certificate overrides all other certificate verification.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_pinned_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param peer the peer for this pinned
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_pinned_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Check if `certificate` is pinned for `purpose` to communicate with `peer`. A
* pinned certificate overrides all other certificate verification.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_is_certificate_pinned_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate} to check
* @param purpose the purpose string
* @param peer the peer for this pinned
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_is_certificate_pinned_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* {@link Gcr.trust_is_certificate_pinned_async}.
*
* In the case of an error, `false` is also returned. Check `error` to detect
* if an error occurred.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns `true` if the certificate is pinned.
*/
function trust_is_certificate_pinned_finish(result: Gio.AsyncResult): boolean;
/**
* Remove a pinned certificate for communication with `peer` for `purpose`.
*
* If the same pinned certificate does not exist, or was already removed,
* then this operation succeeds without error.
*
* This call may block, see {@link Gcr.trust_remove_pinned_certificate_async}
* for the non-blocking version.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @returns `true` if the pinned certificate no longer exists
*/
function trust_remove_pinned_certificate(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): boolean;
/**
* Remove a pinned certificate for communication with `peer` for `purpose`.
*
* If the same pinned certificate does not exist, or was already removed,
* then this operation succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_remove_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
*/
function trust_remove_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Remove a pinned certificate for communication with `peer` for `purpose`.
*
* If the same pinned certificate does not exist, or was already removed,
* then this operation succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_remove_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_remove_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Remove a pinned certificate for communication with `peer` for `purpose`.
*
* If the same pinned certificate does not exist, or was already removed,
* then this operation succeeds without error.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.trust_remove_pinned_certificate_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param purpose the purpose string
* @param peer the peer for this pinned certificate
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
function trust_remove_pinned_certificate_async(certificate: Certificate, purpose: string, peer: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* {@link Gcr.trust_remove_pinned_certificate_async}.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns `true` if the pinned certificate no longer exists
*/
function trust_remove_pinned_certificate_finish(result: Gio.AsyncResult): boolean;
/**
* Flags to be used with the {@link Gcr.CertificateChain.build} operation.
* @gir-type Flags
*/
enum CertificateChainFlags {
/**
* no flags
*/
NONE,
/**
* If this flag is specified then no
* lookups for anchors or pinned certificates are done, and the resulting chain
* will be neither anchored or pinned. Additionally no missing certificate
* authorities are looked up in PKCS#11.
*/
NO_LOOKUPS,
}
/**
* @gir-type Flags
*/
enum CertificateSectionFlags {
NONE,
IMPORTANT,
}
namespace AccessDescription {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Describes a location for fetching extra information from the Certificate Authority.
*
* This object is usually part of a
* {@link Gcr.CertificateExtensionAuthorityInfoAccess} object.
* @gir-type Class
* @since 4.3.91
*/
class AccessDescription extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: AccessDescription.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the location, described by a {@link Gcr.GeneralName}.
* @returns the location
*/
get_location(): GeneralName;
/**
* Returns a user-friendly name of the method for accesssing the resource, if
* known.
* @returns A method name
*/
get_method_name(): string;
/**
* Returns the OID string that describes the method for accessing the resource.
* @returns The method OID
*/
get_method_oid(): string;
}
namespace CertificateChain {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::length": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
length: number;
}
}
/**
* Represents a chain of certificates, normally used to
* validate the trust in a certificate. An X.509 certificate chain has one
* endpoint certificate (the one for which trust is being verified) and then
* in turn the certificate that issued each previous certificate in the chain.
*
* This functionality is for building of certificate chains not for validating
* them. Use your favorite crypto library to validate trust in a certificate
* chain once its built.
*
* The order of certificates in the chain should be first the endpoint
* certificates and then the signing certificates.
*
* Create a new certificate chain with {@link CertificateChain.new} and then
* add the certificates with {@link CertificateChain.add}.
*
* You can then use {@link CertificateChain.build} to build the remainder of
* the chain. This will lookup missing certificates in PKCS#11 modules and
* also check that each certificate in the chain is the signer of the previous
* one. If a trust anchor, pinned certificate, or self-signed certificate is
* found, then the chain is considered built. Any extra certificates are
* removed from the chain.
*
* Once the certificate chain has been built, you can access its status
* through {@link CertificateChain.get_status}. The status signifies whether
* the chain is anchored on a trust root, self-signed, incomplete etc. See
* {@link CertificateChainStatus} for information on the various statuses.
*
* It's important to understand that the building of a certificate chain is
* merely the first step towards verifying trust in a certificate.
* @gir-type Class
*/
class CertificateChain extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The length of the certificate chain.
* @read-only
* @default 0
*/
get length(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateChain.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ["new"](): CertificateChain;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Add `certificate` to the chain. The order of certificates in the chain are
* important. The first certificate should be the endpoint certificate, and
* then come the signers (certificate authorities) each in turn. If a root
* certificate authority is present, it should come last.
*
* Adding a certificate an already built chain (see
* {@link Gcr.CertificateChain.build}) resets the type of the certificate chain
* to {@link Gcr.CertificateChainStatus.UNKNOWN}
* @param certificate a {@link Gcr.Certificate} to add to the chain
*/
add(certificate: Certificate): void;
/**
* Complete a certificate chain. Once a certificate chain has been built
* its status can be examined.
*
* This operation will lookup missing certificates in PKCS#11
* modules and also that each certificate in the chain is the signer of the
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
* is found, then the chain is considered built. Any extra certificates are
* removed from the chain.
*
* It's important to understand that building of a certificate chain does not
* constitute verifying that chain. This is merely the first step towards
* trust verification.
*
* The `purpose` is a string like `GCR_PURPOSE_CLIENT_AUTH` and is the purpose
* for which the certificate chain will be used. Trust anchors are looked up
* for this purpose. This argument is required.
*
* The `peer` is usually the host name of the peer whith which this certificate
* chain is being used. It is used to look up pinned certificates that have
* been stored for this peer. If `null` then no pinned certificates will
* be considered.
*
* If the {@link Gcr.CertificateChainFlags.NO_LOOKUPS} flag is specified then no
* lookups for anchors or pinned certificates are done, and the resulting chain
* will be neither anchored or pinned. Additionally no missing certificate
* authorities are looked up in PKCS#11
*
* This call will block, see {@link Gcr.CertificateChain.build_async} for the
* asynchronous version.
* @param purpose the purpose the certificate chain will be used for
* @param peer the peer the certificate chain will be used with, or `null`
* @param flags chain completion flags
* @param cancellable a {@link Gio.Cancellable} or `null`
* @returns whether the operation completed successfully
*/
build(purpose: string, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null): boolean;
/**
* Complete a certificate chain. Once a certificate chain has been built
* its status can be examined.
*
* This will lookup missing certificates in PKCS#11
* modules and also that each certificate in the chain is the signer of the
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
* is found, then the chain is considered built. Any extra certificates are
* removed from the chain.
*
* It's important to understand that building of a certificate chain does not
* constitute verifying that chain. This is merely the first step towards
* trust verification.
*
* The `purpose` is a string like `GCR_PURPOSE_CLIENT_AUTH` and is the purpose
* for which the certificate chain will be used. Trust anchors are looked up
* for this purpose. This argument is required.
*
* The `peer` is usually the host name of the peer whith which this certificate
* chain is being used. It is used to look up pinned certificates that have
* been stored for this peer. If `null` then no pinned certificates will
* be considered.
*
* If the {@link Gcr.CertificateChainFlags.NO_LOOKUPS} flag is specified then no
* lookups for anchors or pinned certificates are done, and the resulting chain
* will be neither anchored or pinned. Additionally no missing certificate
* authorities are looked up in PKCS#11
*
* When the operation is finished, `callback` will be called. You can then call
* `gcr_certificate_chain_build_finish()` to get the result of the operation.
* @param purpose the purpose the certificate chain will be used for
* @param peer the peer the certificate chain will be used with, or `null`
* @param flags chain completion flags
* @param cancellable a {@link Gio.Cancellable} or `null`
*/
build_async(purpose: string, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Complete a certificate chain. Once a certificate chain has been built
* its status can be examined.
*
* This will lookup missing certificates in PKCS#11
* modules and also that each certificate in the chain is the signer of the
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
* is found, then the chain is considered built. Any extra certificates are
* removed from the chain.
*
* It's important to understand that building of a certificate chain does not
* constitute verifying that chain. This is merely the first step towards
* trust verification.
*
* The `purpose` is a string like `GCR_PURPOSE_CLIENT_AUTH` and is the purpose
* for which the certificate chain will be used. Trust anchors are looked up
* for this purpose. This argument is required.
*
* The `peer` is usually the host name of the peer whith which this certificate
* chain is being used. It is used to look up pinned certificates that have
* been stored for this peer. If `null` then no pinned certificates will
* be considered.
*
* If the {@link Gcr.CertificateChainFlags.NO_LOOKUPS} flag is specified then no
* lookups for anchors or pinned certificates are done, and the resulting chain
* will be neither anchored or pinned. Additionally no missing certificate
* authorities are looked up in PKCS#11
*
* When the operation is finished, `callback` will be called. You can then call
* `gcr_certificate_chain_build_finish()` to get the result of the operation.
* @param purpose the purpose the certificate chain will be used for
* @param peer the peer the certificate chain will be used with, or `null`
* @param flags chain completion flags
* @param cancellable a {@link Gio.Cancellable} or `null`
* @param callback this will be called when the operation completes.
*/
build_async(purpose: string, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Complete a certificate chain. Once a certificate chain has been built
* its status can be examined.
*
* This will lookup missing certificates in PKCS#11
* modules and also that each certificate in the chain is the signer of the
* previous one. If a trust anchor, pinned certificate, or self-signed certificate
* is found, then the chain is considered built. Any extra certificates are
* removed from the chain.
*
* It's important to understand that building of a certificate chain does not
* constitute verifying that chain. This is merely the first step towards
* trust verification.
*
* The `purpose` is a string like `GCR_PURPOSE_CLIENT_AUTH` and is the purpose
* for which the certificate chain will be used. Trust anchors are looked up
* for this purpose. This argument is required.
*
* The `peer` is usually the host name of the peer whith which this certificate
* chain is being used. It is used to look up pinned certificates that have
* been stored for this peer. If `null` then no pinned certificates will
* be considered.
*
* If the {@link Gcr.CertificateChainFlags.NO_LOOKUPS} flag is specified then no
* lookups for anchors or pinned certificates are done, and the resulting chain
* will be neither anchored or pinned. Additionally no missing certificate
* authorities are looked up in PKCS#11
*
* When the operation is finished, `callback` will be called. You can then call
* `gcr_certificate_chain_build_finish()` to get the result of the operation.
* @param purpose the purpose the certificate chain will be used for
* @param peer the peer the certificate chain will be used with, or `null`
* @param flags chain completion flags
* @param cancellable a {@link Gio.Cancellable} or `null`
* @param callback this will be called when the operation completes.
*/
build_async(purpose: string, peer: string | null, flags: CertificateChainFlags, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finishes an asynchronous operation started by
* `gcr_certificate_chain_build_async()`.
* @param result the {@link Gio.AsyncResult} passed to the callback
* @returns whether the operation succeeded
*/
build_finish(result: Gio.AsyncResult): boolean;
/**
* If the certificate chain has been built and is of status
* {@link Gcr.CertificateChainStatus.ANCHORED}, then this will return the anchor
* certificate that was found. This is not necessarily a root certificate
* authority. If an intermediate certificate authority in the chain was
* found to be anchored, then that certificate will be returned.
*
* If an anchor is returned it does not mean that the certificate chain has
* been verified, but merely that an anchor has been found.
* @returns the anchor certificate, or `null` if not anchored.
*/
get_anchor(): Certificate;
/**
* Get a certificate in the chain. It is an error to call this function
* with an invalid index.
* @param index index of the certificate to get
* @returns the certificate
*/
get_certificate(index: number): Certificate;
/**
* Get the endpoint certificate in the chain. This is always the first
* certificate in the chain. The endpoint certificate cannot be anchored.
* @returns the endpoint certificate, or `null` if the chain is empty
*/
get_endpoint(): Certificate;
/**
* Get the length of the certificate chain.
* @returns the length of the certificate chain
*/
get_length(): number;
/**
* Get the status of a certificate chain. If the certificate chain has not
* been built, then the status will be {@link Gcr.CertificateChainStatus.UNKNOWN}.
*
* A status of {@link Gcr.CertificateChainStatus.ANCHORED} does not mean that the
* certificate chain has been verified, but merely that an anchor has been
* found.
* @returns the status of the certificate chain.
*/
get_status(): CertificateChainStatus;
}
namespace CertificateExtension {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
critical: boolean;
oid: string;
value: GLib.Bytes | Uint8Array;
}
}
/**
* An object that describes a certificate extension.
*
* By default, a certificate extension exposes 3 things: an OID,
* whether it's marked as critical, and the raw value.
*
* For known extensions, gcr tries to provide subclasses with the appropriate
* API.
*
* See also {@link Certificate.list_extensions}.
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtension extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether this certificate is critical.
* @construct-only
* @default false
*/
get critical(): boolean;
/**
* The Object Identifier (OID) that identifies the extension.
* @read-only
* @default null
*/
get oid(): string;
/**
* The raw value in bytes of the extension.
* @construct-only
*/
get value(): GLib.Bytes;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtension.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-displayable description of the OID that identifies the
* extension, if known.
* @returns A user-facing description, or `null` if unknown
*/
get_description(): string | null;
/**
* Returns the OID that identifies the extension
*/
get_oid(): string;
/**
* Returns the raw value in bytes of the extension.
* @returns The raw value date
*/
get_value(): GLib.Bytes;
/**
* Returns wether the certificate extension is marked critical.
* @returns `true` if the extension is marked critical
*/
is_critical(): boolean;
}
namespace CertificateExtensionAuthorityInfoAccess {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::n-items": (pspec: GObject.ParamSpec) => void;
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps, Gio.ListModel.ConstructorProps {
n_items: number;
nItems: number;
}
}
/**
* A certificate extension describing the Authority Information Access (AIA).
*
* This extensions specifies a list of resources of a certificate's issuer that
* one may use to retrieve extra information, such as missing intermediate
* certificates in a certificate chain, or to determine certifiate revocation
* status.
*
* Each access point is exposed as a {@link Gcr.AccessDescription} object.
* @gir-type Class
* @since 4.3.91
*/
class CertificateExtensionAuthorityInfoAccess extends CertificateExtension implements Gio.ListModel {
static $gtype: GObject.GType;
// Properties
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get n_items(): number;
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get nItems(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionAuthorityInfoAccess.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the description at a given position
* @param position
* @returns The description at position `position`
*/
get_description(position: number): AccessDescription;
/**
* @param args
*/
// Conflicted with Gcr.CertificateExtension.get_description
get_description(...args: never[]): any;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificateExtensionAuthorityKeyIdentifier {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps {}
}
/**
* A certificate extension that contains the authority key identifier (SKI).
*
* This extension may expose the authority key identifier directly, which
* should match the subject key identifier of the parent certificate.
*
* It _may_ also expose a combination of issuer name and serial number of the
* used certificate instead. This is rare however.
* @gir-type Class
* @since 4.3.91
*/
class CertificateExtensionAuthorityKeyIdentifier extends CertificateExtension {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionAuthorityKeyIdentifier.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the issuer, described by a list of {@link Gcr.GeneralName}s.
* @returns The names of issuer, if set
*/
get_authority_cert_issuer(): GeneralNames | null;
/**
* Returns the serial number of the certificate that was used to sign this
* certificate.
* @returns The serial number, if set
*/
get_authority_cert_serial_number(): GLib.Bytes | null;
/**
* Returns the raw bytes containing the authority key identifier, if present.
* @returns The authority key identifier if present.
*/
get_key_id(): GLib.Bytes | null;
}
namespace CertificateExtensionBasicConstraints {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps {}
}
/**
* A certificate extension that can be used to identify the type of the
* certificate subject (whether it is a certificate authority or not).
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionBasicConstraints extends CertificateExtension {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionBasicConstraints.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the maximum number of CAs that are allowed in the chain below this
* certificate.
*
* If this is not set, this method returns -1.
*
* Note that this field doesn't really make sense if
* {@link Gcr.CertificateExtensionBasicConstraints.is_ca} is false.
* @returns The value of "pathLenConstraint", or -1 if not set.
*/
get_path_len_constraint(): number;
/**
* Returns whether the certificate us a certificate authority (CA) certificate
* or an end entity certificate.
* @returns The value of "cA".
*/
is_ca(): boolean;
}
namespace CertificateExtensionCertificatePolicies {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::n-items": (pspec: GObject.ParamSpec) => void;
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps, Gio.ListModel.ConstructorProps {
n_items: number;
nItems: number;
}
}
/**
* A certificate extension that lists certificate policies.
*
* Each certificate policy is exposed as a {@link Gcr.CertificatePolicy}
* object.
* @gir-type Class
* @since 4.3.91
*/
class CertificateExtensionCertificatePolicies extends CertificateExtension implements Gio.ListModel {
static $gtype: GObject.GType;
// Properties
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get n_items(): number;
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get nItems(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionCertificatePolicies.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the policy at a given position
* @param position
* @returns The policy at position `position`
*/
get_policy(position: number): CertificatePolicy;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificateExtensionCrlDistributionPoints {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::n-items": (pspec: GObject.ParamSpec) => void;
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps, Gio.ListModel.ConstructorProps {
n_items: number;
nItems: number;
}
}
/**
* A certificate extension that lists CRL distribution points.
*
* Each distribution point is exposed as a {@link Gcr.DistributionPoint}
* object.
* @gir-type Class
* @since 4.3.91
*/
class CertificateExtensionCrlDistributionPoints extends CertificateExtension implements Gio.ListModel {
static $gtype: GObject.GType;
// Properties
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get n_items(): number;
/**
* The number of items. See {@link Gio.ListModel.get_n_items}.
* @read-only
* @default 0
*/
get nItems(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionCrlDistributionPoints.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the CRL distribution point at a given position.
*
* It is illegal to call this on an invalid position.
* @param position
* @returns The distribution point at position `position`
*/
get_distribution_point(position: number): DistributionPoint;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificateExtensionExtendedKeyUsage {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps {}
}
/**
* A certificate extension that can be used to restrict an extended set of
* usages of a given certificate.
*
* Similar to {@link Gcr.CertificateExtensionKeyUsage}, this extension defined
* an additional set of purposes for which this certificate may be used.
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionExtendedKeyUsage extends CertificateExtension {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionExtendedKeyUsage.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-friendly list of description of the key usages.
* @returns The descriptions.
*/
get_descriptions(): string[];
/**
* Returns the list of OIDs of the extended key usages.
* @returns The OIDs.
*/
get_oids(): string[];
}
namespace CertificateExtensionKeyUsage {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps {}
}
/**
* A certificate extension that can be used to restrict the usages of a given
* certificate.
*
* See also {@link Gcr.CertificateExtensionExtendedKeyUsage} for an additional
* set of usages.
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionKeyUsage extends CertificateExtension {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionKeyUsage.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-friendly list of description of the key usages.
* @returns The descriptions.
*/
get_descriptions(): string[];
/**
* Returns the bit string describing the usages.
*/
get_usages(): number;
}
namespace CertificateExtensionList {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::n-items": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.ListModel.ConstructorProps {
n_items: number;
nItems: number;
}
}
/**
* A wrapper type for a list of {@link CertificateExtension}s.
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionList extends GObject.Object implements Gio.ListModel {
static $gtype: GObject.GType;
// Properties
/**
* @read-only
* @default 0
*/
get n_items(): number;
/**
* @read-only
* @default 0
*/
get nItems(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionList.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Looks for an extension with the given OID.
* @param oid The OID of the certificate extension
* @returns The certificate extension with the given OID, or `null` if not found.
*/
find_by_oid(oid: string): CertificateExtension | null;
/**
* Returns the extension at the given position.
*
* It is illegal to call this function with an invalid position.
* @param position The position of the extension in the list
* @returns The certificate extension with the given OID
*/
get_extension(position: number): CertificateExtension;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificateExtensionSubjectAltName {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps, Gio.ListModel.ConstructorProps {}
}
/**
* A certificate extension describing the Subject Alternative Name (SAN).
*
* This kind of extension is used for example to specify multiple domains for
* the same certificate.
*
* The object exposes the different names with the {@link Gio.ListModel} API.
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionSubjectAltName extends CertificateExtension implements Gio.ListModel {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionSubjectAltName.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the name at the given position.
* @param position The position of the name
* @returns The name at position `position`
*/
get_name(position: number): GeneralName;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificateExtensionSubjectKeyIdentifier {
// Signal signatures
interface SignalSignatures extends CertificateExtension.SignalSignatures {
"notify::critical": (pspec: GObject.ParamSpec) => void;
"notify::oid": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends CertificateExtension.ConstructorProps {}
}
/**
* A certificate extension that contains the subject key identifier (SKI).
* @gir-type Class
* @since 4.3.90
*/
class CertificateExtensionSubjectKeyIdentifier extends CertificateExtension {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateExtensionSubjectKeyIdentifier.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the raw bytes containing the subject key identifier.
* @returns The subject key identifier.
*/
get_key_id(): GLib.Bytes;
}
namespace CertificateField {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::label": (pspec: GObject.ParamSpec) => void;
"notify::section": (pspec: GObject.ParamSpec) => void;
"notify::value": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
label: string;
section: CertificateSection;
value: GObject.Value | any;
}
}
/**
* @gir-type Class
*/
class CertificateField extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* @construct-only
* @default null
*/
get label(): string;
/**
* @construct-only
*/
get section(): CertificateSection;
/**
* @read-only
*/
get value(): unknown;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateField.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Get the display label of the field.
* @returns the display label of the field
*/
get_label(): string;
/**
* Get the parent {@link Gcr.CertificateSection}.
* @returns the parent {@link Gcr.CertificateSection}
*/
get_section(): CertificateSection;
/**
* Get the value of the field.
*
* The `value` will have been initialized to the {@link GObject.GType} the value should be
* provided in.
* @returns `true` if the value was set successfully.
*/
get_value(): [boolean, unknown];
/**
* Get the type associated with the value.
* @returns The {@link GObject.GType} of the value
*/
get_value_type(): GObject.GType;
}
namespace CertificatePolicy {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.ListModel.ConstructorProps {}
}
/**
* An object describing a certificate policy.
*
* These policies are listed as part of a
* {@link Gcr.CertificateExtensionCertificatePolicies} object.
*
* A policy can optionally also include qualifiers, which are exposed through
* the {@link Gio.ListModel} API.
* @gir-type Class
* @since 4.3.91
*/
class CertificatePolicy extends GObject.Object implements Gio.ListModel {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificatePolicy.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-friendly name of this certificate policy, if known.
* @returns A name describing the policy OID
*/
get_name(): string;
/**
* Returns the OID string that describes this certificate policy.
* @returns The policy OID
*/
get_oid(): string;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace CertificatePolicyQualifier {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* An object describing a certificate policy qualifier.
*
* These policies are (optionally) part of a {@link Gcr.CertificatePolicy}
* object.
* @gir-type Class
* @since 4.3.91
*/
class CertificatePolicyQualifier extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificatePolicyQualifier.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-friendly name of this certificate policy qualifier, if known.
* @returns A name describing the policy qualifier OID
*/
get_name(): string;
/**
* Returns the OID string that describes this certificate policy qualifier.
* @returns The policy qualifier OID
*/
get_oid(): string;
}
namespace CertificateRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::private-key": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
private_key: Gck.Object;
privateKey: Gck.Object;
}
}
/**
* An object that allows creation of certificate requests. A certificate
* request is sent to a certificate authority to request an X.509 certificate.
*
* Use {@link CertificateRequest.prepare} to create a blank certificate
* request for a given private key. Set the common name on the certificate
* request with {@link CertificateRequest.set_cn}, and then sign the request
* with {@link CertificateRequest.complete_async}.
* @gir-type Class
*/
class CertificateRequest extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The private key that this certificate request is for.
* @construct-only
*/
get private_key(): Gck.Object;
/**
* The private key that this certificate request is for.
* @construct-only
*/
get privateKey(): Gck.Object;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Static methods
/**
* Check whether {@link CertificateRequest} is capable of creating a request
* for the given `private_key`.
* @param private_key a private key
* @param cancellable cancellation object
*/
static capable(private_key: Gck.Object, cancellable: Gio.Cancellable | null): boolean;
/**
* Asynchronously check whether {@link CertificateRequest} is capable of
* creating a request for the given `private_key`.
* @param private_key a private key
* @param cancellable cancellation object
* @param callback will be called when the operation completes
*/
static capable_async(private_key: Gck.Object, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Get the result for asynchronously check whether {@link CertificateRequest} is
* capable of creating a request for the given `private_key`.
* @param result asynchronous result
*/
static capable_finish(result: Gio.AsyncResult): boolean;
/**
* Create a new certificate request, in the given format for the private key.
* @param format the format for the certificate request
* @param private_key the private key the the certificate is being requested for
*/
static prepare(format: CertificateRequestFormat, private_key: Gck.Object): CertificateRequest;
// Methods
/**
* Complete and sign a certificate request, so that it can be encoded
* and sent to a certificate authority.
*
* This call may block as it signs the request using the private key.
* @param cancellable a cancellation object
* @returns whether certificate request was successfully completed or not
*/
complete(cancellable: Gio.Cancellable | null): boolean;
/**
* Asynchronously complete and sign a certificate request, so that it can
* be encoded and sent to a certificate authority.
*
* This call will return immediately and complete later.
* @param cancellable a cancellation object
*/
complete_async(cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously complete and sign a certificate request, so that it can
* be encoded and sent to a certificate authority.
*
* This call will return immediately and complete later.
* @param cancellable a cancellation object
* @param callback called when the operation completes
*/
complete_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously complete and sign a certificate request, so that it can
* be encoded and sent to a certificate authority.
*
* This call will return immediately and complete later.
* @param cancellable a cancellation object
* @param callback called when the operation completes
*/
complete_async(cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Finish an asynchronous operation to complete and sign a certificate
* request.
* @param result result of the asynchronous operation
* @returns whether certificate request was successfully completed or not
*/
complete_finish(result: Gio.AsyncResult): boolean;
/**
* Encode the certificate request. It must have been completed with
* {@link CertificateRequest.complete} or
* {@link CertificateRequest.complete_async}.
*
* If `textual` is `false`, the output is a DER encoded certificate request.
*
* If `textual` is `true`, the output is encoded as text. For PKCS#10 requests
* this is done using the OpenSSL style PEM encoding.
* @param textual whether to encode output as text
* @returns the encoded certificate request
*/
encode(textual: boolean): Uint8Array;
/**
* Get the format of this certificate request.
* @returns the format
*/
get_format(): CertificateRequestFormat;
/**
* Get the private key this certificate request is for.
* @returns the private key,
*/
get_private_key(): Gck.Object;
/**
* Set the common name encoded in the certificate request.
* @param cn common name to set on the request
*/
set_cn(cn: string): void;
}
namespace CertificateSection {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::fields": (pspec: GObject.ParamSpec) => void;
"notify::label": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
fields: Gio.ListModel;
label: string;
}
}
/**
* @gir-type Class
*/
class CertificateSection extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* @read-only
*/
get fields(): Gio.ListModel;
/**
* @construct-only
* @default null
*/
get label(): string;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CertificateSection.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Get the list of all the fields in this section.
* @returns a {@link Gio.ListModel} of {@link Gcr.CertificateField}
*/
get_fields(): Gio.ListModel;
/**
* Get the flags.
* @returns the {@link Gcr.CertificateSectionFlags}
*/
get_flags(): CertificateSectionFlags;
/**
* Get the displayable label of the section.
* @returns the displayable label of the section
*/
get_label(): string;
}
namespace DistributionPoint {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* An object describing a CRL distribution point.
*
* A certificate user can use such a Certifiate Revocation List (CLR)
* distribution point to check if the certificate has been revoked.
*
* These distribution poitns are for example listed as part of a
* {@link Gcr.CertificateExtensionCrlDistributionPoints} object.
* @gir-type Class
* @since 4.3.91
*/
class DistributionPoint extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: DistributionPoint.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the full name of the CRL distribution point, if set.
* @returns The full name of the distribution point
*/
get_full_name(): GeneralNames | null;
/**
* Returns a part of the relative name of `self`, if set.
*
* Note that the relative name might not be set, nor the specific part.
*
* Examples of a `part` might be the 'OU' (organizational unit) or the 'CN'
* (common name). Only the value of that part of the RDN is returned.
* @param part a RDN type string or OID.
* @returns The relative name part if set, or NULL
*/
get_relative_name_part(part: string): string | null;
}
namespace GeneralName {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* An object describing a name as part of the Subject Alternative Name (SAN)
* extension.
* @gir-type Class
* @since 4.3.90
*/
class GeneralName extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: GeneralName.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns a user-friendly string describing the name.
*/
get_description(): string;
/**
* Returns the actual value of the name.
*/
get_value(): string;
/**
* Returns the raw bytes describing the value of the name.
*/
get_value_raw(): GLib.Bytes;
}
namespace GeneralNames {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.ListModel.ConstructorProps {}
}
/**
* A list of {@link Gcr.GeneralName}s.
* @gir-type Class
* @since 4.3.91
*/
class GeneralNames extends GObject.Object implements Gio.ListModel {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: GeneralNames.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the name at the given position.
*
* It is illegal to call this function with a position larger than the number
* of elements in this list.
* @param position The position in the list
* @returns The name at the given position
*/
get_name(position: number): GeneralName;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @returns the {@link GObject.GType} of the items contained in `list`.
*/
get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @returns the number of items in `list`.
*/
get_n_items(): number;
/**
* Get the item at `position`.
*
* If `position` is greater than the number of items in `list`, `null` is
* returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list.
*
* This function is meant to be used by language bindings in place
* of `g_list_model_get_item()`.
*
* See also: `g_list_model_get_n_items()`
* @param position the position of the item to fetch
* @returns the object at `position`.
*/
get_item(position: number): A | null;
/**
* Emits the {@link Gio.ListModel.SignalSignatures.items_changed | Gio.ListModel::items-changed} signal on `list`.
*
* This function should only be called by classes implementing
* {@link Gio.ListModel}. It has to be called after the internal representation
* of `list` has been updated, because handlers connected to this signal
* might query the new state of the list.
*
* Implementations must only make changes to the model (as visible to
* its consumer) in places that will not cause problems for that
* consumer. For models that are driven directly by a write API (such
* as {@link Gio.ListStore}), changes can be reported in response to uses of that
* API. For models that represent remote data, changes should only be
* made from a fresh mainloop dispatch. It is particularly not
* permitted to make changes in response to a call to the {@link Gio.ListModel}
* consumer API.
*
* Stated another way: in general, it is assumed that code making a
* series of accesses to the model via the API, without returning to the
* mainloop, and without calling other code, will continue to view the
* same contents of the model.
* @param position the position at which `list` changed
* @param removed the number of items removed
* @param added the number of items added
*/
items_changed(position: number, removed: number, added: number): void;
/**
* Get the item at `position`. If `position` is greater than the number of
* items in `list`, `null` is returned.
*
* `null` is never returned for an index that is smaller than the length
* of the list. See `g_list_model_get_n_items()`.
*
* The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
* @param position the position of the item to fetch
* @virtual
*/
vfunc_get_item(position: number): A | null;
/**
* Gets the type of the items in `list`.
*
* All items returned from `g_list_model_get_item()` are of the type
* returned by this function, or a subtype, or if the type is an
* interface, they are an implementation of that interface.
*
* The item type of a {@link Gio.ListModel} can not change during the life of the
* model.
* @virtual
*/
vfunc_get_item_type(): GObject.GType;
/**
* Gets the number of items in `list`.
*
* Depending on the model implementation, calling this function may be
* less efficient than iterating the list with increasing values for
* `position` until `g_list_model_get_item()` returns `null`.
* @virtual
*/
vfunc_get_n_items(): number;
}
namespace Parser {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
/**
* This signal is emitted when an item needs to be unlocked or decrypted before
* it can be parsed. The `count` argument specifies the number of times
* the signal has been emitted for a given item. This can be used to
* display a message saying the previous password was incorrect.
*
* Typically the `gcr_parser_add_password()` function is called in
* response to this signal.
*
* If `false` is returned, then the authentication was not handled. If
* no handlers return `true` then the item is not parsed and an error
* with the code {@link Gcr.DataError.CANCELLED} will be raised.
* @signal
* @run-last
*/
authenticate: (arg0: number) => boolean | void;
/**
* This signal is emitted when an item is sucessfully parsed. To access
* the information about the item use the `gcr_parser_get_parsed_label()`,
* `gcr_parser_get_parsed_attributes()` and `gcr_parser_get_parsed_description()`
* functions.
* @signal
* @run-first
*/
parsed: () => void;
"notify::parsed-attributes": (pspec: GObject.ParamSpec) => void;
"notify::parsed-description": (pspec: GObject.ParamSpec) => void;
"notify::parsed-label": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
parsed_attributes: Gck.Attributes | null;
parsedAttributes: Gck.Attributes | null;
parsed_description: string | null;
parsedDescription: string | null;
parsed_label: string | null;
parsedLabel: string | null;
}
}
/**
* A parser for parsing various types of files or data.
*
* A {@link Gcr.Parser} can parse various certificate and key files such as OpenSSL
* PEM files, DER encoded certifictes, PKCS#8 keys and so on. Each various
* format is identified by a value in the {@link DataFormat} enumeration.
*
* In order to parse data, a new parser is created with {@link Parser.new} and
* then the `Gcr.Parser::authenticate` and `Gcr.Parser::parsed` signals
* should be connected to. Data is then fed to the parser via
* {@link Parser.parse_data} or {@link Parser.parse_stream}.
*
* During the `Gcr.Parser::parsed` signal the attributes that make up the
* currently parsed item can be retrieved using the
* {@link Parser.get_parsed_attributes} function.
* @gir-type Class
*/
class Parser extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Get the attributes that make up the currently parsed item. This is
* generally only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsed_attributes(): Gck.Attributes | null;
/**
* Get the attributes that make up the currently parsed item. This is
* generally only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsedAttributes(): Gck.Attributes | null;
/**
* The description of the type of the currently parsed item. This is generally
* only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsed_description(): string | null;
/**
* The description of the type of the currently parsed item. This is generally
* only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsedDescription(): string | null;
/**
* The label of the currently parsed item. This is generally
* only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsed_label(): string | null;
/**
* The label of the currently parsed item. This is generally
* only valid during a `Gcr.Parser::parsed` signal.
* @read-only
*/
get parsedLabel(): string | null;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Parser.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ["new"](): Parser;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Virtual methods
/**
* The default handler for the authenticate signal.
* @param count
* @virtual
*/
vfunc_authenticate(count: number): boolean;
/**
* The default handler for the parsed signal.
* @virtual
*/
vfunc_parsed(): void;
// Methods
/**
* Add a password to the set of passwords to try when parsing locked or encrypted
* items. This is usually called from the `Gcr.Parser::authenticate` signal.
* @param password a password to try
*/
add_password(password: string | null): void;
/**
* Disable parsing of the given format. Use {@link Gcr.DataFormat.ALL} to disable all the formats.
* @param format The format identifier
*/
format_disable(format: DataFormat): void;
/**
* Enable parsing of the given format. Use {@link Gcr.DataFormat.ALL} to enable all the formats.
* @param format The format identifier
*/
format_enable(format: DataFormat): void;
/**
* Check whether the given format is supported by the parser.
* @param format The format identifier
* @returns Whether the format is supported.
*/
format_supported(format: DataFormat): boolean;
/**
* Get the filename of the parser item.
* @returns the filename set on the parser, or `null`
*/
get_filename(): string;
/**
* Get the currently parsed item
* @returns the currently parsed item
*/
get_parsed(): Parsed;
/**
* Get the attributes which make up the currently parsed item. This is generally
* only valid during the `Gcr.Parser::parsed` signal.
* @returns the attributes for the current item, which are owned by the parser and should not be freed
*/
get_parsed_attributes(): Gck.Attributes | null;
/**
* Get the raw data block that represents this parsed object. This is only
* valid during the `Gcr.Parser::parsed` signal.
* @returns the raw data block of the currently parsed item; the value is owned by the parser and should not be freed
*/
get_parsed_block(): Uint8Array | null;
/**
* Get the raw data block that represents this parsed object. This is only
* valid during the `Gcr.Parser::parsed` signal.
* @returns the raw data block of the currently parsed item
*/
get_parsed_bytes(): GLib.Bytes;
/**
* Get a description for the type of the currently parsed item. This is generally
* only valid during the `Gcr.Parser::parsed` signal.
* @returns the description for the current item; this is owned by the parser and should not be freed
*/
get_parsed_description(): string | null;
/**
* Get the format of the raw data block that represents this parsed object.
* This corresponds with the data returned from
* {@link Parser.get_parsed_block}.
*
* This is only valid during the `Gcr.Parser::parsed` signal.
* @returns the data format of the currently parsed item
*/
get_parsed_format(): DataFormat;
/**
* Get the label of the currently parsed item. This is generally only valid
* during the `Gcr.Parser::parsed` signal.
* @returns the label of the currently parsed item. The value is owned by the parser and should not be freed.
*/
get_parsed_label(): string | null;
/**
* Parse the data. The `Gcr.Parser::parsed` and
* `Gcr.Parser::authenticate` signals may fire during the parsing.
* @param data the data to parse
* @returns Whether the data was parsed successfully or not.
*/
parse_bytes(data: GLib.Bytes | Uint8Array): boolean;
/**
* Parse the data. The `Gcr.Parser::parsed` and `Gcr.Parser::authenticate`
* signals may fire during the parsing.
*
* A copy of the data will be made. Use {@link Parser.parse_bytes} to avoid
* this.
* @param data the data to parse
* @returns Whether the data was parsed successfully or not.
*/
parse_data(data: Uint8Array | string): boolean;
/**
* Parse items from the data in a {@link Gio.InputStream}. This function may block while
* reading from the input stream. Use {@link Parser.parse_stream_async} for
* a non-blocking variant.
*
* The `Gcr.Parser::parsed` and `Gcr.Parser::authenticate` signals
* may fire during the parsing.
* @param input The input stream
* @param cancellable An optional cancellation object
* @returns Whether the parsing completed successfully or not.
*/
parse_stream(input: Gio.InputStream, cancellable: Gio.Cancellable | null): boolean;
/**
* Parse items from the data in a {@link Gio.InputStream}. This function completes
* asyncronously and doesn't block.
*
* The `Gcr.Parser::parsed` and `Gcr.Parser::authenticate` signals
* may fire during the parsing.
* @param input The input stream
* @param cancellable An optional cancellation object
*/
parse_stream_async(input: Gio.InputStream, cancellable: Gio.Cancellable | null): globalThis.Promise;
/**
* Parse items from the data in a {@link Gio.InputStream}. This function completes
* asyncronously and doesn't block.
*
* The `Gcr.Parser::parsed` and `Gcr.Parser::authenticate` signals
* may fire during the parsing.
* @param input The input stream
* @param cancellable An optional cancellation object
* @param callback Called when the operation result is ready.
*/
parse_stream_async(input: Gio.InputStream, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Parse items from the data in a {@link Gio.InputStream}. This function completes
* asyncronously and doesn't block.
*
* The `Gcr.Parser::parsed` and `Gcr.Parser::authenticate` signals
* may fire during the parsing.
* @param input The input stream
* @param cancellable An optional cancellation object
* @param callback Called when the operation result is ready.
*/
parse_stream_async(input: Gio.InputStream, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): globalThis.Promise | void;
/**
* Complete an operation to parse a stream.
* @param result The operation result
* @returns Whether the parsing completed successfully or not.
*/
parse_stream_finish(result: Gio.AsyncResult): boolean;
/**
* Sets the filename of the parser item.
* @param filename a string of the filename of the parser item
*/
set_filename(filename: string | null): void;
}
namespace Pkcs11Certificate {
// Signal signatures
interface SignalSignatures extends Gck.Object.SignalSignatures {
"notify::attributes": (pspec: GObject.ParamSpec) => void;
"notify::handle": (pspec: GObject.ParamSpec) => void;
"notify::module": (pspec: GObject.ParamSpec) => void;
"notify::session": (pspec: GObject.ParamSpec) => void;
"notify::description": (pspec: GObject.ParamSpec) => void;
"notify::expiry-date": (pspec: GObject.ParamSpec) => void;
"notify::issuer-name": (pspec: GObject.ParamSpec) => void;
"notify::label": (pspec: GObject.ParamSpec) => void;
"notify::subject-name": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends Gck.Object.ConstructorProps, Certificate.ConstructorProps {
attributes: Gck.Attributes;
}
}
/**
* A certificate loaded from a PKCS#11 storage.
* It is also a valid {@link Gck.Object} and can be used as such.
*
* Use {@link Gcr.Pkcs11Certificate.lookup_issuer} to lookup the issuer of a
* given certificate in the PKCS#11 store.
*
* Various common PKCS#11 certificate attributes are automatically loaded and
* are available via {@link Gcr.Pkcs11Certificate.get_attributes}.
* @gir-type Class
*/
class Pkcs11Certificate extends Gck.Object implements Certificate {
static $gtype: GObject.GType;
// Properties
/**
* Automatically loaded attributes for this certificate.
* @construct-only
*/
get attributes(): Gck.Attributes;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Pkcs11Certificate.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Static methods
/**
* Lookup a the issuer of a `certificate` in the PKCS#11 storage. The
* lookup is done using the issuer DN of the certificate. No certificate chain
* verification is done. Use a crypto library to make trust decisions.
*
* This call may block, see {@link Gcr.Pkcs11Certificate.lookup_issuer} for the
* non-blocking version.
*
* Will return `null` if no issuer certificate is found. Use `error` to determine
* if an error occurred.
* @param certificate a {@link Gcr.Certificate}
* @param cancellable a cancellable
*/
static lookup_issuer(certificate: Certificate, cancellable: Gio.Cancellable | null): Certificate | null;
/**
* Lookup a the issuer of a `certificate` in the PKCS#11 storage. The
* lookup is done using the issuer DN of the certificate. No certificate chain
* verification is done. Use a crypto library to make trust decisions.
*
* When the operation is finished, callback will be called. You can then call
* {@link Gcr.Pkcs11Certificate.lookup_issuer_finish} to get the result of the
* operation.
* @param certificate a {@link Gcr.Certificate}
* @param cancellable a cancellable
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
static lookup_issuer_async(certificate: Certificate, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Finishes an asynchronous operation started by
* {@link Gcr.Pkcs11Certificate.lookup_issuer_async}.
*
* Will return `null` if no issuer certificate is found. Use `error` to determine
* if an error occurred.
* @param result the {@link Gio.AsyncResult} passed to the callback
*/
static lookup_issuer_finish(result: Gio.AsyncResult): Certificate | null;
/**
* Lookup a certificate in the PKCS#11 storage by the given URI.
*
* This call may block, see `gcr_pkcs11_certificate_new_from_uri_async()` for
* the non-blocking version.
*
* Will return `null` if no certificate is found. Use `error` to determine
* if an error occurred.
* @param pkcs11_uri a A PKCS \#11 URI
* @param cancellable a {@link Gio.Cancellable}
*/
static new_from_uri(pkcs11_uri: string, cancellable: Gio.Cancellable | null): Certificate | null;
/**
* Lookup a certificate in the PKCS#11 storage by the given URI.
*
* When the operation is finished, callback will be called. You can then call
* `gcr_pkcs11_certificate_new_from_uri_finish()` to get the result of the
* operation.
* @param pkcs11_uri a A PKCS \#11 URI
* @param cancellable a {@link Gio.Cancellable}
* @param callback a {@link Gio.AsyncReadyCallback} to call when the operation completes
*/
static new_from_uri_async(pkcs11_uri: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Finishes an asynchronous operation started by
* `gcr_pkcs11_certificate_new_from_uri_async()`.
*
* Will return `null` if no certificate is found. Use `error` to determine
* if an error occurred.
* @param result the {@link Gio.AsyncResult} passed to the callback
*/
static new_from_uri_finish(result: Gio.AsyncResult): Certificate | null;
// Methods
/**
* Access the automatically loaded attributes for this certificate.
* @returns the certificate attributes
*/
get_attributes(): Gck.Attributes;
/**
* A readable description for this certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get description(): string;
/**
* The expiry date of the certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get expiry_date(): GLib.DateTime | null;
/**
* The expiry date of the certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get expiryDate(): GLib.DateTime | null;
/**
* Common name part of the certificate issuer
* @read-only
* @category Inherited from Gcr.Certificate
*/
get issuer_name(): string | null;
/**
* Common name part of the certificate issuer
* @read-only
* @category Inherited from Gcr.Certificate
*/
get issuerName(): string | null;
/**
* A readable label for this certificate.
* @read-only
* @category Inherited from Gcr.Certificate
*/
get label(): string;
/**
* @read-only
* @category Inherited from Gcr.Certificate
*/
get subject_name(): string | null;
/**
* @read-only
* @category Inherited from Gcr.Certificate
*/
get subjectName(): string | null;
/**
* Get the basic constraints for the certificate if present. If `false` is
* returned then no basic constraints are present and the `is_ca` and
* `path_len` arguments are not changed.
* @returns whether basic constraints are present or not
*/
get_basic_constraints(): [boolean, boolean, number];
/**
* Gets the raw DER data for an X.509 certificate.
* @returns raw DER data of the X.509 certificate
*/
get_der_data(): Uint8Array;
/**
* Get the expiry date of this certificate.
* @returns An expiry date of this certificate.
*/
get_expiry_date(): GLib.DateTime | null;
/**
* Calculate the fingerprint for this certificate.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @param type the type of algorithm for the fingerprint.
* @returns the raw binary fingerprint
*/
get_fingerprint(type: GLib.ChecksumType): Uint8Array | null;
/**
* Calculate the fingerprint for this certificate, and return it
* as a hex string.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @param type the type of algorithm for the fingerprint.
* @returns an allocated hex string which contains the fingerprint.
*/
get_fingerprint_hex(type: GLib.ChecksumType): string | null;
/**
* Get the list of sections from the certificate that can be shown to the user
* interface.
* @returns A {@link GLib.List} of {@link Gcr.CertificateSection}
*/
get_interface_elements(): CertificateSection[];
/**
* Get the issued date of this certificate.
* @returns A issued date of this certificate.
*/
get_issued_date(): GLib.DateTime | null;
/**
* Get the common name of the issuer of this certificate.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated issuer CN, or `null` if no issuer CN present.
*/
get_issuer_cn(): string | null;
/**
* Get the full issuer DN of the certificate as a (mostly)
* readable string.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated issuer DN of the certificate.
*/
get_issuer_dn(): string | null;
/**
* Get a name to represent the issuer of this certificate.
*
* This will try to lookup the common name, orianizational unit,
* organization in that order.
* @returns the allocated issuer name, or `null` if no issuer name
*/
get_issuer_name(): string | null;
/**
* Get a part of the DN of the issuer of this certificate.
*
* Examples of a `part` might be the 'OU' (organizational unit)
* or the 'CN' (common name). Only the value of that part
* of the DN is returned.
*
* The string returned should be freed by the caller when no longer
* required.
* @param part a DN type string or OID.
* @returns the allocated part of the issuer DN, or `null` if no such part is present
*/
get_issuer_part(part: string): string | null;
/**
* Get the raw DER data for the issuer DN of the certificate.
*
* The data should be freed by using `g_free()` when no longer required.
* @returns allocated memory containing the raw issuer
*/
get_issuer_raw(): Uint8Array | null;
/**
* Get the key size in bits of the public key represented
* by this certificate.
* @returns The key size of the certificate.
*/
get_key_size(): number;
/**
* Returns the subject public key info (SPKI) of the certificate.
* @returns The SPKI of the certificate.
*/
get_public_key_info(): SubjectPublicKeyInfo;
/**
* Get the raw binary serial number of the certificate.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @returns the raw binary serial number.
*/
get_serial_number(): Uint8Array | null;
/**
* Get the serial number of the certificate as a hex string.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @returns an allocated string containing the serial number as hex.
*/
get_serial_number_hex(): string | null;
/**
* Get the common name of the subject of this certificate.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated subject CN, or `null` if no subject CN present.
*/
get_subject_cn(): string | null;
/**
* Get the full subject DN of the certificate as a (mostly)
* readable string.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated subject DN of the certificate.
*/
get_subject_dn(): string | null;
/**
* Get a name to represent the subject of this certificate.
*
* This will try to lookup the common name, orianizational unit,
* organization in that order.
* @returns the allocated subject name, or `null` if no subject name
*/
get_subject_name(): string | null;
/**
* Get a part of the DN of the subject of this certificate.
*
* Examples of a `part` might be the 'OU' (organizational unit)
* or the 'CN' (common name). Only the value of that part
* of the DN is returned.
*
* The string returned should be freed by the caller when no longer
* required.
* @param part a DN type string or OID.
* @returns the allocated part of the subject DN, or `null` if no such part is present.
*/
get_subject_part(part: string): string | null;
/**
* Get the raw DER data for the subject DN of the certificate.
*
* The data should be freed by using `g_free()` when no longer required.
* @returns allocated memory containing the raw subject
*/
get_subject_raw(): Uint8Array | null;
/**
* Get the version of the X.509 certificate.
* @returns the version of the certificate
*/
get_version(): number;
/**
* Check if `issuer` could be the issuer of this certificate. This is done by
* comparing the relevant subject and issuer fields. No signature check is
* done. Proper verification of certificates must be done via a crypto
* library.
* @param issuer a possible issuer {@link Gcr.Certificate}
* @returns whether `issuer` could be the issuer of the certificate.
*/
is_issuer(issuer: Certificate): boolean;
/**
* Creates a {@link CertificateExtensionList} that can be used to inspect the
* extensions of this certificate.
* @returns The certificate's extensions
*/
list_extensions(): CertificateExtensionList;
/**
* Implementers of the {@link Gcr.Certificate} mixin should call this function to notify
* when the certificate has changed to emit notifications on the various
* properties.
*/
mixin_emit_notify(): void;
/**
* Gets the raw DER data for an X.509 certificate.
* @virtual
*/
vfunc_get_der_data(): Uint8Array | string;
/**
* Gets a named field from the objects table of associations (see `g_object_set_data()`).
* @param key name of the key for that association
* @returns the data if found, or `null` if no such data exists.
*/
get_data(key: string): null;
/**
* @param args
*/
// Conflicted with Gck.Object.get_data
get_data(...args: never[]): any;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* @param args
*/
// Conflicted with Gck.Object.set
set(...args: never[]): any;
}
namespace SecretExchange {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::protocol": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
protocol: string;
}
}
/**
* Allows exchange of secrets between two processes on the same system without
* exposing those secrets to things like loggers, non-pageable memory etc.
*
* This does not protect against active attacks like MITM attacks.
*
* Each side creates a secret exchange object, and one of the sides calls
* {@link SecretExchange.begin}. This creates a string, which should be passed
* to the other side. Each side passes the strings it receives into
* {@link SecretExchange.receive}.
*
* In order to send a reply (either with or without a secret) use
* {@link SecretExchange.send}. A side must have successfully called
* {@link SecretExchange.receive} before it can use
* {@link SecretExchange.send}.
*
* The secret exchange objects can be used for multiple iterations of the
* conversation, or for just one request/reply. The only limitation being that
* the initial request cannot contain a secret.
*
* Caveat: Information about the approximate length (rounded up to the nearest
* 16 bytes) may be leaked. If this is considered inacceptable, do not use
* {@link SecretExchange}.
* @gir-type Class
*/
class SecretExchange extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The protocol being used for the exchange.
*
* Will be `null` if no protocol was specified when creating this object,
* and either {@link SecretExchange.begin} or {@link SecretExchange.receive}
* have not been called successfully.
* @construct-only
* @default sx-aes-1
*/
get protocol(): string;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: SecretExchange.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ["new"](protocol: string | null): SecretExchange;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Virtual methods
/**
* @param peer
* @param n_peer
* @virtual
*/
vfunc_derive_transport_key(peer: number, n_peer: number): boolean;
/**
* @param scheme
* @param public_key
* @param n_public_key
* @virtual
*/
vfunc_generate_exchange_key(scheme: string, public_key: number, n_public_key: number): boolean;
// Methods
/**
* Begin the secret exchange. The resulting string should be sent to the other
* side of the exchange. The other side should use {@link SecretExchange.receive}
* to process the string.
* @returns A newly allocated string to be sent to the other side of the secret exchange
*/
begin(): string;
/**
* Will return `null` if no protocol was specified, and either
* {@link SecretExchange.begin} or {@link SecretExchange.receive} have not
* been called successfully.
* @returns the protocol or `null`
*/
get_protocol(): string;
/**
* Returns the last secret received. If no secret has yet been received this
* will return `null`. The string is owned by the {@link Gcr.SecretExchange} object
* and will be valid until the next time that `gcr_secret_exchange_receive()`
* is called on this object, or the object is destroyed.
*
* Depending on the secret passed into the other side of the secret exchange,
* the result may be a binary string. It does however have a null terminator,
* so if you're certain that it is does not contain arbitrary binary data,
* it can be used as a string.
* @returns the last secret received
*/
get_secret(): string[];
/**
* Receive a string from the other side of secret exchange. This string will
* have been created by {@link SecretExchange.begin} or
* {@link SecretExchange.send}.
*
* After this call completes successfully the value returned from
* `gcr_secret_exchange_get_secret()` will have changed.
* @param exchange the string received
* @returns whether the string was successfully parsed and received
*/
receive(exchange: string): boolean;
/**
* Send a reply to the other side of the secret exchange, optionally sending a
* secret.
*
* {@link SecretExchange.receive} must have been successfully called at least
* once on this object. In other words this object must have received data
* from the other side of the secret exchange, before we can send a secret.
* @param secret optionally, a secret to send to the other side
* @param secret_len length of `secret`, or -1 if null terminated
* @returns a newly allocated string to be sent to the other side of the secret exchange
*/
send(secret: string | null, secret_len: bigint | number): string;
}
namespace SimpleCertificate {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::description": (pspec: GObject.ParamSpec) => void;
"notify::expiry-date": (pspec: GObject.ParamSpec) => void;
"notify::issuer-name": (pspec: GObject.ParamSpec) => void;
"notify::label": (pspec: GObject.ParamSpec) => void;
"notify::subject-name": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Certificate.ConstructorProps {}
}
/**
* An implementation of {@link Certificate} which loads a certificate from DER
* data already located in memory.
*
* To create an object, use the {@link SimpleCertificate.new} or
* {@link SimpleCertificate.new_static} functions.
* @gir-type Class
*/
class SimpleCertificate extends GObject.Object implements Certificate {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: SimpleCertificate.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ["new"](data: Uint8Array | string): SimpleCertificate;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
/**
* A readable description for this certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get description(): string;
/**
* The expiry date of the certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get expiry_date(): GLib.DateTime | null;
/**
* The expiry date of the certificate
* @read-only
* @category Inherited from Gcr.Certificate
*/
get expiryDate(): GLib.DateTime | null;
/**
* Common name part of the certificate issuer
* @read-only
* @category Inherited from Gcr.Certificate
*/
get issuer_name(): string | null;
/**
* Common name part of the certificate issuer
* @read-only
* @category Inherited from Gcr.Certificate
*/
get issuerName(): string | null;
/**
* A readable label for this certificate.
* @read-only
* @category Inherited from Gcr.Certificate
*/
get label(): string;
/**
* @read-only
* @category Inherited from Gcr.Certificate
*/
get subject_name(): string | null;
/**
* @read-only
* @category Inherited from Gcr.Certificate
*/
get subjectName(): string | null;
/**
* Get the basic constraints for the certificate if present. If `false` is
* returned then no basic constraints are present and the `is_ca` and
* `path_len` arguments are not changed.
* @returns whether basic constraints are present or not
*/
get_basic_constraints(): [boolean, boolean, number];
/**
* Gets the raw DER data for an X.509 certificate.
* @returns raw DER data of the X.509 certificate
*/
get_der_data(): Uint8Array;
/**
* Get the expiry date of this certificate.
* @returns An expiry date of this certificate.
*/
get_expiry_date(): GLib.DateTime | null;
/**
* Calculate the fingerprint for this certificate.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @param type the type of algorithm for the fingerprint.
* @returns the raw binary fingerprint
*/
get_fingerprint(type: GLib.ChecksumType): Uint8Array | null;
/**
* Calculate the fingerprint for this certificate, and return it
* as a hex string.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @param type the type of algorithm for the fingerprint.
* @returns an allocated hex string which contains the fingerprint.
*/
get_fingerprint_hex(type: GLib.ChecksumType): string | null;
/**
* Get the list of sections from the certificate that can be shown to the user
* interface.
* @returns A {@link GLib.List} of {@link Gcr.CertificateSection}
*/
get_interface_elements(): CertificateSection[];
/**
* Get the issued date of this certificate.
* @returns A issued date of this certificate.
*/
get_issued_date(): GLib.DateTime | null;
/**
* Get the common name of the issuer of this certificate.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated issuer CN, or `null` if no issuer CN present.
*/
get_issuer_cn(): string | null;
/**
* Get the full issuer DN of the certificate as a (mostly)
* readable string.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated issuer DN of the certificate.
*/
get_issuer_dn(): string | null;
/**
* Get a name to represent the issuer of this certificate.
*
* This will try to lookup the common name, orianizational unit,
* organization in that order.
* @returns the allocated issuer name, or `null` if no issuer name
*/
get_issuer_name(): string | null;
/**
* Get a part of the DN of the issuer of this certificate.
*
* Examples of a `part` might be the 'OU' (organizational unit)
* or the 'CN' (common name). Only the value of that part
* of the DN is returned.
*
* The string returned should be freed by the caller when no longer
* required.
* @param part a DN type string or OID.
* @returns the allocated part of the issuer DN, or `null` if no such part is present
*/
get_issuer_part(part: string): string | null;
/**
* Get the raw DER data for the issuer DN of the certificate.
*
* The data should be freed by using `g_free()` when no longer required.
* @returns allocated memory containing the raw issuer
*/
get_issuer_raw(): Uint8Array | null;
/**
* Get the key size in bits of the public key represented
* by this certificate.
* @returns The key size of the certificate.
*/
get_key_size(): number;
/**
* Returns the subject public key info (SPKI) of the certificate.
* @returns The SPKI of the certificate.
*/
get_public_key_info(): SubjectPublicKeyInfo;
/**
* Get the raw binary serial number of the certificate.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @returns the raw binary serial number.
*/
get_serial_number(): Uint8Array | null;
/**
* Get the serial number of the certificate as a hex string.
*
* The caller should free the returned data using `g_free()` when
* it is no longer required.
* @returns an allocated string containing the serial number as hex.
*/
get_serial_number_hex(): string | null;
/**
* Get the common name of the subject of this certificate.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated subject CN, or `null` if no subject CN present.
*/
get_subject_cn(): string | null;
/**
* Get the full subject DN of the certificate as a (mostly)
* readable string.
*
* The string returned should be freed by the caller when no longer
* required.
* @returns The allocated subject DN of the certificate.
*/
get_subject_dn(): string | null;
/**
* Get a name to represent the subject of this certificate.
*
* This will try to lookup the common name, orianizational unit,
* organization in that order.
* @returns the allocated subject name, or `null` if no subject name
*/
get_subject_name(): string | null;
/**
* Get a part of the DN of the subject of this certificate.
*
* Examples of a `part` might be the 'OU' (organizational unit)
* or the 'CN' (common name). Only the value of that part
* of the DN is returned.
*
* The string returned should be freed by the caller when no longer
* required.
* @param part a DN type string or OID.
* @returns the allocated part of the subject DN, or `null` if no such part is present.
*/
get_subject_part(part: string): string | null;
/**
* Get the raw DER data for the subject DN of the certificate.
*
* The data should be freed by using `g_free()` when no longer required.
* @returns allocated memory containing the raw subject
*/
get_subject_raw(): Uint8Array | null;
/**
* Get the version of the X.509 certificate.
* @returns the version of the certificate
*/
get_version(): number;
/**
* Check if `issuer` could be the issuer of this certificate. This is done by
* comparing the relevant subject and issuer fields. No signature check is
* done. Proper verification of certificates must be done via a crypto
* library.
* @param issuer a possible issuer {@link Gcr.Certificate}
* @returns whether `issuer` could be the issuer of the certificate.
*/
is_issuer(issuer: Certificate): boolean;
/**
* Creates a {@link CertificateExtensionList} that can be used to inspect the
* extensions of this certificate.
* @returns The certificate's extensions
*/
list_extensions(): CertificateExtensionList;
/**
* Implementers of the {@link Gcr.Certificate} mixin should call this function to notify
* when the certificate has changed to emit notifications on the various
* properties.
*/
mixin_emit_notify(): void;
/**
* Gets the raw DER data for an X.509 certificate.
* @virtual
*/
vfunc_get_der_data(): Uint8Array | string;
}
namespace SshAskpass {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::interaction": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
interaction: Gio.TlsInteraction;
}
}
/**
* When used as the setup function while spawning an ssh command like ssh-add
* or ssh, this allows callbacks for passwords on the provided interaction.
* @gir-type Class
*/
class SshAskpass extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The interaction used to prompt for passwords.
* @construct-only
*/
get interaction(): Gio.TlsInteraction;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: SshAskpass.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ["new"](interaction: Gio.TlsInteraction): SshAskpass;
// Signals
/** @signal */
connect(signal: K, callback: GObject.SignalCallback): number;
connect(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
connect_after(signal: K, callback: GObject.SignalCallback): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
/** @signal */
emit(signal: K, ...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never): void;
emit(signal: string, ...args: any[]): void;
// Static methods
/**
* Use this function as a callback setup function passed to `g_spawn_sync()`,
* `g_spawn_async()`, `g_spawn_async_with_pipes()`.
* @param askpass a {@link Gcr.SshAskpass} object
*/
static child_setup(askpass: null): void;
// Methods
/**
* Get the interaction associated with this object.
* @returns the interaction
*/
get_interaction(): Gio.TlsInteraction;
}
namespace SystemPrompt {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
"notify::bus-name": (pspec: GObject.ParamSpec) => void;
"notify::secret-exchange": (pspec: GObject.ParamSpec) => void;
"notify::timeout-seconds": (pspec: GObject.ParamSpec) => void;
"notify::caller-window": (pspec: GObject.ParamSpec) => void;
"notify::cancel-label": (pspec: GObject.ParamSpec) => void;
"notify::choice-chosen": (pspec: GObject.ParamSpec) => void;
"notify::choice-label": (pspec: GObject.ParamSpec) => void;
"notify::continue-label": (pspec: GObject.ParamSpec) => void;
"notify::description": (pspec: GObject.ParamSpec) => void;
"notify::message": (pspec: GObject.ParamSpec) => void;
"notify::password-new": (pspec: GObject.ParamSpec) => void;
"notify::password-strength": (pspec: GObject.ParamSpec) => void;
"notify::title": (pspec: GObject.ParamSpec) => void;
"notify::warning": (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Prompt.ConstructorProps, Gio.AsyncInitable.ConstructorProps, Gio.Initable.ConstructorProps {
bus_name: string;
busName: string;
secret_exchange: SecretExchange;
secretExchange: SecretExchange;
timeout_seconds: number;
timeoutSeconds: number;
}
}
/**
* A {@link Prompt} implementation which calls to the system prompter to
* display prompts in a system modal fashion.
*
* Since the system prompter usually only displays one prompt at a time, you
* may have to wait for the prompt to be displayed. Use {@link SystemPrompt.open}
* or a related function to open a prompt. Since this can take a long time, you
* should always check that the prompt is still needed after it is opened. A
* previous prompt may have already provided the information needed and you
* may no longer need to prompt.
*
* Use {@link SystemPrompt.close} to close the prompt when you're done with it.
* @gir-type Class
*/
class SystemPrompt extends GObject.Object implements Prompt, Gio.AsyncInitable