## CryptUIKeyChooser

CryptUIKeyChooser

## Synopsis

    enum                CryptUIKeyChooserMode;
                        CryptUIKeyChooserPriv;
                        CryptUIKeyChooser;
    CryptUIKeyChooser*  cryptui_key_chooser_new             (CryptUIKeyset *ckset,
                                                             CryptUIKeyChooserMode mode);
    gboolean            cryptui_key_chooser_get_enforce_prefs
                                                            (CryptUIKeyChooser *chooser);
    void                cryptui_key_chooser_set_enforce_prefs
                                                            (CryptUIKeyChooser *chooser,
                                                             gboolean enforce_prefs);
    gboolean            cryptui_key_chooser_have_recipients (CryptUIKeyChooser *chooser);
    GList*              cryptui_key_chooser_get_recipients  (CryptUIKeyChooser *chooser);
    void                cryptui_key_chooser_set_recipients  (CryptUIKeyChooser *chooser,
                                                             GList *keys);
    const gchar*        cryptui_key_chooser_get_signer      (CryptUIKeyChooser *chooser);
    void                cryptui_key_chooser_set_signer      (CryptUIKeyChooser *chooser,
                                                             const gchar *key);

## Description

## Details

### enum CryptUIKeyChooserMode

    typedef enum _CryptUIKeyChooserMode {
        CRYPTUI_KEY_CHOOSER_RECIPIENTS =    0x0001,
        CRYPTUI_KEY_CHOOSER_SIGNER =        0x0002,

        CRYPTUI_KEY_CHOOSER_MUSTSIGN =      0x0010
    } CryptUIKeyChooserMode;

### CryptUIKeyChooserPriv

    typedef struct _CryptUIKeyChooserPriv CryptUIKeyChooserPriv;

### CryptUIKeyChooser

    typedef struct {
        GtkVBox               parent;
    } CryptUIKeyChooser;

### cryptui_key_chooser_new ()

    CryptUIKeyChooser*  cryptui_key_chooser_new             (CryptUIKeyset *ckset,
                                                             CryptUIKeyChooserMode mode);

Creates a key chooser widget from a key set.

`ckset` : | key set to choose keys from
`mode` : | how to display the signer portion of the widget
Returns : | a key shooser widget

### cryptui_key_chooser_get_enforce_prefs ()

    gboolean            cryptui_key_chooser_get_enforce_prefs
                                                            (CryptUIKeyChooser *chooser);

Gets whether or not the preference to encrypt to self will be enforced. If TRUE, the default signing key will be added to the recipient list. If FALSE, the selected recipients will be returned without adding the default signing key.

`chooser` : | the key chooser widget
Returns : | whether or not the default signing key will be included in the recipients even if not selected

### cryptui_key_chooser_set_enforce_prefs ()

    void                cryptui_key_chooser_set_enforce_prefs
                                                            (CryptUIKeyChooser *chooser,
                                                             gboolean enforce_prefs);

Sets whether or not the preference to encrypt to self will be enforced. If TRUE, the default signing key will be added to the recipient list. If FALSE, the selected recipients will be returned without adding the default signing key.

`chooser` : | the chooser widget
`enforce_prefs` : | whether or not the default signing key will be included in the recipients even if not selected

### cryptui_key_chooser_have_recipients ()

    gboolean            cryptui_key_chooser_have_recipients (CryptUIKeyChooser *chooser);

Determines if recipient keys have been selected.

`chooser` : | the chooser to check
Returns : | TRUE if recipients have been selected.

### cryptui_key_chooser_get_recipients ()

    GList*              cryptui_key_chooser_get_recipients  (CryptUIKeyChooser *chooser);

This function returns a list of recipients selected in the chooser widget.

`chooser` : | the chooser to get selected recipients from
Returns : | the list of recipients

### cryptui_key_chooser_set_recipients ()

    void                cryptui_key_chooser_set_recipients  (CryptUIKeyChooser *chooser,
                                                             GList *keys);

Marks the listed keys as selected in the chooser widget.

`chooser` : | the chooser to set recipients on
`keys` : | the list of recipients to mark selected

### cryptui_key_chooser_get_signer ()

    const gchar*        cryptui_key_chooser_get_signer      (CryptUIKeyChooser *chooser);

Gets the key of the selected signer from the chooser widget.

`chooser` : | the chooser widget to get the signer from
Returns : | the selected signer's key

### cryptui_key_chooser_set_signer ()

    void                cryptui_key_chooser_set_signer      (CryptUIKeyChooser *chooser,
                                                             const gchar *key);

Sets the signer in the chooser to the provided key.

`chooser` : | the chooser to set the signer on
`key` : | the signer key to set