Skip to content

Commit

Permalink
Use different class for private key in gen_vapid_key()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaleb-Reid authored Dec 6, 2024
1 parent 637585b commit 1249ff1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vapid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ fn get_signer(private_bytes: &str) -> Result<SignerWithPubKey> {
Generate a new VAPID key.
*/
pub fn gen_vapid_key() -> String {
let key = PKey::ec_gen("P-256").unwrap();
URL_SAFE_NO_PAD.encode(key.ec_key().unwrap().private_key().to_vec())
let key = EcKey::generate(&EcGroup::from_curve_name(Nid::X9_62_PRIME256V1).unwrap());
URL_SAFE_NO_PAD.encode(key.unwrap().private_key().to_vec())
}

#[cfg(test)]
Expand Down

0 comments on commit 1249ff1

Please sign in to comment.