From 2391a6204aa3daa447efeafc295da85acebe2d64 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Mon, 27 Nov 2023 23:09:30 -0800 Subject: [PATCH] x509-cert: use `SubjectPublicKeyInfoOwned::from_key` --- x509-cert/src/builder.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x509-cert/src/builder.rs b/x509-cert/src/builder.rs index ec51a7e35..c778f1e2f 100644 --- a/x509-cert/src/builder.rs +++ b/x509-cert/src/builder.rs @@ -276,9 +276,7 @@ where cert_signer: &'s S, ) -> Result { let verifying_key = cert_signer.verifying_key(); - let signer_pub = verifying_key - .to_public_key_der()? - .decode_msg::()?; + let signer_pub = SubjectPublicKeyInfoOwned::from_key(verifying_key)?; let signature_alg = cert_signer.signature_algorithm_identifier()?; let issuer = profile.get_issuer(&subject); @@ -370,9 +368,7 @@ where pub fn new(subject: Name, req_signer: &'s S) -> Result { let version = Default::default(); let verifying_key = req_signer.verifying_key(); - let public_key = verifying_key - .to_public_key_der()? - .decode_msg::()?; + let public_key = SubjectPublicKeyInfoOwned::from_key(verifying_key)?; let attributes = Default::default(); let extension_req = Default::default();