You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Validating a SpreadsheetDocument using OpenXmlValidator breaks digital signatures.
Screenshots
To Reproduce
usingvardocument= SpreadsheetDocument.Open("valid.xlsx", isEditable:true);varvalidator=new OpenXmlValidator();// This line breaks the signatures
validator.Validate(document);
document.Dispose();
Steps to reproduce the behavior:
Create .xlsx file using Microsoft Excel and add digital signature or signature line and sign it.
Observed behavior
Some parts (styles.xml and workbook.xml) get modified, which breaks digital signatures.
Expected behavior
No changes should happen when simply validating a package.
Desktop (please complete the following information):
OS: Windows
.NET Target: net6.0
DocumentFormat.OpenXml Version: 2.19.0
Additional context
When the document is loaded with the isEditable:false option, the issue does not occur.
The text was updated successfully, but these errors were encountered:
Is there a scenario where you need to pass isEditable:true but don't want to change it?
We can investigate what is changing here, but if the flag is being passed as isEditable=true, then you're opting into things potentially changing, which would break any digital signature. It may be an interesting exercise to understand what is changing, but I'm not sure this is unexpected given that you're opting into things changing.
I am appending a co-signature or prolonging the previous signature and aiming to authenticate the package prior to saving it. The addition or extension of signatures does not invalidate the preceding signature.
@petarpetrovt In case this is still blocking you... As a workaround, you could make the changes, clone the changed package, validate the clone and then save the original. I tried this approach and it appears to work. After validation, the clone does have some minor changes but the original is intact.
Describe the bug
Validating a
SpreadsheetDocument
usingOpenXmlValidator
breaks digital signatures.Screenshots
To Reproduce
Steps to reproduce the behavior:
Create .xlsx file using Microsoft Excel and add digital signature or signature line and sign it.
Observed behavior
Some parts (
styles.xml
andworkbook.xml
) get modified, which breaks digital signatures.Expected behavior
No changes should happen when simply validating a package.
Desktop (please complete the following information):
Additional context
When the document is loaded with the
isEditable:false
option, the issue does not occur.The text was updated successfully, but these errors were encountered: