Struct buildsrs_protocol::signature::SignedMessage
source · pub struct SignedMessage<T> {
pub message: T,
pub signature: String,
}
Expand description
Message which has been signed with a cryptographic signature.
Fields§
§message: T
Message
signature: String
Signature, created from SSH key.
Implementations§
source§impl<T: Serialize> SignedMessage<T>
impl<T: Serialize> SignedMessage<T>
sourcepub fn new(key: &PrivateKey, message: T) -> Result<Self, SignatureError>
pub fn new(key: &PrivateKey, message: T) -> Result<Self, SignatureError>
Create new signed message.
sourcepub fn verify(&self, key: &PublicKey) -> Result<(), SignatureError>
pub fn verify(&self, key: &PublicKey) -> Result<(), SignatureError>
Verify that this message was signed by the supplied public key.
Trait Implementations§
source§impl<T: Clone> Clone for SignedMessage<T>
impl<T: Clone> Clone for SignedMessage<T>
source§fn clone(&self) -> SignedMessage<T>
fn clone(&self) -> SignedMessage<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for SignedMessage<T>
impl<T: Debug> Debug for SignedMessage<T>
source§impl<'de, T> Deserialize<'de> for SignedMessage<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SignedMessage<T>where
T: Deserialize<'de>,
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
Auto Trait Implementations§
impl<T> RefUnwindSafe for SignedMessage<T>where
T: RefUnwindSafe,
impl<T> Send for SignedMessage<T>where
T: Send,
impl<T> Sync for SignedMessage<T>where
T: Sync,
impl<T> Unpin for SignedMessage<T>where
T: Unpin,
impl<T> UnwindSafe for SignedMessage<T>where
T: UnwindSafe,
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