pub struct HttpSealer { /* private fields */ }Expand description
High-level helper for sealing HTTP bodies, requests, and responses.
Implementations§
Source§impl HttpSealer
impl HttpSealer
Sourcepub fn new(options: HttpSealOptions) -> Self
pub fn new(options: HttpSealOptions) -> Self
Creates a sealer with default HTTP behavior.
Sourcepub fn with_config(options: HttpSealOptions, config: HttpConfig) -> Self
pub fn with_config(options: HttpSealOptions, config: HttpConfig) -> Self
Creates a sealer with explicit HTTP behavior.
Sourcepub fn options(&self) -> &HttpSealOptions
pub fn options(&self) -> &HttpSealOptions
Returns the sealing options.
Sourcepub fn config(&self) -> &HttpConfig
pub fn config(&self) -> &HttpConfig
Returns the HTTP behavior config.
Sourcepub fn seal_body(&self, plaintext: &[u8]) -> Result<Vec<u8>, HttpError>
pub fn seal_body(&self, plaintext: &[u8]) -> Result<Vec<u8>, HttpError>
Seals raw plaintext bytes into an application/foctet body.
Sourcepub fn seal_request(
&self,
request: Request<Vec<u8>>,
) -> Result<Request<Vec<u8>>, HttpError>
pub fn seal_request( &self, request: Request<Vec<u8>>, ) -> Result<Request<Vec<u8>>, HttpError>
Seals a plaintext request and sets Content-Type: application/foctet.
By default this also adds the advisory x-foctet-scope: body-only
header so downstream consumers do not mistake body protection for
full HTTP message protection.
Sourcepub fn seal_response(
&self,
response: Response<Vec<u8>>,
) -> Result<Response<Vec<u8>>, HttpError>
pub fn seal_response( &self, response: Response<Vec<u8>>, ) -> Result<Response<Vec<u8>>, HttpError>
Seals a plaintext response and sets Content-Type: application/foctet.
By default this also adds the advisory x-foctet-scope: body-only
header so downstream consumers do not mistake body protection for
full HTTP message protection.
Trait Implementations§
Source§impl Clone for HttpSealer
impl Clone for HttpSealer
Source§fn clone(&self) -> HttpSealer
fn clone(&self) -> HttpSealer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpSealer
impl RefUnwindSafe for HttpSealer
impl Send for HttpSealer
impl Sync for HttpSealer
impl Unpin for HttpSealer
impl UnsafeUnpin for HttpSealer
impl UnwindSafe for HttpSealer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more