From 2324058de00e174fea324528ed35eeb99e3549ba Mon Sep 17 00:00:00 2001 From: dishmaker <141624503+dishmaker@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:26:43 +0200 Subject: [PATCH 1/2] elliptic-curve: Consistent PKCS#8 / SEC1 naming in secret_key.rs --- elliptic-curve/src/secret_key.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 830b8d3bd..182775a56 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -296,13 +296,13 @@ where #[cfg(feature = "pem")] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum PemParseError { - ///Indicates invalid PEM string + /// Indicates invalid PEM string Pem(pem_rfc7468::Error), - ///Indicates invalid pkcs8 EC key + /// Indicates invalid PKCS#8 EC key Pkcs8(::pkcs8::Error), - ///Indicates invalid Sec1 EC key + /// Indicates invalid SEC1 EC key Sec1(::sec1::Error), - ///Unable to recognize document label + /// Unable to recognize document label UnknownLabel, } @@ -336,8 +336,8 @@ impl fmt::Display for PemParseError { match self { Self::Pem(error) => fmt.write_fmt(format_args!("Failed to parse PEM: {error}")), Self::UnknownLabel => fmt.write_str("Unrecognized key label"), - Self::Pkcs8(error) => fmt.write_fmt(format_args!("Faoled to parse Pkcs8 key: {error}")), - Self::Sec1(error) => fmt.write_fmt(format_args!("Faoled to parse SEC1 key: {error}")), + Self::Pkcs8(error) => fmt.write_fmt(format_args!("Failed to parse PKCS#8 key: {error}")), + Self::Sec1(error) => fmt.write_fmt(format_args!("Failed to parse SEC1 key: {error}")), } } } @@ -355,7 +355,7 @@ where /// /// Supported formats: /// - `SEC1` - requires feature `sec1` - /// - `PKCS #8` - requires feature `pkcs8` + /// - `PKCS#8` - requires feature `pkcs8` /// /// # Errors /// - If `pem` is not valid PEM encoded private key From f9f8d0fddb4893c8139dcbbf5639231cd16e3bb8 Mon Sep 17 00:00:00 2001 From: dishmaker <141624503+dishmaker@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:29:46 +0200 Subject: [PATCH 2/2] cargo fmt secret_key.rs --- elliptic-curve/src/secret_key.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 182775a56..c0c07474b 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -336,7 +336,9 @@ impl fmt::Display for PemParseError { match self { Self::Pem(error) => fmt.write_fmt(format_args!("Failed to parse PEM: {error}")), Self::UnknownLabel => fmt.write_str("Unrecognized key label"), - Self::Pkcs8(error) => fmt.write_fmt(format_args!("Failed to parse PKCS#8 key: {error}")), + Self::Pkcs8(error) => { + fmt.write_fmt(format_args!("Failed to parse PKCS#8 key: {error}")) + } Self::Sec1(error) => fmt.write_fmt(format_args!("Failed to parse SEC1 key: {error}")), } }