forked from openmls/openmls
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from openmls/cryspen/protected-metadata3
Add Mutable and Immutable Metadata
- Loading branch information
Showing
8 changed files
with
236 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use super::{Deserialize, Serialize}; | ||
use tls_codec::{TlsDeserialize, TlsSerialize, TlsSize}; | ||
|
||
/// Metadata is an extension that keeps arbitrary application-specific metadata, in the form of a | ||
/// byte sequence. The application is responsible for specifying a format and parsing the contents. | ||
#[derive( | ||
PartialEq, Eq, Clone, Debug, Serialize, Deserialize, TlsDeserialize, TlsSerialize, TlsSize, | ||
)] | ||
pub struct Metadata { | ||
metadata: Vec<u8>, | ||
} | ||
|
||
impl Metadata { | ||
/// Create a new [`Metadata`] extension. | ||
pub fn new(metadata: Vec<u8>) -> Self { | ||
Self { metadata } | ||
} | ||
|
||
/// Get the metadata bytes. | ||
pub fn metadata(&self) -> &Vec<u8> { | ||
&self.metadata | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.