Skip to content

Refactor key loading - #567

Open
arckoor wants to merge 4 commits into
Keats:masterfrom
arckoor:key-handling-refactor
Open

arckoor wants to merge 4 commits into
Keats:masterfrom
arckoor:key-handling-refactor

Conversation

@arckoor

@arckoor arckoor commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Removes from_*_pem and from_*_der and replaces them with from_pem and from_pkcs8 / from_spki (and from_pkcs1, for legacy RSA keys).
All private keys are PKCS#8 internally now, PKCS#1 RSA keys get wrapped in PKCS#8.
Where possible AlgorithmFamily is deduced automatically, and all PEM / DER encodings are validated before extracting the key.
Validation for CERTIFICATE is good but not complete, the three optional parts at the end (issuerUniqueID, subjectUniqueID, extensions) are not decoded fully. But imo good enough.

Also redacts the Debug impl for OctetKeyParameters.

Closes #292, closes #331, closes #337, closes #362, closes #398, closes #426, closes #544, closes #547.

@arckoor
arckoor force-pushed the key-handling-refactor branch from 4188755 to adbb6ef Compare December 4, 2026 14:50
@arckoor
arckoor requested a max review from Copilot December 4, 2026 14:51

This comment was marked as low quality.

@arckoor

arckoor commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

One would imagine that when github offers these things, they would work, but oh well :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants