TelepathyGLib.TLSCertificate¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The raw DER-encoded certificate chain data. |
||
r |
The type of this certificate. |
||
r/w/co |
The |
||
r |
The state of this certificate. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class TelepathyGLib.TLSCertificate(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
TelepathyGLib.Proxy
subclass representing a server or peer’s TLS certificate being presented for acceptance/rejection.New in version 0.19.0.
- 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:
conn_or_chan (
TelepathyGLib.Proxy
) – aTelepathyGLib.Connection
orTelepathyGLib.Channel
parent for this object, whose invalidation will also result in invalidation of the returned objectobject_path (
str
) – the object path of this TLS certificate
- Raises:
- Returns:
a new TLS certificate proxy. Prepare the feature %TP_TLS_CERTIFICATE_FEATURE_CORE to make it useful.
- Return type:
New in version 0.19.0.
- accept_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – called on success or failure
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 byTelepathyGLib.TLSCertificate.accept_async
()- Raises:
- Returns:
True
if acceptance was successful- Return type:
Check the result of
TelepathyGLib.TLSCertificate.accept_async
().New in version 0.19.0.
- add_rejection(reason, dbus_error, details)¶
- Parameters:
reason (
TelepathyGLib.TLSCertificateRejectReason
) – the reason for rejectiondbus_error (
str
) – a D-Bus error name such as %TP_ERROR_STR_CERT_REVOKED, orNone
to derive one from reasondetails (
GLib.Variant
orNone
) – a variant of type %G_VARIANT_TYPE_VARDICT containing the details of the rejection, orNone
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:
Return the
TelepathyGLib.TLSCertificate
:cert-data
propertyNew in version 0.19.0.
- get_cert_type()¶
- Returns:
the value of
TelepathyGLib.TLSCertificate
:cert-type
property- Return type:
Return the
TelepathyGLib.TLSCertificate
:cert-type
propertyNew 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:
- Return type:
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:
- Return type:
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 returnsNone
.New in version 0.19.0.
- get_state()¶
- Returns:
the value of
TelepathyGLib.TLSCertificate
:state
property- Return type:
Return the
TelepathyGLib.TLSCertificate
:state
propertyNew in version 0.19.0.
- reject_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – called on success or failure
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 byTelepathyGLib.TLSCertificate.reject_async
()- Raises:
- Returns:
True
if rejection was successful- Return type:
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:
- Default Value:
- Flags:
The raw data of the certificate or certificate chain, represented as a
GLib.PtrArray
ofGLib.Bytes
. It should be interpreted according toTelepathyGLib.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¶
-
The type of the certificate, typically either “x509” or “pgp”.
New in version 0.19.0.
- TelepathyGLib.TLSCertificate.props.parent¶
- Name:
parent
- Type:
- Default Value:
- Flags:
A
TelepathyGLib.Connection
orTelepathyGLib.Channel
which owns this TLS certificate. If the parent object is invalidated, the certificate is also invalidated, and this property is set toNone
.New in version 0.19.0.
- TelepathyGLib.TLSCertificate.props.state¶
-
The state of this TLS certificate as a
TelepathyGLib.TLSCertificateState
, initiallyTelepathyGLib.TLSCertificateState.PENDING
.GObject.Object
::notify
::state
will be emitted when this changes.New in version 0.19.0.