sos_login/
private_identity.rs

1//! Private identity manages the identity vault,
2//! account signing key, device signing key and delegated
3//! passwords.
4use sos_core::AccountId;
5
6/// Private identity containing the in-memory identity vault
7/// and signing keys.
8pub struct PrivateIdentity {
9    /// Account identifier.
10    pub(super) account_id: AccountId,
11    /// AGE identity keypair.
12    #[allow(dead_code)]
13    pub(super) shared_private: age::x25519::Identity,
14    /// AGE recipient public key.
15    pub(super) shared_public: age::x25519::Recipient,
16}
17
18impl PrivateIdentity {
19    /// Account identifier.
20    pub fn account_id(&self) -> &AccountId {
21        &self.account_id
22    }
23
24    /// Recipient public key for sharing.
25    pub fn recipient(&self) -> &age::x25519::Recipient {
26        &self.shared_public
27    }
28}