pub struct Cookie {
value: Sensitive<Zeroizing<[u8; 32]>>,
}
Expand description
A secret cookie value, used in RPC authentication.
Fields§
§value: Sensitive<Zeroizing<[u8; 32]>>
The value of the cookie.
Implementations§
Source§impl Cookie
impl Cookie
Sourcepub fn load(
path: &Path,
mistrust: &Mistrust,
) -> Result<Cookie, CookieAccessError>
pub fn load( path: &Path, mistrust: &Mistrust, ) -> Result<Cookie, CookieAccessError>
Read an RPC cookie from a provided path.
Sourcepub fn create<R: CryptoRng + RngCore>(
path: &Path,
rng: &mut R,
mistrust: &Mistrust,
) -> Result<Cookie, CookieAccessError>
Available on crate feature rpc-server
only.
pub fn create<R: CryptoRng + RngCore>( path: &Path, rng: &mut R, mistrust: &Mistrust, ) -> Result<Cookie, CookieAccessError>
rpc-server
only.Create a new RPC cookie and store it at a provided path, overwriting any previous file at that location.
Sourcefn new_mac(&self) -> TupleHash
fn new_mac(&self) -> TupleHash
Return an appropriately personalized TupleHash instance, keyed from this cookie.
Sourcepub fn server_mac(
&self,
client_nonce: &CookieAuthNonce,
server_nonce: &CookieAuthNonce,
socket_canonical: &str,
) -> CookieAuthMac
pub fn server_mac( &self, client_nonce: &CookieAuthNonce, server_nonce: &CookieAuthNonce, socket_canonical: &str, ) -> CookieAuthMac
Compute the “server_mac” value as in the RPC cookie authentication protocol.
Sourcepub fn client_mac(
&self,
client_nonce: &CookieAuthNonce,
server_nonce: &CookieAuthNonce,
socket_canonical: &str,
) -> CookieAuthMac
pub fn client_mac( &self, client_nonce: &CookieAuthNonce, server_nonce: &CookieAuthNonce, socket_canonical: &str, ) -> CookieAuthMac
Compute the “client_mac” value as in the RPC cookie authentication protocol.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cookie
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more