Closed vraj72 closed 4 years ago
p12 must be the result of the function pkcs12 imported from cryptography.hazmat.primitives.serialization Have you seen the examples in the examples directory?
i get error if run examples=> pdf-sign-cms.py
too much error:
Traceback (most recent call last):
File "pdf-sign-cms.py", line 49, in
dpendencies updated in setup.py
Traceback (most recent call last): File "s4.py", line 36, in
main()
File "s4.py", line 31, in main
datas = pdf.cms.sign(datau, dct, p12[0], p12[1], [], 'sha256')
File "/home/viraj/anaconda3/lib/python3.6/site-packages/endesive-1.4.4-py3.6.egg/endesive/pdf/cms.py", line 384, in sign
return cls.sign(datau, udct, key, cert, othercerts, algomd, hsm, timestampurl)
File "/home/viraj/anaconda3/lib/python3.6/site-packages/endesive-1.4.4-py3.6.egg/endesive/pdf/cms.py", line 375, in sign
contents = signer.sign(None, key, cert, othercerts, algomd, True, md, hsm, False, timestampurl)
File "/home/viraj/anaconda3/lib/python3.6/site-packages/endesive-1.4.4-py3.6.egg/endesive/signer.py", line 38, in sign
cert = cert2asn(cert)
File "/home/viraj/anaconda3/lib/python3.6/site-packages/endesive-1.4.4-py3.6.egg/endesive/signer.py", line 22, in cert2asn
cert_bytes = cert.public_bytes(serialization.Encoding.PEM)
AttributeError: 'Certificate' object has no attribute 'public_bytes'