pub struct BrokerRecipient { /* private fields */ }Expand description
A recipient backed by the broker AeadService.UnsealCose RPC.
The adapter forwards the exact embedded tagged COSE_Encrypt bytes from
OpenRequest::cose_encrypt to the broker. It never parses and re-encodes
the message, preserving the protected-header bytes bound by COSE AAD.
Implementations§
Source§impl BrokerRecipient
impl BrokerRecipient
Sourcepub fn new(
client: Arc<Mutex<Client>>,
key_id: &str,
) -> Result<Self, SealedInvocationError>
pub fn new( client: Arc<Mutex<Client>>, key_id: &str, ) -> Result<Self, SealedInvocationError>
Build a broker-backed recipient for key_id.
§Errors
Returns SealedInvocationError::Profile if key_id is outside the
COSE kid bounds.
Sourcepub fn unseal_cose_request(
&self,
request: &OpenRequest<'_>,
) -> Result<UnsealCoseRequest, OpenError>
pub fn unseal_cose_request( &self, request: &OpenRequest<'_>, ) -> Result<UnsealCoseRequest, OpenError>
Build the exact UnsealCose request this recipient would send.
This is primarily useful for tests and for callers that need to inspect broker request construction without performing the RPC.
§Errors
Returns OpenError::RecipientKeyMismatch if this recipient’s key id
is not a UTF-8 catalog name.
Sourcepub fn unseal_cose_request_for(
key_id: &KeyId,
request: &OpenRequest<'_>,
) -> Result<UnsealCoseRequest, OpenError>
pub fn unseal_cose_request_for( key_id: &KeyId, request: &OpenRequest<'_>, ) -> Result<UnsealCoseRequest, OpenError>
Build an UnsealCose request for key_id without requiring a client.
This is the pure request-construction half of the broker-backed recipient and is useful in tests for checking that exact COSE bytes are forwarded.
§Errors
Returns OpenError::RecipientKeyMismatch if key_id is not a UTF-8
catalog name.
Trait Implementations§
Source§impl Clone for BrokerRecipient
impl Clone for BrokerRecipient
Source§fn clone(&self) -> BrokerRecipient
fn clone(&self) -> BrokerRecipient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BrokerRecipient
impl !UnwindSafe for BrokerRecipient
impl Freeze for BrokerRecipient
impl Send for BrokerRecipient
impl Sync for BrokerRecipient
impl Unpin for BrokerRecipient
impl UnsafeUnpin for BrokerRecipient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
T in a tonic::Request