Skip to content

Commit

Permalink
feat: expose KeyPackageIn::credential
Browse files Browse the repository at this point in the history
  • Loading branch information
beltram committed Jan 25, 2024
1 parent ecd0363 commit dd6a152
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openmls/src/key_packages/key_package_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mod private_mod {
/// } KeyPackageTBS;
/// ```
#[derive(
Debug, Clone, PartialEq, TlsSize, TlsSerialize, TlsDeserialize, Serialize, Deserialize,
Debug, Clone, PartialEq, TlsSize, TlsSerialize, TlsDeserialize, Serialize, Deserialize,
)]
struct KeyPackageTbsIn {
protocol_version: ProtocolVersion,
Expand All @@ -86,7 +86,7 @@ struct KeyPackageTbsIn {

/// The key package struct.
#[derive(
Debug, PartialEq, Clone, Serialize, Deserialize, TlsSerialize, TlsDeserialize, TlsSize,
Debug, PartialEq, Clone, Serialize, Deserialize, TlsSerialize, TlsDeserialize, TlsSize,
)]
pub struct KeyPackageIn {
payload: KeyPackageTbsIn,
Expand Down Expand Up @@ -194,6 +194,10 @@ impl KeyPackageIn {
pub(crate) fn is_version_supported(&self, protocol_version: ProtocolVersion) -> bool {
self.payload.protocol_version == protocol_version
}

pub fn credential(&self) -> &Credential {
self.payload.leaf_node.credential()
}
}

impl From<KeyPackageTbsIn> for KeyPackageTbs {
Expand Down

0 comments on commit dd6a152

Please sign in to comment.