Skip to content

Commit

Permalink
derive Debug for non-sensitive types
Browse files Browse the repository at this point in the history
Adds a `#[derive(Debug)]` to:

* `Certificate`
* `CertificateRevocationList`
* `CertificateRevocationListParams`
* `CrlIssuingDistributionPoint`
* `RevokedCertParams`
* `CertificateSigningRequest`
* `CertificateSigningRequestParams`
  • Loading branch information
cpu committed Feb 19, 2025
1 parent 5a0e2bf commit 9822af6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions rcgen/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate::{
};

/// An issued certificate together with the parameters used to generate it.
#[derive(Debug)]
pub struct Certificate {
pub(crate) params: CertificateParams,
pub(crate) subject_public_key_info: Vec<u8>,
Expand Down
4 changes: 4 additions & 0 deletions rcgen/src/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ use crate::{
/// key_identifier_method: KeyIdMethod::PreSpecified(vec![]),
/// }.signed_by(&issuer, &key_pair).unwrap();
///# }
#[derive(Debug)]
pub struct CertificateRevocationList {
params: CertificateRevocationListParams,
der: CertificateRevocationListDer<'static>,
Expand Down Expand Up @@ -162,6 +163,7 @@ pub enum RevocationReason {
}

/// Parameters used for certificate revocation list (CRL) generation
#[derive(Debug)]
pub struct CertificateRevocationListParams {
/// Issue date of the CRL.
pub this_update: OffsetDateTime,
Expand Down Expand Up @@ -302,6 +304,7 @@ impl CertificateRevocationListParams {

/// A certificate revocation list (CRL) issuing distribution point, to be included in a CRL's
/// [issuing distribution point extension](https://datatracker.ietf.org/doc/html/rfc5280#section-5.2.5).
#[derive(Debug)]
pub struct CrlIssuingDistributionPoint {
/// The CRL's distribution point, containing a sequence of URIs the CRL can be retrieved from.
pub distribution_point: CrlDistributionPoint,
Expand Down Expand Up @@ -344,6 +347,7 @@ pub enum CrlScope {
}

/// Parameters used for describing a revoked certificate included in a [`CertificateRevocationList`].
#[derive(Debug)]
pub struct RevokedCertParams {
/// Serial number identifying the revoked certificate.
pub serial_number: SerialNumber,
Expand Down
2 changes: 2 additions & 0 deletions rcgen/src/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl PublicKeyData for PublicKey {
}

/// A certificate signing request (CSR) that can be encoded to PEM or DER.
#[derive(Debug)]
pub struct CertificateSigningRequest {
pub(crate) der: CertificateSigningRequestDer<'static>,
}
Expand Down Expand Up @@ -66,6 +67,7 @@ impl From<CertificateSigningRequest> for CertificateSigningRequestDer<'static> {
}

/// Parameters for a certificate signing request
#[derive(Debug)]
pub struct CertificateSigningRequestParams {
/// Parameters for the certificate to be signed.
pub params: CertificateParams,
Expand Down

0 comments on commit 9822af6

Please sign in to comment.