Repository navigation
Preserve decoded PKCS#12 bags and avoid imported alias overwrites - #13
Merged
Merged
Conversation
domenkozar
marked this pull request as ready for review
October 8, 2026 14:52
Contributor
Author
|
cc @ancwrd1 |
8 tasks
ancwrd1
approved these changes
Oct 8, 2026
Owner
|
Thanks for the pull request! |
Contributor
Author
|
@ancwrd1 any chance for a release? 🙏 |
Owner
|
I probably have to bump the version to 0.4, as it adds some new interfaces. |
Owner
|
Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing an OpenSSL PFX in
Rawmode can lose its private key: OpenSSL commonly assigns the same friendly name to the key and leaf certificate, and the later certificate insertion overwrites the key. Certificate bags with duplicate names can also overwrite one another. Linked imports additionally filter bags, so applications cannot inspect every certificate before applying their own chain validation.This adds
Pkcs12Archive::from_pkcs12and documented bag types to expose supported decoded bags before alias mapping, linking, or filtering. It retains duplicate and unrelated certificates, preserves per-collection order and bag metadata, and includes private keys without a local key ID. It shares the existing MAC verification and decryption path withKeyStore.Keystore imports retain colliding aliases with
#2,#3, etc. suffixes. The existingStrictfiltering and chain-linking behavior remain available. The archive API performs no certificate signature, expiry, or key-match validation, and unsupported bag types are still ignored; these limits are documented.Validation with rustc 1.97.1:
cargo fmt --checkcargo clippy --workspace --examples --tests -- -D warningscargo test --workspace --examples --testscargo test --no-default-features --test test_archiveRUSTDOCFLAGS=-Dwarnings cargo doc --no-depsThis API is motivated by migrating SecretSpec's PKCS#12 identity support away from OpenSSL while retaining its existing certificate validation rules. Prepared with Codex assistance.