From 7ff681fddaeff5cea22a1978bd4916e0c6bc28f9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 8 Feb 2016 14:09:45 +0100 Subject: xmlsecurity: export OOXML Change-Id: I445a50d5c7d12609e4043bfedc41cdea456fa52f --- xmlsecurity/source/helper/xsecctl.cxx | 15 +++++++++++++++ xmlsecurity/source/helper/xsecctl.hxx | 1 + 2 files changed, 16 insertions(+) diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index fcbd8284247a..81b8d97bcf59 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -978,6 +978,21 @@ void XSecController::exportSignature( void XSecController::exportOOXMLSignature(const uno::Reference& xDocumentHandler, const SignatureInformation& /*rInformation*/) { xDocumentHandler->startElement(TAG_SIGNEDINFO, uno::Reference(new SvXMLAttributeList())); + + { + std::unique_ptr pAttributeList(new SvXMLAttributeList()); + pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_C14N); + xDocumentHandler->startElement(TAG_CANONICALIZATIONMETHOD, uno::Reference(pAttributeList.release())); + xDocumentHandler->endElement(TAG_CANONICALIZATIONMETHOD); + } + + { + std::unique_ptr pAttributeList(new SvXMLAttributeList()); + pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_RSASHA256); + xDocumentHandler->startElement(TAG_SIGNATUREMETHOD, uno::Reference(pAttributeList.release())); + xDocumentHandler->endElement(TAG_SIGNATUREMETHOD); + } + xDocumentHandler->endElement(TAG_SIGNEDINFO); } diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index 967e6036e5e7..589183d4d10c 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -95,6 +95,7 @@ #define ALGO_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" #define ALGO_RSASHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1" +#define ALGO_RSASHA256 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" #define ALGO_XMLDSIGSHA1 "http://www.w3.org/2000/09/xmldsig#sha1" #define ALGO_RELATIONSHIP "http://schemas.openxmlformats.org/package/2006/RelationshipTransform" -- cgit v1.2.3