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.
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<SessionSk> for SessionSk
impl PartialEq<SessionSk> for SessionSk
impl Eq for SessionSk
impl StructuralEq for SessionSk
impl StructuralPartialEq for SessionSk
Auto Trait Implementations§
impl RefUnwindSafe for SessionSk
impl Send for SessionSk
impl Sync for SessionSk
impl Unpin for SessionSk
impl UnwindSafe for SessionSk
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more