Sign Pdf when saving

Hello,
Both for DocSaveOptions and OoxmlSaveOptions, we cannot select between Sha256/384/512?
Both for doc and docx?

Just checking if now we can sign Xps at save options?

And TimestampSettings does not exists for Doc and Docx signing?

Last, sorry can’t recall, how was signing the doc and docx before new DigitalSignatureDetails in saveoptions?

Thanks.

@australian.dev.nerds During the analysis we have not been able to find an option in Word that allows to specify the digital hash algorithm. We’ve also made draft code for testing purpose that allows to specify hash algorithm. However, Word cannot recognize documents produced with it and shows the following error while opening the document:

I am afraid this feature is not available yet. I have created a separate feature request for it WORDSNET-27188.

This feature request is logged as WORDSNET-25897 and is not yet implemented.

You can still use DigitalSignatureUtil to sign the documents.

1 Like

Thanks for the great work and support.
Just when saving as Xps, can choose between Xps and Oxps?
If yes, signing will be supported for both? :slight_smile:

I just tested the new DigitalSignatureDetails and it’s excellent, making the life much easier :slight_smile:

The only remaining thing is XpsSaveOptions.DigitalSignatureDetails = New Words.Saving.DigitalSignatureDetails(CertificateHolder, New Words.DigitalSignatures.SignOptions)

Currently, can use DigitalSignatureUtil.Sign to sign Xps files, however, will get error when opening in Microsoft Xps Viewer: This document has broken signatures.

Is this known or am I doing something wrong?
Thanks.

hum is this supported by doc and docx formats and not supported by Aspose?
Or not applicable to doc and docx at all? :slight_smile:

@australian.dev.nerds

Sure, you should simply specify the appropriate SaveFormat in XpsSaveOptions:

XpsSaveOptions oxpsSaveOptions = new XpsSaveOptions(SaveFormat.OpenXps);

And, yes signing will be available for both the same as it is available now using DigitalSignatureUtil

The issue is already logged in our defect tracking system as WORDSNET-25909. We will keep you informed and let you know once it is resolved.

This is not applicable to DOC and DOCX formats at all.

Hello
When I signed the docx with Word 2016 vs Aspose:

That’s why asked about the signing algorithm.
Thanks

@australian.dev.nerds What you highlighted on the screenshot is not hashing algorithm, but signature type. Please see DigitalSignatureType.

1 Like

Thanks,
The given link says:
CryptoApi: 1: The Crypto API signature method used in Microsoft Word 97-2003 .DOC binary documents.
While I’ve got that in Word 2016 when signing Docx format.

Anyway, may I choose to select which DigitalSignatureType when signing (via SaveOptions)?
Thanks.

@australian.dev.nerds There is no way to select signature type while signing the document. Could you please attach documents signed using MS Word and Aspose.Words on your side along with signature used for signing? We will check them and provide you more information.

1 Like

Hello
I just opened Word 2016, new document, saved the blank document as Docx, then File > Info > Protect Document > Add a Digital Signature
In the opened windows, just press Sign.
I used Aspose new SaveOptions to sign with the same certificate.
It was a Smime certificate, if it helps, I can share the Pfx file with private key, as it’s only used for testing.
Thanks.

@australian.dev.nerds Yes, please attach documents produced on your side using MS Word and Aspose.Words and test certificated used for signing.

1 Like

Hello,
All in one :slight_smile:
Private.zip (49.5 KB)

@australian.dev.nerds
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27192

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Thanks, maybe helpful:
https://learn.microsoft.com/en-us/archive/blogs/office2010/digital-signatures-in-office-2010

@australian.dev.nerds Thank you for additional information.

1 Like

Hello
Like:
https://reference.aspose.com/imaging/net/aspose.imaging.fileformats.pdf/pdfdocumentinfo/author/
https://reference.aspose.com/imaging/net/aspose.imaging.fileformats.pdf/pdfdocumentinfo/title/
https://reference.aspose.com/imaging/net/aspose.imaging.fileformats.pdf/pdfdocumentinfo/subject/

Can we set the Pdf Author/Title/Subject fields at the PdfSaveOptions level to simplify the coding?
If not, do you think it’s useful to have?
Thanks.

@australian.dev.nerds As it was mentioned earlier these properties are not related to PdfSaveOptions and must be set in the appropriate built-in document properties. So it is not likely we will duplicate them in save options.

The issues you have found earlier (filed as WORDSNET-27188) have been fixed in this Aspose.Words for .NET 24.8 update also available on NuGet.

The issues you have found earlier (filed as WORDSNET-25909) have been fixed in this Aspose.Words for .NET 24.10 update also available on NuGet.