:right-sidebar: True CertificateRequest =================================================================== .. currentmodule:: gi.repository.Gcr .. class:: CertificateRequest(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: CertificateRequest(**properties) Methods ------- .. rst-class:: interim-class .. class:: CertificateRequest :no-index: .. method:: capable(private_key: ~gi.repository.Gck.Object, 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 private_key: a private key :param cancellable: cancellation object .. method:: capable_async(private_key: ~gi.repository.Gck.Object, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Asynchronously check whether :obj:`~gi.repository.Gcr.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 :param user_data: data to be passed to callback .. method:: capable_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Get the result for asynchronously check whether :obj:`~gi.repository.Gcr.CertificateRequest` is capable of creating a request for the given ``private_key``. :param result: asynchronous result .. 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[[...], None] | None = None, *user_data: ~typing.Any) -> 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) -> bytes 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. .. method:: prepare(format: ~gi.repository.Gcr.CertificateRequestFormat, private_key: ~gi.repository.Gck.Object) -> ~gi.repository.Gcr.CertificateRequest 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 .. 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 private key that this certificate request is for.