Skip to content

Commit

Permalink
Enable signing with PublicKeyData
Browse files Browse the repository at this point in the history
  • Loading branch information
kwantam authored and djc committed Sep 24, 2024
1 parent c3e516f commit fb10501
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rcgen/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl CertificateParams {
/// [`Certificate::pem`].
pub fn signed_by(
self,
key_pair: &KeyPair,
public_key: &impl PublicKeyData,
issuer: &Certificate,
issuer_key: &KeyPair,
) -> Result<Certificate, Error> {
Expand All @@ -160,8 +160,9 @@ impl CertificateParams {
key_pair: issuer_key,
};

let subject_public_key_info = key_pair.public_key_der();
let der = self.serialize_der_with_signer(key_pair, issuer)?;
let subject_public_key_info =
yasna::construct_der(|writer| serialize_public_key_der(public_key, writer));
let der = self.serialize_der_with_signer(public_key, issuer)?;
Ok(Certificate {
params: self,
subject_public_key_info,
Expand Down

0 comments on commit fb10501

Please sign in to comment.