Skip to content

Commit

Permalink
allow to construct SsiPair from SsiSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jun 23, 2024
1 parent 631666a commit ce77fb7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ pub struct SsiPair {
pub expiry: Option<DateTime<Utc>>,
}

impl From<SsiSecret> for SsiPair {
fn from(sk: SsiSecret) -> Self {
SsiPair {
pk: sk.to_public(),
sk,
expiry: None,
}
}
}

impl SsiPair {
pub fn new(ssi: Ssi, sk: SsiSecret) -> Self {
SsiPair {
Expand Down

0 comments on commit ce77fb7

Please sign in to comment.