fix(cli): remove EncodePrivateKey workaround
With the implementation of `EncodePrivateKey` for `SigningKey` a
workaround can be removed.
@@ -7,10 +7,8 @@ use std::io::stdout;
use camino::Utf8PathBuf;
use clap::Args;
-use elliptic_curve::SecretKey;
use p384::ecdsa::SigningKey;
-use p384::pkcs8::LineEnding;
-use p384::{elliptic_curve, pkcs8, NistP384};
+use p384::pkcs8::{self, LineEnding};
use pkcs8::EncodePrivateKey;
/// Generate an SEV key for use with Enarx.
@@ -26,10 +24,7 @@ impl Options {
let rng = rand::thread_rng();
let signing_key = SigningKey::random(rng);
- // somehow SigningKey does not implement EncodePrivateKey
- // so create a SecretKey and use it to encode the key
- let key: SecretKey<NistP384> = SecretKey::from_be_bytes(signing_key.to_bytes().as_slice())?;
- let res_key = key.to_pkcs8_pem(LineEnding::default())?;
+ let res_key = signing_key.to_pkcs8_pem(LineEnding::default())?;
if let Some(path) = self.out {
let mut file = File::create(path)?;
