## GcrCertificateWidget GcrCertificateWidget — Certificate widget and renderer |

## Functions

#define | GCR_CERTIFICATE_COLUMNS
GcrCertificateWidget * | gcr_certificate_widget_new ()
GcrCertificate * | gcr_certificate_widget_get_certificate ()
void | gcr_certificate_widget_set_certificate ()
GcrCertificateRenderer * | gcr_certificate_renderer_new ()
GcrCertificateRenderer * | gcr_certificate_renderer_new_for_attributes ()
GcrCertificate * | gcr_certificate_renderer_get_certificate ()
void | gcr_certificate_renderer_set_certificate ()

## Properties

GckAttributes * | attributes | Read / Write
GcrCertificate * | certificate | Read / Write
GckAttributes * | attributes | Read / Write
GcrCertificate * | certificate | Read / Write
gchar * | label | Read / Write

## Types and Values

struct | GcrCertificateWidget
struct | GcrCertificateWidgetClass
struct | GcrCertificateRenderer
struct | GcrCertificateRendererClass

## Object Hierarchy

        GObject
        ├── GInitiallyUnowned
        │   ╰── GtkWidget
        │       ╰── GtkContainer
        │           ╰── GtkBin
        │               ╰── GcrCertificateWidget
        ╰── GcrCertificateRenderer

## Implemented Interfaces

GcrCertificateWidget implements AtkImplementorIface and GtkBuildable.

GcrCertificateRenderer implements GcrRenderer, GcrComparable and GcrCertificate.

## Description

A GcrCertificateWidget can be used to display a certificate. The widget is normally in a collapsed state showing only details, but can be expanded by the user.

Use `gcr_certificate_widget_new()` to create a new certificate widget. Only one certificate can be displayed. A GcrCertificateWidget contains a GcrViewer internally and GcrCertificateRenderer is used to render the certificate to the viewer. To show more than one certificate in a view, create the viewer and add renderers to it.

## Functions

### GCR_CERTIFICATE_COLUMNS

    #define GCR_CERTIFICATE_COLUMNS                 (gcr_certificate_get_columns ())

The columns that are valid for a certificate. This is to be used with the GcrTreeSelector or GcrCollectionModel.

This is an array of GcrColumn, owned by the gcr library.

### gcr_certificate_widget_new ()

    GcrCertificateWidget *
    gcr_certificate_widget_new (GcrCertificate *certificate);

Create a new certificate widget which displays a given certificate.

#### Parameters

certificate | certificate to display, or `NULL`. | [allow-none]

#### Returns

a newly allocated GcrCertificateWidget, which should be freed with `g_object_unref()`.

[transfer full]

### gcr_certificate_widget_get_certificate ()

    GcrCertificate *
    gcr_certificate_widget_get_certificate
                                   (GcrCertificateWidget *self);

Get the certificate displayed in the widget.

#### Parameters

self | The certificate widget |

#### Returns

the certificate.

[allow-none][transfer none]

### gcr_certificate_widget_set_certificate ()

    void
    gcr_certificate_widget_set_certificate
                                   (GcrCertificateWidget *self,
                                    GcrCertificate *certificate);

Set the certificate displayed in the widget

#### Parameters

self | The certificate widget |
certificate | the certificate to display. | [allow-none]

### gcr_certificate_renderer_new ()

    GcrCertificateRenderer *
    gcr_certificate_renderer_new (GcrCertificate *certificate);

Create a new certificate renderer to display the certificate.

#### Parameters

certificate | The certificate to display |

#### Returns

a newly allocated GcrCertificateRenderer, which should be released with `g_object_unref()`.

[transfer full]

### gcr_certificate_renderer_new_for_attributes ()

    GcrCertificateRenderer *
    gcr_certificate_renderer_new_for_attributes
                                   (const gchar *label,
                                    struct _GckAttributes *attrs);

Create a new certificate renderer to display the label and attributes. One of the attributes should be a CKA_VALUE type attribute containing a DER encoded certificate.

#### Parameters

label | the label to display. | [allow-none]
attrs | The attributes to display |

#### Returns

a newly allocated GcrCertificateRenderer, which should be released with `g_object_unref()`.

[transfer full]

### gcr_certificate_renderer_get_certificate ()

    GcrCertificate *
    gcr_certificate_renderer_get_certificate
                                   (GcrCertificateRenderer *self);

Get the certificate displayed in the renderer. If no certificate was explicitly set, then the renderer will return itself since it acts as a valid certificate.

#### Parameters

self | The renderer |

#### Returns

The certificate, owned by the renderer.

[transfer none]

### gcr_certificate_renderer_set_certificate ()

    void
    gcr_certificate_renderer_set_certificate
                                   (GcrCertificateRenderer *self,
                                    GcrCertificate *certificate);

Set a certificate to display in the renderer.

#### Parameters

self | The renderer |
certificate | the certificate to display. | [allow-none]

## Types and Values

### struct GcrCertificateWidget

    struct GcrCertificateWidget;

A widget that displays a certificate.

### struct GcrCertificateWidgetClass

    struct GcrCertificateWidgetClass {
    };

The class for GcrCertificateWidget

### struct GcrCertificateRenderer

    struct GcrCertificateRenderer;

An implementation of GcrRenderer which renders certificates.

### struct GcrCertificateRendererClass

    struct GcrCertificateRendererClass {
    	GObjectClass parent_class;
    };

The class for GcrCertificateRenderer.

#### Members

GObjectClass `parent_class`; | The parent class. |

## Property Details

### The `“attributes”` property

      “attributes”               GckAttributes *

Attributes which contain the certificate.

Flags: Read / Write

### The `“certificate”` property

      “certificate”              GcrCertificate *

Certificate to display.

Flags: Read / Write

### The `“attributes”` property

      “attributes”               GckAttributes *

The certificate attributes to display. One of the attributes must be a CKA_VALUE type attribute which contains a DER encoded certificate.

Flags: Read / Write

### The `“certificate”` property

      “certificate”              GcrCertificate *

The certificate to display. May be `NULL`.

Flags: Read / Write

### The `“label”` property

      “label”                    gchar *

The label to display.

Flags: Read / Write

Default value: ""