//! Streaming decryption and verification.
//!
//! This module provides convenient filters for decryption and
//! verification of OpenPGP messages. It is the preferred interface to
//! process OpenPGP messages. These implementations use constant
//! space.
//!
//! Wraps the streaming parsing functions, see
//! [`sequoia-openpgp::parse::stream`].
//!
//! [`sequoia-openpgp::parse::stream`]: ../../../../sequoia_openpgp/parse/stream/index.html
use std::ptr;
use libc::{c_int, c_void, time_t};
use sequoia_openpgp as openpgp;
use self::openpgp::{
cert::prelude::*,
crypto::SessionKey,
types::SymmetricAlgorithm,
packet::{
PKESK,
SKESK,
},
parse::Parse,
};
use self::openpgp::parse::stream::{
self,
DecryptionHelper,
DecryptorBuilder,
VerificationHelper,
VerifierBuilder,
};
use crate::Maybe;
use crate::MoveFromRaw;
use crate::MoveIntoRaw;
use crate::MoveResultIntoRaw;
use crate::RefRaw;
use crate::RefMutRaw;
use crate::maybe_time;
use super::super::{
error::{Error, Status},
crypto,
io,
keyid,
cert::Cert,
packet::signature::Signature,
packet::key::Key,
parse::PacketParser,
policy::Policy,
revocation_status::RevocationStatus,
};
/// Communicates the message structure to the VerificationHelper.
#[crate::ffi_wrapper_type(prefix = "pgp_", derive = "Debug")]
pub struct MessageStructure<'a>(stream::MessageStructure<'a>);
/// Iterates over the message structure.
#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C"
fn pgp_message_structure_into_iter(structure: *mut MessageStructure)
-> *mut MessageStructureIter {
structure.move_from_raw().into_iter().move_into_raw()
}
/// Iterates over the message structure.
#[crate::ffi_wrapper_type(prefix = "pgp_", derive = "Iterator(MessageLayer)")]
pub struct MessageStructureIter<'a>(