[−][src]Struct cashweb_relay::ParsedMessage
Represents a Message post-parsing.
Fields
source_public_key: PublicKey
The source public key.
destination_public_key: PublicKey
The destinations public key.
received_time: i64
Maleable server time.
payload_digest: [u8; 32]
The SHA-256 digest of the payload.
stamp: Stamp
The stamp attached to the message.
scheme: EncryptionScheme
The encryption scheme used on the serialized Payload
to produce the payload
field.
salt: Vec<u8>
The salt
is used to salt both the payload_hmac
and the encryption key.
payload_hmac: [u8; 32]
The HMAC of the payload
, specifically HMAC(HMAC(sdG, salt), payload_digest)
payload_size: u64
The size, in bytes, of the payload
.
payload: Vec<u8>
The encrypted payload
.
Implementations
impl ParsedMessage
[src]
pub fn into_message(self) -> Message
[src]
Convert ParsedMessage
into a Message
.
impl ParsedMessage
[src]
pub fn create_merged_key(
&self,
private_key: &[u8]
) -> Result<PublicKey, SecpError>
[src]
&self,
private_key: &[u8]
) -> Result<PublicKey, SecpError>
Calculate the merged key from the destination private key.
pub fn create_shared_key(
&self,
private_key: &[u8],
salt: &[u8]
) -> Result<[u8; 32], SecpError>
[src]
&self,
private_key: &[u8],
salt: &[u8]
) -> Result<[u8; 32], SecpError>
Create the shared key from the destination private key, a salt, and a list of HKDF info.
pub fn authenticate(&self, shared_key: &[u8; 32]) -> Result<(), InvalidHmac>
[src]
Authenticate the HMAC payload and return the merged key.
pub fn verify_stamp(&self) -> Result<Vec<Transaction>, StampError>
[src]
Verify the stamp on the message and return the decoded transactions.
pub fn open_in_place(&mut self, private_key: &[u8]) -> Result<Opened, OpenError>
[src]
Verify the stamp, authenticate the HMAC payload, and then decrypt and decode the payload.
This is done in-place, replacing the encrypted payload
field with the plain text.
pub fn open(&self, private_key: &[u8]) -> Result<Opened, OpenError>
[src]
Verify the stamp, authenticate the HMAC payload, and then decrypt and decode the payload.
Trait Implementations
impl Clone for ParsedMessage
[src]
fn clone(&self) -> ParsedMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ParsedMessage
[src]
impl PartialEq<ParsedMessage> for ParsedMessage
[src]
fn eq(&self, other: &ParsedMessage) -> bool
[src]
fn ne(&self, other: &ParsedMessage) -> bool
[src]
impl StructuralPartialEq for ParsedMessage
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParsedMessage
impl Send for ParsedMessage
impl Sync for ParsedMessage
impl Unpin for ParsedMessage
impl UnwindSafe for ParsedMessage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,