CertificateRequest#
Superclasses: 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 prepare to create a blank certificate
request for a given private key. Set the common name on the certificate
request with set_cn, and then sign the request
with complete_async.
Methods#
- class CertificateRequest
 - classmethod capable(cancellable: Cancellable | None = None) bool#
 Check whether
CertificateRequestis capable of creating a request for the givenprivate_key.- Parameters:
 cancellable – cancellation object
- classmethod capable_async(cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
 Asynchronously check whether
CertificateRequestis capable of creating a request for the givenprivate_key.- Parameters:
 cancellable – cancellation object
callback – will be called when the operation completes
user_data – data to be passed to callback
- classmethod capable_finish() bool#
 Get the result for asynchronously check whether
CertificateRequestis capable of creating a request for the givenprivate_key.
- complete(cancellable: 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.
- Parameters:
 cancellable – a cancellation object
- async complete_async(self) bool#
 This is the awaitable version of
complete_async().
- complete_async(cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: 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.
- Parameters:
 cancellable – a cancellation object
callback – called when the operation completes
user_data – data to pass to the callback
- complete_finish(result: AsyncResult) bool#
 Finish an asynchronous operation to complete and sign a certificate request.
- Parameters:
 result – result of the asynchronous operation
- encode(textual: bool) list[int]#
 Encode the certificate request. It must have been completed with
completeorcomplete_async.If
textualisFalse, the output is a DER encoded certificate request.If
textualisTrue, the output is encoded as text. For PKCS``10`` requests this is done using the OpenSSL style PEM encoding.- Parameters:
 textual – whether to encode output as text
- get_format() CertificateRequestFormat#
 Get the format of this certificate request.
- get_private_key() Object#
 Get the private key this certificate request is for.
- classmethod prepare(private_key: Object) CertificateRequest#
 Create a new certificate request, in the given format for the private key.
- Parameters:
 private_key – the private key the the certificate is being requested for
Properties#
- class CertificateRequest
 - props.private_key: Object#
 The type of the None singleton.