-
-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust): improve
PurposeKey
and Credential
verification
- Loading branch information
1 parent
5c11568
commit d743363
Showing
9 changed files
with
158 additions
and
108 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
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
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
38 changes: 19 additions & 19 deletions
38
implementations/rust/ockam/ockam_identity/src/identity/verified_change.rs
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 |
---|---|---|
@@ -1,39 +1,39 @@ | ||
use super::super::models::ChangeHash; | ||
use super::super::models::{ChangeData, ChangeHash}; | ||
use ockam_vault::PublicKey; | ||
|
||
/// Verified Changes of an [`Identity`] | ||
#[derive(Clone, Debug)] | ||
pub struct VerifiedChange { | ||
data: ChangeData, | ||
change_hash: ChangeHash, | ||
primary_public_key: PublicKey, | ||
revoke_all_purpose_keys: bool, | ||
} | ||
|
||
impl VerifiedChange { | ||
/// [`ChangeHash`] | ||
pub fn change_hash(&self) -> &ChangeHash { | ||
&self.change_hash | ||
} | ||
|
||
/// [`PrimaryPublicKey`] | ||
pub fn primary_public_key(&self) -> &PublicKey { | ||
&self.primary_public_key | ||
} | ||
|
||
/// Are purpose keys revoked with this rotation | ||
pub fn revoke_all_purpose_keys(&self) -> bool { | ||
self.revoke_all_purpose_keys | ||
} | ||
|
||
pub(crate) fn new( | ||
data: ChangeData, | ||
change_hash: ChangeHash, | ||
primary_public_key: PublicKey, | ||
revoke_all_purpose_keys: bool, | ||
) -> Self { | ||
Self { | ||
data, | ||
change_hash, | ||
primary_public_key, | ||
revoke_all_purpose_keys, | ||
} | ||
} | ||
|
||
/// [`ChangeData`] | ||
pub fn data(&self) -> &ChangeData { | ||
&self.data | ||
} | ||
|
||
/// [`ChangeHash`] | ||
pub fn change_hash(&self) -> &ChangeHash { | ||
&self.change_hash | ||
} | ||
|
||
/// [`PrimaryPublicKey`] | ||
pub fn primary_public_key(&self) -> &PublicKey { | ||
&self.primary_public_key | ||
} | ||
} |
Oops, something went wrong.