Skip to content

Commit 29c9c82

Browse files
committed
Derive Debug for EndEntity
1 parent ea66fd0 commit 29c9c82

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

rustls-cert-gen/src/cert.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ impl Ca {
142142
}
143143

144144
/// End-entity [Certificate]
145+
#[derive(Debug)]
145146
pub struct EndEntity {
146147
cert: Certificate,
147148
key_pair: KeyPair,
@@ -157,19 +158,6 @@ impl EndEntity {
157158
}
158159
}
159160

160-
impl fmt::Debug for EndEntity {
161-
/// Formats the `EndEntity` information without revealing the key pair.
162-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163-
// The key pair is omitted from the debug output as it contains secret information.
164-
let EndEntity { cert, key_pair } = self;
165-
166-
f.debug_struct("EndEntity")
167-
.field("cert", cert)
168-
.field("key_pair", key_pair)
169-
.finish()
170-
}
171-
}
172-
173161
/// [CertificateParams] from which an [EndEntity] [Certificate] can be built
174162
#[derive(Clone, Debug)]
175163
pub struct EndEntityBuilder {

0 commit comments

Comments
 (0)