diff options
Diffstat (limited to 'adenosine-pds/src/ucan_p256.rs')
-rw-r--r-- | adenosine-pds/src/ucan_p256.rs | 5 |
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(); } } |