:right-sidebar: True CertificateRequest =================================================================== .. currentmodule:: gi.repository.Gcr .. class:: CertificateRequest(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.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 :obj:`~gi.repository.CertificateRequest.prepare` to create a blank certificate request for a given private key. Set the common name on the certificate request with :obj:`~gi.repository.CertificateRequest.set_cn`\, and then sign the request with :obj:`~gi.repository.CertificateRequest.complete_async`\. Methods ------- .. rst-class:: interim-class .. class:: CertificateRequest :no-index: .. classmethod:: capable(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool Check whether :obj:`~gi.repository.Gcr.CertificateRequest` is capable of creating a request for the given ``private_key``\. :param cancellable: cancellation object .. classmethod:: capable_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronously check whether :obj:`~gi.repository.Gcr.CertificateRequest` is capable of creating a request for the given ``private_key``\. :param cancellable: cancellation object :param callback: will be called when the operation completes :param user_data: data to be passed to callback .. classmethod:: capable_finish() -> bool Get the result for asynchronously check whether :obj:`~gi.repository.Gcr.CertificateRequest` is capable of creating a request for the given ``private_key``\. .. method:: complete(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool 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 .. method:: complete_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None 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 :param user_data: data to pass to the callback .. method:: complete_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Finish an asynchronous operation to complete and sign a certificate request. :param result: result of the asynchronous operation .. method:: encode(textual: bool) -> list[int] Encode the certificate request. It must have been completed with :obj:`~gi.repository.CertificateRequest.complete` or :obj:`~gi.repository.CertificateRequest.complete_async`\. If ``textual`` is :const:`False`, the output is a DER encoded certificate request. If ``textual`` is :const:`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 .. method:: get_format() -> ~gi.repository.Gcr.CertificateRequestFormat Get the format of this certificate request. .. method:: get_private_key() -> ~gi.repository.Gck.Object Get the private key this certificate request is for. .. classmethod:: prepare(private_key: ~gi.repository.Gck.Object) -> ~gi.repository.Gcr.CertificateRequest Create a new certificate request, in the given format for the private key. :param private_key: the private key the the certificate is being requested for .. method:: set_cn(cn: str) -> None Set the common name encoded in the certificate request. :param cn: common name to set on the request Properties ---------- .. rst-class:: interim-class .. class:: CertificateRequest :no-index: .. attribute:: props.private_key :type: ~gi.repository.Gck.Object The type of the None singleton.