0

I am trying to add a digital signature to an xlsx file... Can't seem to find any resources for this (other than adding signatures to literal/regular xml files). Is this possible with docx4j? I see it includes jaxb-xmldsig but there are no samples that I could find. Perhaps someone could point me in the right direction?

EDIT: Per Jason, I looked at the differences via the demo webapp....

There are two new entries in [Content_Types].xml:

  • <Default Extension="sigs" ContentType="application/vnd.openxmlformats-package.digital-signature-origin"/>
  • <Override ContentType="application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml" PartName="/_xmlsignatures/sig1.xml"/>

Two new parts within a new top level directory (_xmlsignatures):

  • /_xmlsignatures/origin.sigs
  • /_xmlsignatures/sig1.xml

There is also a _rels directory within _xmlsignatures which contains a single file origin.sigs.rels. I can post more info if that will be helpful.

divanov
  • 6,173
  • 3
  • 32
  • 51
  • Have you created such an xlsx in Excel? Do so, then unzip it to see what is added (or better upload to docx4j webapp or run through PartsList). With that info, we can see what is involved in doing it in docx4j. – JasonPlutext Feb 07 '14 at 00:01

1 Answers1

0

It is not the DigSig from the extended properties ?

If it is, you can add the DigSig to the propertie by editing the extendPropertie

DocPropsExtendedPart docPropsExtPart = wordMLPackage.getDocPropsExtendedPart();
Properties extProp = docPropsExtPart.getContents();
ExtendedProperties.modifyProp(props.getExtendedProperties(), extProp);
wordMLPackage.setPartShortcut(docPropsExtPart, Namespaces.PROPERTIES_EXTENDED);
  • I'm not sure - but I don't think so. When I looked at the contents of the signed xlsx there wasn't binary blob data in any of the signature related files. Or at least I couldn't find them. But, ultimately I'm not sure whether these are the same things (they could be?) – user3241461 Feb 10 '14 at 15:21