Skip to content

Commit

Permalink
tls: support multiple private key formats
Browse files Browse the repository at this point in the history
  • Loading branch information
picoHz committed May 7, 2024
1 parent da0e694 commit 212533e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions taxy/src/certs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ impl Cert {
let key = key
.decode_msg::<PrivateKeyInfo>()
.map_err(|err| anyhow::anyhow!("{err}"))?;
let signing_key = sign::any_supported_type(&PrivateKeyDer::Sec1(key.private_key.into()))
.map_err(|err| anyhow::anyhow!("{err}"))?;
let key =
PrivateKeyDer::try_from(key.private_key).map_err(|err| anyhow::anyhow!("{err}"))?;
let signing_key = sign::any_supported_type(&key).map_err(|err| anyhow::anyhow!("{err}"))?;
let chain = self.certificates()?;
Ok(CertifiedKey::new(chain, signing_key))
}
Expand Down

0 comments on commit 212533e

Please sign in to comment.