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

RSA PKCS 1.5 SHA1 signing support and der helper functions #609

Merged
merged 39 commits into from
Nov 19, 2024
Merged

Conversation

DmitriyMusatkin
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

awscrt/crypto.py Outdated
@@ -118,6 +123,24 @@ def new_public_key_from_pem_data(pem_data: Union[str, bytes, bytearray, memoryvi
"""
return RSA(binding=_awscrt.rsa_public_key_from_pem_data(pem_data))

@staticmethod
def new_private_key_from_der_data(der_data: Union[str, bytes, bytearray, memoryview]) -> 'RSA':
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused whether der_data is supposed to be binary or text? I thought DER was binary, but in your tests it looks like BASE64 or something

If it's really only supposed to be binary, then don't take str.

If it is supposed to accept... str, Py_ArgParseTuple("s*") is ALWAYS going to transform it into UTF-8. Is that OK?

test/test_crypto.py Outdated Show resolved Hide resolved
test/test_crypto.py Outdated Show resolved Hide resolved
test/test_crypto.py Outdated Show resolved Hide resolved
test/test_crypto.py Outdated Show resolved Hide resolved
test/test_crypto.py Outdated Show resolved Hide resolved
test/test_crypto.py Outdated Show resolved Hide resolved
DmitriyMusatkin and others added 7 commits November 19, 2024 10:24
Co-authored-by: Michael Graeb <[email protected]>
Co-authored-by: Michael Graeb <[email protected]>
Co-authored-by: Michael Graeb <[email protected]>
Co-authored-by: Michael Graeb <[email protected]>
Co-authored-by: Michael Graeb <[email protected]>
Co-authored-by: Michael Graeb <[email protected]>
@DmitriyMusatkin DmitriyMusatkin merged commit e856566 into main Nov 19, 2024
64 checks passed
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.

2 participants