File tree Expand file tree Collapse file tree 1 file changed +0
-48
lines changed Expand file tree Collapse file tree 1 file changed +0
-48
lines changed Original file line number Diff line number Diff line change 5858
5959except Exception as err:
6060 print (err)
61- ```
62-
63- FROM SIGNING:
64-
65- ``` python
66- request_data = ... # This is the asset being signed.
67- content_type = ... # MIME type of the asset.
68-
69- manifest = json.dumps({
70- " title" : " image.jpg" ,
71- " format" : " image/jpeg" ,
72- " claim_generator_info" : [
73- {
74- " name" : " Documentation example" ,
75- " version" : " 0.0.1"
76- }
77- ],
78- " assertions" : [
79- {
80- " label" : " c2pa.actions" ,
81- " data" : {
82- " actions" : [
83- {
84- " action" : " c2pa.edited" ,
85- " softwareAgent" : {
86- " name" : " C2PA Python Example" ,
87- " version" : " 0.1.0"
88- }
89- }
90- ]
91- }
92- }
93- ]
94- })
95-
96- try :
97- builder = Builder(manifest)
98-
99- signer = create_signer(kms_sign, signing_alg,
100- cert_chain, timestamp_url)
101-
102- result = io.BytesIO(b " " )
103- builder.sign(signer, content_type, io.BytesIO(request_data), result)
104-
105- return result.getvalue()
106- except Exception as e:
107- logging.error(e)
108- abort(500 , description = e)
10961```
You can’t perform that action at this time.
0 commit comments