Gcr.CertificateRequest

g GObject.Object GObject.Object Gcr.CertificateRequest Gcr.CertificateRequest GObject.Object->Gcr.CertificateRequest

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

capable (private_key, cancellable)

class

capable_async (private_key, cancellable, callback, *user_data)

class

capable_finish (result)

class

prepare (format, private_key)

complete (cancellable)

complete_async (cancellable, callback, *user_data)

complete_finish (result)

encode (textual)

get_format ()

get_private_key ()

set_cn (cn)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

private-key

Gck.Object

r/w/co

Private key for request

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gcr.CertificateRequest(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gcr.CertificateRequestClass

An object that allows creation of certificate requests. A certificate request is sent to a certificate authority to request an X.509 certificate.

Use [func`CertificateRequest`.prepare] to create a blank certificate request for a given private key. Set the common name on the certificate request with [method`CertificateRequest`.set_cn], and then sign the request with [method`CertificateRequest`.complete_async].

classmethod capable(private_key, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

whether a request can be created

Return type:

bool

Check whether [class`CertificateRequest`] is capable of creating a request for the given private_key.

classmethod capable_async(private_key, cancellable, callback, *user_data)[source]
Parameters:

Asynchronously check whether [class`CertificateRequest`] is capable of creating a request for the given private_key.

classmethod capable_finish(result)[source]
Parameters:

result (Gio.AsyncResult) – asynchronous result

Raises:

GLib.Error

Returns:

whether a request can be created

Return type:

bool

Get the result for asynchronously check whether [class`CertificateRequest`] is capable of creating a request for the given private_key.

classmethod prepare(format, private_key)[source]
Parameters:
Returns:

a new Gcr.Certificate request

Return type:

Gcr.CertificateRequest

Create a new certificate request, in the given format for the private key.

complete(cancellable)[source]
Parameters:

cancellable (Gio.Cancellable or None) – a cancellation object

Raises:

GLib.Error

Returns:

whether certificate request was successfully completed or not

Return type:

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.

complete_async(cancellable, callback, *user_data)[source]
Parameters:

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.

complete_finish(result)[source]
Parameters:

result (Gio.AsyncResult) – result of the asynchronous operation

Raises:

GLib.Error

Returns:

whether certificate request was successfully completed or not

Return type:

bool

Finish an asynchronous operation to complete and sign a certificate request.

encode(textual)[source]
Parameters:

textual (bool) – whether to encode output as text

Returns:

the encoded certificate request

Return type:

bytes

Encode the certificate request. It must have been completed with [method`CertificateRequest`.complete] or [method`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.

get_format()[source]
Returns:

the format

Return type:

Gcr.CertificateRequestFormat

Get the format of this certificate request.

get_private_key()[source]
Returns:

the private key,

Return type:

Gck.Object

Get the private key this certificate request is for.

set_cn(cn)[source]
Parameters:

cn (str) – common name to set on the request

Set the common name encoded in the certificate request.

Property Details

Gcr.CertificateRequest.props.private_key
Name:

private-key

Type:

Gck.Object

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The private key that this certificate request is for.