| Top |
Discovery snapshots transfer-decoded bytes without charset conversion, flowed-text processing, cryptography, or key import. A document retains the entire source, including unprotected gaps and malformed candidates. Blocks and opened read-only streams can outlive the document and part.
Snapshots larger than 1 MiB spill to a private temporary file, removed when the last document, block, or stream releases it. This bounds snapshot memory, not disk usage or the per-block metadata. Temporary-file creation and I/O failures are reported, never replaced with truncated results.
Only exact, unquoted armor markers at line starts are recognized. LF, CRLF, and a final marker at EOF are supported. A new beginning interrupts an unfinished block, except for the signature within a clear-signed block. Unexpected end markers terminate a candidate as malformed. Unmatched end markers and unknown armor types remain ordinary source bytes.
Native verification/decryption are declared in gmime-gpgme.h. Protection applies only to each processed payload, not adjacent blocks, unprotected gaps, MIME headers, or the document as a whole.
GMimeOpenPGPDocument * g_mime_part_scan_openpgp (GMimePart *part,GError **error);
Snapshots all transfer-decoded bytes and discovers independent blocks. Does not modify content or headers, but reading may reposition the backing content stream. No cryptographic operations or key imports are performed. Missing content and I/O failures are errors; no candidates is a successful, empty document whose source remains accessible.
gint64
g_mime_openpgp_document_get_length (GMimeOpenPGPDocument *document);
guint
g_mime_openpgp_document_get_count (GMimeOpenPGPDocument *document);
GMimeOpenPGPBlock * g_mime_openpgp_document_get_block (GMimeOpenPGPDocument *document,guint index);
GMimeStream *
g_mime_openpgp_document_open_stream (GMimeOpenPGPDocument *document);
Opens an independently positioned, read-only view of the entire source. Use substreams to read unprotected gaps. The stream retains its storage; read failures are reported through errno, as for other GMime streams.
GMimeOpenPGPBlockKind
g_mime_openpgp_block_get_kind (GMimeOpenPGPBlock *block);
GMimeOpenPGPBlockStatus
g_mime_openpgp_block_get_status (GMimeOpenPGPBlock *block);
gint64
g_mime_openpgp_block_get_offset (GMimeOpenPGPBlock *block);
gint64
g_mime_openpgp_block_get_length (GMimeOpenPGPBlock *block);
GMimeStream *
g_mime_openpgp_block_open_stream (GMimeOpenPGPBlock *block);
Opens an independent read-only view, including original malformed bytes.
Coordinates start at zero for this block, not at its document offset.
Substreams use absolute coordinates within this view, as usual for GMime.
The stream retains its storage independently of block
.
typedef struct _GMimeOpenPGPDocument GMimeOpenPGPDocument;
An immutable decoded snapshot, including unprotected gaps. Implements GListModel with GMimeOpenPGPBlock items in source order.
typedef struct _GMimeOpenPGPBlock GMimeOpenPGPBlock;
An immutable candidate block in a transfer-decoded snapshot.
The observed armor type, not a cryptographic assertion.