TelepathyGLib.TLSCertificate

g GObject.Object GObject.Object TelepathyGLib.Proxy TelepathyGLib.Proxy GObject.Object->TelepathyGLib.Proxy TelepathyGLib.TLSCertificate TelepathyGLib.TLSCertificate TelepathyGLib.Proxy->TelepathyGLib.TLSCertificate

Subclasses:

None

Methods

Inherited:

TelepathyGLib.Proxy (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_feature_quark_core ()

class

init_known_interfaces ()

class

new (conn_or_chan, object_path)

accept_async (callback, *user_data)

accept_finish (result)

add_rejection (reason, dbus_error, details)

get_cert_data ()

get_cert_type ()

get_nth_rejection (n)

get_rejection ()

get_state ()

reject_async (callback, *user_data)

reject_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

TelepathyGLib.Proxy (5)

Name

Type

Flags

Short Description

cert-data

GLib.PtrArray

r

The raw DER-encoded certificate chain data.

cert-type

str

r

The type of this certificate.

parent

TelepathyGLib.Proxy

r/w/co

The TelepathyGLib.Connection or TelepathyGLib.Channel to which this belongs

state

int

r

The state of this certificate.

Signals

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Fields

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Name

Type

Access

Description

parent

TelepathyGLib.Proxy

r

Class Details

class TelepathyGLib.TLSCertificate(**kwargs)
Bases:

TelepathyGLib.Proxy

Abstract:

No

Structure:

TelepathyGLib.TLSCertificateClass

A TelepathyGLib.Proxy subclass representing a server or peer’s TLS certificate being presented for acceptance/rejection.

New in version 0.19.0.

classmethod get_feature_quark_core()
Return type:

int

classmethod init_known_interfaces()

Ensure that the known interfaces for TelepathyGLib.TLSCertificate have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_TLS_CERTIFICATE.

New in version 0.19.0.

classmethod new(conn_or_chan, object_path)
Parameters:
Raises:

GLib.Error

Returns:

a new TLS certificate proxy. Prepare the feature %TP_TLS_CERTIFICATE_FEATURE_CORE to make it useful.

Return type:

TelepathyGLib.TLSCertificate

New in version 0.19.0.

accept_async(callback, *user_data)
Parameters:

Accept this certificate, asynchronously. In or after callback, you may call TelepathyGLib.TLSCertificate.accept_finish() to check the result.

GObject.Object ::notify::state will also be emitted when the connection manager signals that the certificate has been accepted.

New in version 0.19.0.

accept_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the callback by TelepathyGLib.TLSCertificate.accept_async()

Raises:

GLib.Error

Returns:

True if acceptance was successful

Return type:

bool

Check the result of TelepathyGLib.TLSCertificate.accept_async().

New in version 0.19.0.

add_rejection(reason, dbus_error, details)
Parameters:

Add a pending reason for rejection. The first call to this method is considered “most important”. After calling this method as many times as are required, call TelepathyGLib.TLSCertificate.reject_async() to reject the certificate.

If details is a floating reference (see GLib.Variant.ref_sink()), ownership of details is taken by this function. This means you can pass the result of g_variant_new() or g_variant_new_parsed() directly to this function without additional reference-count management.

New in version 0.19.0.

get_cert_data()
Returns:

the value of TelepathyGLib.TLSCertificate :cert-data property

Return type:

[GLib.Bytes]

Return the TelepathyGLib.TLSCertificate :cert-data property

New in version 0.19.0.

get_cert_type()
Returns:

the value of TelepathyGLib.TLSCertificate :cert-type property

Return type:

str

Return the TelepathyGLib.TLSCertificate :cert-type property

New in version 0.19.0.

get_nth_rejection(n)
Parameters:

n (int) – the rejection reason to return; if 0, return the same thing as tp_tls_certificate_get_detailed_rejection()

Returns:

a TelepathyGLib.TLSCertificateRejection, or None

Return type:

TelepathyGLib.TLSCertificateRejection or None

If this certificate has been rejected and n is less than the number of rejection reasons, return a TelepathyGLib.TLSCertificateRejection representing the n<!—->th rejection reason (starting from 0).

With n == 0 this is equivalent to TelepathyGLib.TLSCertificate.get_rejection().

New in version 0.19.0.

get_rejection()
Returns:

a TelepathyGLib.TLSCertificateRejection, or None

Return type:

TelepathyGLib.TLSCertificateRejection or None

If this certificate has been rejected, return a TelepathyGLib.TLSCertificateRejection indicating the first rejection reason (by convention, the most important).

If you want to list all the things that are wrong with the certificate (for instance, it might be self-signed and also have expired) you can call TelepathyGLib.TLSCertificate.get_nth_rejection(), increasing n until it returns None.

New in version 0.19.0.

get_state()
Returns:

the value of TelepathyGLib.TLSCertificate :state property

Return type:

TelepathyGLib.TLSCertificateState

Return the TelepathyGLib.TLSCertificate :state property

New in version 0.19.0.

reject_async(callback, *user_data)
Parameters:

Reject this certificate, asynchronously.

Before calling this method, you must call TelepathyGLib.TLSCertificate.add_rejection() at least once, to set the reason(s) for rejection (for instance, a certificate might be both self-signed and expired).

In or after callback, you may call TelepathyGLib.TLSCertificate.reject_finish() to check the result.

GObject.Object ::notify::state will also be emitted when the connection manager signals that the certificate has been rejected.

New in version 0.19.0.

reject_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the callback by TelepathyGLib.TLSCertificate.reject_async()

Raises:

GLib.Error

Returns:

True if rejection was successful

Return type:

bool

Check the result of TelepathyGLib.TLSCertificate.reject_async().

New in version 0.19.0.

Property Details

TelepathyGLib.TLSCertificate.props.cert_data
Name:

cert-data

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

The raw data of the certificate or certificate chain, represented as a GLib.PtrArray of GLib.Bytes. It should be interpreted according to TelepathyGLib.TLSCertificate :cert-type.

The first certificate in this array is the server’s certificate, followed by its issuer, followed by the issuer’s issuer and so on.

For “x509” certificates, each certificate is an X.509 certificate in binary (DER) format.

For “pgp” certificates, each certificate is a binary OpenPGP key.

New in version 0.19.0.

TelepathyGLib.TLSCertificate.props.cert_type
Name:

cert-type

Type:

str

Default Value:

None

Flags:

READABLE

The type of the certificate, typically either “x509” or “pgp”.

New in version 0.19.0.

TelepathyGLib.TLSCertificate.props.parent
Name:

parent

Type:

TelepathyGLib.Proxy

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

A TelepathyGLib.Connection or TelepathyGLib.Channel which owns this TLS certificate. If the parent object is invalidated, the certificate is also invalidated, and this property is set to None.

New in version 0.19.0.

TelepathyGLib.TLSCertificate.props.state
Name:

state

Type:

int

Default Value:

0

Flags:

READABLE

The state of this TLS certificate as a TelepathyGLib.TLSCertificateState, initially TelepathyGLib.TLSCertificateState.PENDING.

GObject.Object ::notify::state will be emitted when this changes.

New in version 0.19.0.