-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
Description
See
c2pa-python/c2pa/c2pa_api/c2pa_api.py
Lines 240 to 257 in 7728124
| # Example of using python crypto to sign data using openssl with Ps256 | |
| from cryptography.hazmat.primitives import hashes, serialization | |
| from cryptography.hazmat.primitives.asymmetric import padding | |
| def sign_ps256(data: bytes, key: bytes) -> bytes: | |
| private_key = serialization.load_pem_private_key( | |
| key, | |
| password=None, | |
| ) | |
| signature = private_key.sign( | |
| data, | |
| padding.PSS( | |
| mgf=padding.MGF1(hashes.SHA256()), | |
| salt_length=padding.PSS.MAX_LENGTH | |
| ), | |
| hashes.SHA256() | |
| ) | |
| return signature |
Reactions are currently unavailable