Please describe your issue and provide steps to reproduce it:
Hello
we are trying to add a timestamp to a signature.
Both the signature and the timestamp come from an external API.
For the signature it works well with a CMSSignature
But I don’t see how I can add a timestamp token in the document / signature.
From our API we receive :
Base64 encoded DER representation of timestamp token according to RFC3161. It includes the TSA signing certificate in SignedData.CertificatesSet.
The documentation only shows how to call a TSA directly but this is not our use case.
Is there any way to do that with the SDK?
As I mentioned in my post, we are using Apryse SDK, so it’s server side and not with webviewer. We use the latest SDK version with node.js
I had seen the two posts you mentionned but they do not answer my problem (or I don’t understand how it works).
GenerateContentsWithEmbeddedTimestamp and using TimestampingConfiguration assumes that we need to contact a TSA. But as I said, we already have the timestamp token so we do not need to contact the TSA
As I mentioned in my first post, the signing is not the problem.
We have achieved it, and it works (the example you mentionned helped me). The whole code is in my first post…
I am trying now to add a timestamp to the signature, with the requirements I mentionned earlier.
@MichaelL sorry for the confusion, and for the delay in a response. I am still reviewing with my team on how you can accomplish this task, and will update you once I know more.
I got confirmation from the team that at this time there is no specific API to allow this, and no realistic way to do it yourself (working at a lower level). The team has a work item to add support for this, but no time estimate at this time.
Thanks for the followup!
I don’t have a precise timeline right now but we are expecting to produce an MVP in the next few months to integrate digital signatures in some processes. Keep me updated
i’ve tried with the latest nightly in node.js and I get this error when using generateCMSSignature :
RangeError: 7 arguments passed into function ‘generateCMSSignature’. Expected 6 argument. Function Signature: generateCMSSignature(PDFNet.X509Certificate, Array<PDFNet.X509Certificate>, PDFNet.ObjectIdentifier, PDFNet.ObjectIdentifier, ArrayBuffer|TypedArray, ArrayBuffer|TypedArray)
The signature of the function seems off :
static generateCMSSignature(in_signer_cert: PDFNet.X509Certificate, in_chain_certs_list: PDFNet.X509Certificate[], in_digest_algorithm_oid: PDFNet.ObjectIdentifier, in_signature_algorithm_oid: PDFNet.ObjectIdentifier, in_signature_value_buf: ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray, in_signedattributes_buf: ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray): Promise<Uint8Array>;
/**
* Low-level function belonging to custom-signing APIs. Using low-level inputs that permit incorporation of
remote key usage (cloud keystore, Hardware Security Module (HSM) device, etc.), generates bytes representing
a Cryptographic Message Syntax (CMS)-format signature encoded in DER. The resulting data can be passed to
SaveCustomSignature.
* @param signer_cert - The X509 public-key certificate of the signature's signer (mathematically associated with private key used).
* @param chain_certs_list - The intermediate and root certificates to include in the CMS to allow verifiers to establish the chain/path of trust.
* @param digest_algorithm_id - The digest algorithm used, for embedding in the CMS.
* @param signature_algorithm_id - The signature algorithm used, for embedding in the CMS.
* @param signature_value_buf - A buffer containing the signature value to embed in the CMS.
* @param signedattributes_buf - A buffer containing signedAttributes for embedding into the CMS (must exactly match those used when creating signature value).
* @param [cms_options] - Optional extra data to store in the CMS.
* @returns A promise that resolves to the finished CMS data for embedding into the document using SaveCustomSignature.
*/
Good news though, I’ve tried with the function generateCMSSignatureWithAlgoId and adapted my code for this and this one accepts the option parameter and it works!