summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/ucan_p256.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-03 18:19:22 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-11-03 18:19:22 -0700
commit95c05cc53c5b42b535cf70f8cee69c1a0be958b7 (patch)
treeafe00f175bf83228f319fbc214c0ba81f7cb6dfd /adenosine-pds/src/ucan_p256.rs
parent2004d5ea148b8b21cd0cffeb82fd8f07f52d1ba7 (diff)
downloadadenosine-95c05cc53c5b42b535cf70f8cee69c1a0be958b7.tar.gz
adenosine-95c05cc53c5b42b535cf70f8cee69c1a0be958b7.zip
pds: various bugfixes
Diffstat (limited to 'adenosine-pds/src/ucan_p256.rs')
-rw-r--r--adenosine-pds/src/ucan_p256.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/adenosine-pds/src/ucan_p256.rs b/adenosine-pds/src/ucan_p256.rs
index 9fe89ed..21e8a9a 100644
--- a/adenosine-pds/src/ucan_p256.rs
+++ b/adenosine-pds/src/ucan_p256.rs
@@ -66,8 +66,7 @@ mod tests {
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
async fn it_can_sign_and_verify_a_ucan() {
- let rng = rand::thread_rng();
- let private_key = P256PrivateKey::new(rng);
+ let private_key = P256PrivateKey::random(&mut p256::elliptic_curve::rand_core::OsRng);
let public_key = P256PublicKey::from(&private_key);
let key_material = P256KeyMaterial(public_key, Some(private_key));
@@ -85,7 +84,7 @@ mod tests {
let mut did_parser = DidParser::new(&[(P256_MAGIC_BYTES, bytes_to_p256_key)]);
- let ucan = Ucan::try_from(token_string).unwrap();
+ let ucan = Ucan::try_from_token_string(&token_string).unwrap();
ucan.check_signature(&mut did_parser).await.unwrap();
}
}