I am trying to create a PAdES signature using the following workflow:
- PDF is prepared for signing and hash is calculated in the browser
- hash is sent to the backend
- detached CAdES signature is formed on the backend
- detached CAdES is sent back to the browser where PAdES signature is assembled
We have a working example of PDF signature that works like this:
- PDF is prepared and hash is calculated in the browser
- hash is sent to the backend
- detached PKCS7 signature is made on the backend (by using BouncyCastle lib)
- detached PKCS7 is sent back to the browsere where PDF signature is assembled
This is working fine.
However, now instead of BouncyCastle we are using DSS library on the backend because we are trying to create a PAdES signature. So, DSS lib is creating detached CAdES (which should be the same as detached PAdES) instead of PKCS7. However, when the signature is assembled in the browser the signature is invalid (even the certificate info isn't visible).
From my understanding CAdES is an extension to PKCS7 so this approach should work.
I'm first trying to understand if something's wrong with our approach and if not, I'll try to share the code we're using to make a detached CAdES signature to see if something's wrong there.