Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x509-cert: use SubjectPublicKeyInfoOwned::from_key #1271

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x509-cert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rust-version = "1.65"
[dependencies]
const-oid = { version = "0.9.3", features = ["db"] }
der = { version = "0.7.6", features = ["alloc", "derive", "flagset", "oid"] }
spki = { version = "0.7.2", features = ["alloc"] }
spki = { version = "0.7.3", features = ["alloc"] }

# optional dependencies
arbitrary = { version = "1.3", features = ["derive"], optional = true }
Expand Down
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