Skip to content

Commit 26cede4

Browse files
author
Ryan van Polen
committed
Eagerly implemented Debug trait
1 parent cc1f8e2 commit 26cede4

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

rcgen/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub mod string;
8787
pub type RcgenError = Error;
8888

8989
/// An issued certificate, together with the subject keypair.
90+
#[derive(Debug)]
9091
pub struct CertifiedKey<S: SigningKey> {
9192
/// An issued certificate.
9293
pub cert: Certificate,
@@ -132,6 +133,7 @@ pub fn generate_simple_self_signed(
132133
Ok(CertifiedKey { cert, key_pair })
133134
}
134135

136+
#[derive(Debug)]
135137
struct Issuer<'a, S> {
136138
distinguished_name: &'a DistinguishedName,
137139
key_identifier_method: &'a KeyIdMethod,
@@ -430,7 +432,7 @@ impl DistinguishedName {
430432
/**
431433
Iterator over [`DistinguishedName`] entries
432434
*/
433-
#[derive(Clone)]
435+
#[derive(Clone, Debug)]
434436
pub struct DistinguishedNameIterator<'a> {
435437
distinguished_name: &'a DistinguishedName,
436438
iter: std::slice::Iter<'a, DnType>,

rcgen/src/sign_algo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ use crate::ring_like::signature::{self, EcdsaSigningAlgorithm, EdDSAParameters,
1010
use crate::Error;
1111

1212
#[cfg(feature = "crypto")]
13-
#[derive(Clone, Copy)]
13+
#[derive(Clone, Copy, Debug)]
1414
pub(crate) enum SignAlgo {
1515
EcDsa(&'static EcdsaSigningAlgorithm),
1616
EdDsa(&'static EdDSAParameters),
1717
Rsa(&'static dyn RsaEncoding),
1818
}
1919

20-
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
20+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2121
pub(crate) enum SignatureAlgorithmParams {
2222
/// Omit the parameters
2323
None,

rustls-cert-gen/src/cert.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl PemCertifiedKey {
3737

3838
/// Builder to configure TLS [CertificateParams] to be finalized
3939
/// into either a [Ca] or an [EndEntity].
40-
#[derive(Clone, Default)]
40+
#[derive(Clone, Debug, Default)]
4141
pub struct CertificateBuilder {
4242
params: CertificateParams,
4343
alg: KeyPairAlgorithm,
@@ -80,7 +80,7 @@ impl CertificateBuilder {
8080
}
8181

8282
/// [CertificateParams] from which an [Ca] [Certificate] can be built
83-
#[derive(Clone)]
83+
#[derive(Clone, Debug)]
8484
pub struct CaBuilder {
8585
params: CertificateParams,
8686
alg: KeyPairAlgorithm,
@@ -124,6 +124,7 @@ impl CaBuilder {
124124
}
125125

126126
/// End-entity [Certificate]
127+
#[derive(Debug)]
127128
pub struct Ca {
128129
cert: Certificate,
129130
params: CertificateParams,
@@ -146,6 +147,7 @@ impl Ca {
146147
}
147148

148149
/// End-entity [Certificate]
150+
#[derive(Debug)]
149151
pub struct EndEntity {
150152
cert: Certificate,
151153
key_pair: KeyPair,
@@ -162,7 +164,7 @@ impl EndEntity {
162164
}
163165

164166
/// [CertificateParams] from which an [EndEntity] [Certificate] can be built
165-
#[derive(Clone)]
167+
#[derive(Clone, Debug)]
166168
pub struct EndEntityBuilder {
167169
params: CertificateParams,
168170
alg: KeyPairAlgorithm,

0 commit comments

Comments
 (0)