From d82beef937bcefde0a06102f466d76f01353fa87 Mon Sep 17 00:00:00 2001 From: Timo Keller Date: Thu, 18 Jun 2026 14:10:59 +0200 Subject: [PATCH] pv: Implement Display for SymKey based on key_type() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Display implementation for SymKey that formats values as `SymKey()`, delegating to key_type(). This provides a clearer and stable human-readable representation for logs and CLI output. Reviewed-by: Marc Hartmayer Reviewed-by: Steffen Eiden Signed-off-by: Timo Keller --- rust/pv/src/crypto.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/pv/src/crypto.rs b/rust/pv/src/crypto.rs index 3ad66a88..5a69a261 100644 --- a/rust/pv/src/crypto.rs +++ b/rust/pv/src/crypto.rs @@ -162,6 +162,12 @@ impl SymKey { } } +impl Display for SymKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "SymKey({:?})", self.key_type()) + } +} + /// Performs an hkdf according to RFC 5869. /// See [`OpenSSL HKDF`]() ///