pub struct ContentEncryptionKey { /* private fields */ }Expand description
A named AES-256-GCM key. Debug output deliberately omits the key material.
Implementations§
Source§impl ContentEncryptionKey
impl ContentEncryptionKey
pub fn new( id: impl Into<String>, bytes: [u8; 32], ) -> Result<Self, ContentEncryptionError>
pub fn id(&self) -> &str
Sourcepub fn encrypt_request(
&self,
method: &Method,
uri: &Uri,
plaintext: &[u8],
) -> Result<String, ContentEncryptionError>
pub fn encrypt_request( &self, method: &Method, uri: &Uri, plaintext: &[u8], ) -> Result<String, ContentEncryptionError>
Encodes a request body using the middleware’s documented wire format.
pub fn decrypt_request( &self, method: &Method, uri: &Uri, encoded: &[u8], ) -> Result<Bytes, ContentEncryptionError>
pub fn encrypt_response( &self, method: &Method, uri: &Uri, status: StatusCode, plaintext: &[u8], ) -> Result<String, ContentEncryptionError>
pub fn decrypt_response( &self, method: &Method, uri: &Uri, status: StatusCode, encoded: &[u8], ) -> Result<Bytes, ContentEncryptionError>
Trait Implementations§
Source§impl Clone for ContentEncryptionKey
impl Clone for ContentEncryptionKey
Source§fn clone(&self) -> ContentEncryptionKey
fn clone(&self) -> ContentEncryptionKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentEncryptionKey
impl Debug for ContentEncryptionKey
impl Eq for ContentEncryptionKey
Source§impl PartialEq for ContentEncryptionKey
impl PartialEq for ContentEncryptionKey
impl StructuralPartialEq for ContentEncryptionKey
Auto Trait Implementations§
impl Freeze for ContentEncryptionKey
impl RefUnwindSafe for ContentEncryptionKey
impl Send for ContentEncryptionKey
impl Sync for ContentEncryptionKey
impl Unpin for ContentEncryptionKey
impl UnsafeUnpin for ContentEncryptionKey
impl UnwindSafe for ContentEncryptionKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request