Skip to content

Conversation

gav2xlin
Copy link

@gav2xlin gav2xlin commented Aug 22, 2025

Hello. Please, mention that the ist of [PKCS7Options] is optional.

options = [pkcs7.PKCS7Options.Text] # to decrypt text data
options = [] # to decrypt binary data (as is)

An example:

:param options: An optional list of
:class:~cryptography.hazmat.primitives.serialization.pkcs7.PKCS7Options. For
this operation only
:attr:~cryptography.hazmat.primitives.serialization.pkcs7.PKCS7Options.Text is supported
or nothing for binary data.

@reaperhulk
Copy link
Member

Optional generally means you could passNone. This function requires that you pass a list, but that list can be empty. I'd suggest just stating that an empty list is allowable and handles binary data.

@gav2xlin
Copy link
Author

@alex @reaperhulk

Changed and fixed

https://github.com/pyca/cryptography/blob/main/src/rust/src/pkcs7.rs

The functions decrypt_smime() and decrypt_pem() call decrypt_der()

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.

3 participants