mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-22 07:24:48 +02:00
fix(tee-key-preexec): export the key in PEM
makes it easier to import Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
60b75938ff
commit
d77243b8fd
1 changed files with 3 additions and 2 deletions
|
@ -7,8 +7,9 @@
|
||||||
#![deny(clippy::all)]
|
#![deny(clippy::all)]
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use hex::ToHex;
|
|
||||||
use k256::ecdsa::SigningKey;
|
use k256::ecdsa::SigningKey;
|
||||||
|
use k256::pkcs8::{EncodePrivateKey, LineEnding};
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::os::unix::process::CommandExt;
|
use std::os::unix::process::CommandExt;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
@ -39,7 +40,7 @@ fn main_with_error() -> Result<()> {
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
let signing_key = SigningKey::random(&mut rng);
|
let signing_key = SigningKey::random(&mut rng);
|
||||||
let verifying_key_bytes = signing_key.verifying_key().to_sec1_bytes();
|
let verifying_key_bytes = signing_key.verifying_key().to_sec1_bytes();
|
||||||
let signing_key_string = signing_key.to_bytes().encode_hex::<String>();
|
let signing_key_string = signing_key.to_pkcs8_pem(LineEnding::LF)?;
|
||||||
let tee_type = match get_quote(&verifying_key_bytes) {
|
let tee_type = match get_quote(&verifying_key_bytes) {
|
||||||
Ok(quote) => {
|
Ok(quote) => {
|
||||||
// save quote to file
|
// save quote to file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue