Skip to content

Commit a547b57

Browse files
committed
fixup! working ecdsa keys
1 parent fef773e commit a547b57

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

crates/core/tedge/src/cli/certificate/create_key.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use anyhow::Context;
22
use camino::Utf8PathBuf;
33
use certificate::CsrTemplate;
44
use clap::ValueEnum;
5-
use elliptic_curve::sec1::{EncodedPoint, FromEncodedPoint};
5+
use elliptic_curve::sec1::EncodedPoint;
6+
use elliptic_curve::sec1::FromEncodedPoint;
67
use tedge_config::TEdgeConfig;
7-
use tedge_p11_server::pkcs11::{CreateKeyParams, KeyTypeParams};
8-
use tedge_p11_server::CryptokiConfig;
8+
use tedge_p11_server::pkcs11::CreateKeyParams;
9+
use tedge_p11_server::pkcs11::KeyTypeParams;
910

1011
use crate::cli::common::Cloud;
1112
use crate::command::Command;
@@ -76,8 +77,8 @@ impl Command for CreateKeyCmd {
7677
.into_option()
7778
.context("Failed to create EC pubkey from EncodedPoint")?;
7879
let der = pubkey.to_sec1_bytes();
79-
let pubkey_pem = pem::Pem::new("PUBLIC KEY", der);
80-
pubkey_pem
80+
81+
pem::Pem::new("PUBLIC KEY", der)
8182
}
8283
384 => {
8384
let ec_point = EncodedPoint::<p384::NistP384>::from_bytes(&pubkey_der[2..])
@@ -89,8 +90,8 @@ impl Command for CreateKeyCmd {
8990
.into_option()
9091
.context("Failed to create EC pubkey from EncodedPoint")?;
9192
let der = pubkey.to_sec1_bytes();
92-
let pubkey_pem = pem::Pem::new("PUBLIC KEY", der);
93-
pubkey_pem
93+
94+
pem::Pem::new("PUBLIC KEY", der)
9495
}
9596
_ => return Err(anyhow::anyhow!("aaaa").into()),
9697
};

0 commit comments

Comments
 (0)