Adding Debug derivation for RSA PublicKey
This allows any structs that have an RSA PublicKey as a field
to derive Debug automatically.
Change-Id: Id16685b08fd7671fc118e71a68fef7b461fb5280
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68987
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
diff --git a/rust/bssl-crypto/src/rsa.rs b/rust/bssl-crypto/src/rsa.rs
index 308a602..5f67cf8 100644
--- a/rust/bssl-crypto/src/rsa.rs
+++ b/rust/bssl-crypto/src/rsa.rs
@@ -168,6 +168,13 @@
}
}
+#[cfg(feature = "std")]
+impl std::fmt::Debug for PublicKey {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ write!(f, "RSA PublicKey")
+ }
+}
+
/// The set of supported RSA key sizes for key generation.
#[allow(missing_docs)]
pub enum KeySize {