Skip to content

pkcs1+sec1: remove pkcs8 integration/feature#1927

Merged
tarcieri merged 1 commit intomasterfrom
pkcs1+sec1/remove-pkcs8-integration
Jul 10, 2025
Merged

pkcs1+sec1: remove pkcs8 integration/feature#1927
tarcieri merged 1 commit intomasterfrom
pkcs1+sec1/remove-pkcs8-integration

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Jul 9, 2025

Both pkcs1 and sec1 used some "clever" tricks to write blanket impls of their traits for any types which impl the pkcs8 traits.

However, we've received some complaints this makes the impls of these traits more confusing and less discoverable (#1611), and adds a maintenance burden in that the blanket impl relationship is fundamentally "backwards" in that PKCS#8 builds on PKCS#1 and SEC1, not the other way around.

These could potentially be replaced with a macro that writes impls of the pkcs8 traits for types which impl the pkcs1/sec1 traits. However, for now, each of these is only used in one place (i.e. the rsa and elliptic-curve crates respectively), so we can start by moving the relevant code there for now.

@tarcieri
Copy link
Member Author

tarcieri commented Jul 9, 2025

This will need a companion PR to the rsa crate

@tarcieri tarcieri force-pushed the pkcs1+sec1/remove-pkcs8-integration branch from c8db792 to 7c1f9f4 Compare July 9, 2025 23:58
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
@tarcieri tarcieri force-pushed the pkcs1+sec1/remove-pkcs8-integration branch from 7c1f9f4 to ed1ad95 Compare July 10, 2025 00:43
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
Both `pkcs1` and `sec1` used some "clever" tricks to write blanket impls
of their traits for any types which impl the `pkcs8` traits.

However, we've received some complaints this makes the impls of these
traits more confusing and less discoverable (#1611), and adds a
maintenance burden in that the blanket impl relationship is
fundamentally "backwards" in that PKCS#8 builds on PKCS#1 and SEC1, not
the other way around.

These could potentially be replaced with a macro that writes impls of
the `pkcs8` traits for types which impl the `pkcs1`/`sec1` traits.
However, for now, each of these is only used in one place (i.e. the
`rsa` and `elliptic-curve` crates respectively), so we can start by
moving the relevant code there for now.
@tarcieri tarcieri force-pushed the pkcs1+sec1/remove-pkcs8-integration branch from ed1ad95 to ecb6713 Compare July 10, 2025 00:54
@tarcieri tarcieri merged commit 6c69e47 into master Jul 10, 2025
173 checks passed
@tarcieri tarcieri deleted the pkcs1+sec1/remove-pkcs8-integration branch July 10, 2025 01:08
tarcieri added a commit that referenced this pull request Jul 10, 2025
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
tarcieri added a commit that referenced this pull request Jul 10, 2025
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes
the PKCS#8 impl in terms of the SEC1 impl
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes
the PKCS#8 impl in terms of the SEC1 impl
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes
the PKCS#8 impl in terms of the SEC1 impl
tarcieri added a commit to RustCrypto/traits that referenced this pull request Jul 10, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the SEC1 impl
pinkforest pushed a commit to pinkforest/RSA that referenced this pull request Aug 22, 2025
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
takumi-earth pushed a commit to earthlings-dev/RSA that referenced this pull request Jan 27, 2026
Companion PR to RustCrypto/formats#1927 which properly composes the
PKCS#8 impl in terms of the PKCS#1 impl
@tarcieri tarcieri mentioned this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant