aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/crypto.rs
diff options
context:
space:
mode:
Diffstat (limited to 'adenosine-pds/src/crypto.rs')
-rw-r--r--adenosine-pds/src/crypto.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/adenosine-pds/src/crypto.rs b/adenosine-pds/src/crypto.rs
index d1a864e..e10401a 100644
--- a/adenosine-pds/src/crypto.rs
+++ b/adenosine-pds/src/crypto.rs
@@ -76,16 +76,14 @@ impl KeyPair {
}
pub fn from_hex(hex: &str) -> Result<Self> {
- Ok(Self::from_bytes(
- &data_encoding::HEXUPPER.decode(hex.as_bytes())?,
- )?)
+ Self::from_bytes(&data_encoding::HEXUPPER.decode(hex.as_bytes())?)
}
}
async fn build_ucan(key_material: P256KeyMaterial, did: &Did) -> Result<String> {
let token_string = UcanBuilder::default()
.issued_by(&key_material)
- .for_audience(&did.to_string())
+ .for_audience(did)
.with_nonce()
.with_lifetime(60 * 60 * 24 * 90)
.build()?
@@ -136,7 +134,7 @@ impl PubKey {
bytes.extend_from_slice(&key.to_bytes());
}
}
- format!("{}", multibase::encode(multibase::Base::Base58Btc, &bytes))
+ multibase::encode(multibase::Base::Base58Btc, &bytes)
}
/// Serializes as a 'did:key' string.