## GMimeFilterOpenPGP

GMimeFilterOpenPGP — Detect OpenPGP markers.

## Functions

GMimeFilter * | g_mime_filter_openpgp_new ()
GMimeOpenPGPData | g_mime_filter_openpgp_get_data_type ()
gint64 | g_mime_filter_openpgp_get_begin_offset ()
gint64 | g_mime_filter_openpgp_get_end_offset ()

## Types and Values

enum | GMimeOpenPGPData
enum | GMimeOpenPGPState
| GMimeOpenPGPMarker
struct | GMimeFilterOpenPGP

## Object Hierarchy

        GObject
        ╰── GMimeFilter
            ╰── GMimeFilterOpenPGP

## Description

A GMimeFilter for detecting OpenPGP markers and filtering out any content outside the bounds of said markers.

## Functions

### g_mime_filter_openpgp_new ()

    GMimeFilter *
    g_mime_filter_openpgp_new (void);

Creates a new GMimeFilterOpenPGP filter.

#### Returns

a new GMimeFilterOpenPGP filter.

Since: 3.2

### g_mime_filter_openpgp_get_data_type ()

    GMimeOpenPGPData
    g_mime_filter_openpgp_get_data_type (GMimeFilterOpenPGP *openpgp);

Gets the type of OpenPGP data that has been detected.

#### Parameters

openpgp | A GMimeFilterOpenPGP filter |

#### Returns

a GMimeOpenPGPData value.

Since: 3.2

### g_mime_filter_openpgp_get_begin_offset ()

    gint64
    g_mime_filter_openpgp_get_begin_offset
                                   (GMimeFilterOpenPGP *openpgp);

Gets the stream offset of the beginning of the OpenPGP data block, if any have been found.

#### Parameters

openpgp | A GMimeFilterOpenPGP filter |

#### Returns

The stream offset or `-1` if no OpenPGP block was found.

Since: 3.2

### g_mime_filter_openpgp_get_end_offset ()

    gint64
    g_mime_filter_openpgp_get_end_offset (GMimeFilterOpenPGP *openpgp);

Gets the stream offset of the end of the OpenPGP data block, if any have been found.

#### Parameters

openpgp | A GMimeFilterOpenPGP filter |

#### Returns

The stream offset or `-1` if no OpenPGP block was found.

Since: 3.2

## Types and Values

### enum GMimeOpenPGPData

The type of OpenPGP data found, if any.

#### Members

GMIME_OPENPGP_DATA_NONE | No OpenPGP data found. |
GMIME_OPENPGP_DATA_ENCRYPTED | The content contains OpenPGP encrypted data. |
GMIME_OPENPGP_DATA_SIGNED | The content contains OpenPGP signed data. |
GMIME_OPENPGP_DATA_PUBLIC_KEY | The content contains OpenPGP public key data. |
GMIME_OPENPGP_DATA_PRIVATE_KEY | The content contains OpenPGP private key data. |

### enum GMimeOpenPGPState

The current state of the GMimeFilterOpenPGP filter.

#### Members

GMIME_OPENPGP_NONE | No OpenPGP markers have been found (yet). |
GMIME_OPENPGP_BEGIN_PGP_MESSAGE | The "-----BEGIN PGP MESSAGE-----" marker has been found. |
GMIME_OPENPGP_END_PGP_MESSAGE | The "-----END PGP MESSAGE-----" marker has been found. |
GMIME_OPENPGP_BEGIN_PGP_SIGNED_MESSAGE | The "-----BEGIN PGP SIGNED MESSAGE-----" marker has been found. |
GMIME_OPENPGP_BEGIN_PGP_SIGNATURE | The "-----BEGIN PGP SIGNATURE-----" marker has been found. |
GMIME_OPENPGP_END_PGP_SIGNATURE | The "-----END PGP SIGNATURE-----" marker has been found. |
GMIME_OPENPGP_BEGIN_PGP_PUBLIC_KEY_BLOCK | The "-----BEGIN PGP PUBLIC KEY BLOCK-----" marker has been found. |
GMIME_OPENPGP_END_PGP_PUBLIC_KEY_BLOCK | The "-----END PGP PUBLIC KEY BLOCK-----" marker has been found. |
GMIME_OPENPGP_BEGIN_PGP_PRIVATE_KEY_BLOCK | The "-----BEGIN PGP PRIVATE KEY BLOCK-----" marker has been found. |
GMIME_OPENPGP_END_PGP_PRIVATE_KEY_BLOCK | The "-----END PGP PRIVATE KEY BLOCK-----" marker has been found. |

Since: 3.2

### GMimeOpenPGPMarker

    typedef struct {
    	const char *marker;
    	size_t len;
    	GMimeOpenPGPState before;
    	GMimeOpenPGPState after;
    	gboolean is_end_marker;
    } GMimeOpenPGPMarker;

An OpenPGP marker for use with GMime's internal state machines used for detecting OpenPGP blocks.

#### Members

const char *`marker`; | The OpenPGP marker. |
size_t `len`; | The length of the OpenPGP marker. |
GMimeOpenPGPState `before`; | The GMimeOpenPGPState that the state machine must be in before encountering this marker. |
GMimeOpenPGPState `after`; | The GMimeOpenPGPState that the state machine will transition into once this marker is found. |
gboolean `is_end_marker`; | `TRUE` if the marker is an end marker; otherwise, `FALSE`. |

Since: 3.2

### struct GMimeFilterOpenPGP

    struct GMimeFilterOpenPGP;

A filter to detect OpenPGP markers.

#### Members

Since: 3.2