Skip to content

Commit

Permalink
x509-cert: use SubjectPublicKeyInfoOwned::from_key
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Nov 28, 2023
1 parent 92d4f3f commit 2391a62
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions x509-cert/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ where
cert_signer: &'s S,
) -> Result<Self> {
let verifying_key = cert_signer.verifying_key();
let signer_pub = verifying_key
.to_public_key_der()?
.decode_msg::<SubjectPublicKeyInfoOwned>()?;
let signer_pub = SubjectPublicKeyInfoOwned::from_key(verifying_key)?;

let signature_alg = cert_signer.signature_algorithm_identifier()?;
let issuer = profile.get_issuer(&subject);
Expand Down Expand Up @@ -370,9 +368,7 @@ where
pub fn new(subject: Name, req_signer: &'s S) -> Result<Self> {
let version = Default::default();
let verifying_key = req_signer.verifying_key();
let public_key = verifying_key
.to_public_key_der()?
.decode_msg::<SubjectPublicKeyInfoOwned>()?;
let public_key = SubjectPublicKeyInfoOwned::from_key(verifying_key)?;
let attributes = Default::default();
let extension_req = Default::default();

Expand Down

0 comments on commit 2391a62

Please sign in to comment.