Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support setting more PKCS12 serialization encryption options #7560

Merged
merged 4 commits into from Sep 5, 2022

Conversation

reaperhulk
Copy link
Member

@reaperhulk reaperhulk commented Sep 4, 2022

This is limited support, but makes it possible to set different PBES choices as well as set KDF rounds and MAC algorithm.

@reaperhulk reaperhulk force-pushed the pkcs12-serialization-2 branch 2 times, most recently from d377d46 to 00921fa Compare September 4, 2022 08:04
@reaperhulk reaperhulk force-pushed the pkcs12-serialization-2 branch 9 times, most recently from 575df0b to 342534a Compare September 5, 2022 06:58
This is limited support, but makes it possible to set two different PBES
choices as well as set KDF rounds and MAC algorithm
docs/hazmat/primitives/asymmetric/serialization.rst Outdated Show resolved Hide resolved
docs/hazmat/primitives/asymmetric/serialization.rst Outdated Show resolved Hide resolved
docs/hazmat/primitives/asymmetric/serialization.rst Outdated Show resolved Hide resolved
tests/hazmat/primitives/test_pkcs12.py Outdated Show resolved Hide resolved
tests/hazmat/primitives/test_pkcs12.py Outdated Show resolved Hide resolved
tests/hazmat/primitives/test_pkcs12.py Outdated Show resolved Hide resolved
tests/hazmat/primitives/test_pkcs12.py Outdated Show resolved Hide resolved
src/cryptography/hazmat/primitives/_serialization.py Outdated Show resolved Hide resolved
reaperhulk and others added 2 commits September 5, 2022 19:22
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
@alex alex enabled auto-merge (squash) September 5, 2022 12:16
@alex alex merged commit 1742975 into pyca:main Sep 5, 2022
... kdf_rounds(50000).
... key_cert_algorithm(pkcs12.PBES.PBESv1SHA1And3KeyTripleDESCBC).
... hmac_hash(hashes.SHA1()).build(b"my password")
... )
Copy link

@schwabe schwabe Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the parenthesis here serve any purpose. I think Python just ignores them but some might confuse them to put the encryption into a tuple. But then again if you confuse that, you probably should not be playing with these things ...

Edit, nevermind. It allows you to skip all the \.

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

Successfully merging this pull request may close these issues.

Can't import cryptography generated pkcs12 into macos keychain AES256 support for PKCS#12
3 participants