Struct rings_core::session::SessionSk
source · pub struct SessionSk { /* private fields */ }Expand description
SessionSk holds the Session and its session private key. To prove that the message was sent by the Account of Session, we need to attach session and the signature signed by sk to the payload.
SessionSk provide a session method to clone the session.
SessionSk also provide sign method to sign a message.
To verify the session, use verify_self() method of Session.
To verify a message, use verify(msg, sig) method of Session.
Implementations§
source§impl SessionSk
impl SessionSk
sourcepub fn new_with_seckey(key: &SecretKey) -> Result<Self>
pub fn new_with_seckey(key: &SecretKey) -> Result<Self>
Generate Session with private key. Only use it for unittest. To protect your private key, please use SessionSkBuilder to generate session.
sourcepub fn account_did(&self) -> Did
pub fn account_did(&self) -> Did
Get account did from session.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SessionSk
impl<'de> Deserialize<'de> for SessionSk
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for SessionSk
impl PartialEq for SessionSk
impl Eq for SessionSk
impl StructuralPartialEq for SessionSk
Auto Trait Implementations§
impl Freeze for SessionSk
impl RefUnwindSafe for SessionSk
impl Send for SessionSk
impl Sync for SessionSk
impl Unpin for SessionSk
impl UnwindSafe for SessionSk
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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