Skip to content

Commit

Permalink
Allow taking owned pki-types out of wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Mar 20, 2024
1 parent eb146cc commit c9b6129
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rcgen/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ impl Certificate {
}
}

impl From<Certificate> for CertificateDer<'static> {
fn from(cert: Certificate) -> Self {
cert.der
}
}

/// Parameters used for certificate generation
#[allow(missing_docs)]
#[non_exhaustive]
Expand Down
6 changes: 6 additions & 0 deletions rcgen/src/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ impl CertificateRevocationList {
}
}

impl From<CertificateRevocationList> for CertificateRevocationListDer<'static> {
fn from(crl: CertificateRevocationList) -> Self {
crl.der
}
}

/// A certificate revocation list (CRL) distribution point, to be included in a certificate's
/// [distribution points extension](https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.13) or
/// a CRL's [issuing distribution point extension](https://datatracker.ietf.org/doc/html/rfc5280#section-5.2.5)
Expand Down
6 changes: 6 additions & 0 deletions rcgen/src/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ impl CertificateSigningRequest {
}
}

impl From<CertificateSigningRequest> for CertificateSigningRequestDer<'static> {
fn from(csr: CertificateSigningRequest) -> Self {
csr.der
}
}

/// Parameters for a certificate signing request
pub struct CertificateSigningRequestParams {
/// Parameters for the certificate to be signed.
Expand Down

0 comments on commit c9b6129

Please sign in to comment.