path: root/xmlsecurity/inc/documentsignaturemanager.hxx
diff options
authorMiklos Vajna <>2016-11-08 14:10:05 +0100
committerMiklos Vajna <>2016-11-08 14:50:56 +0000
commita69873d212c903ea8a1f0d5ca40ae3f08b83a871 (patch)
treef1554b070e0525da09eaf482908780901b1ee324 /xmlsecurity/inc/documentsignaturemanager.hxx
parent2573f6bba6b3033143b776650f03fd4813669e5b (diff)
xmlsecurity: move the sec context from the format helpers to the sign manager
The signature manager always creates an XML helper, and optionally creates a PDF helper as well. Both of them initialize xmlsec, and when the signature manager is deleted, there are two de-inits, leading to an assertion failure in xmlsec. Fix the problem by moving the duplicated xmlsec init to the signature manager. This has the additional benefit that general security-related code no longer has to talk to the XML helper, it can use the signature manager, which feels more natural. (What viewing a certificate had to do with XML?) Change-Id: If6a6bc433636445f3782849a367d4a7ac0be7688 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins <>
Diffstat (limited to 'xmlsecurity/inc/documentsignaturemanager.hxx')
1 files changed, 6 insertions, 0 deletions
diff --git a/xmlsecurity/inc/documentsignaturemanager.hxx b/xmlsecurity/inc/documentsignaturemanager.hxx
index fd981d7d98b5..70623038581c 100644
--- a/xmlsecurity/inc/documentsignaturemanager.hxx
+++ b/xmlsecurity/inc/documentsignaturemanager.hxx
@@ -47,6 +47,8 @@ public:
css::uno::Reference<css::io::XStream> mxTempSignatureStream;
/// Storage containing all OOXML signatures, unused for ODF.
css::uno::Reference<css::embed::XStorage> mxTempSignatureStorage;
+ css::uno::Reference<css::xml::crypto::XSEInitializer> mxSEInitializer;
+ css::uno::Reference<css::xml::crypto::XXMLSecurityContext> mxSecurityContext;
DocumentSignatureManager(const css::uno::Reference<css::uno::XComponentContext>& xContext, DocumentSignatureMode eMode);
@@ -70,6 +72,10 @@ public:
// Checks if the document is a kind where it is relevant to distinguish between using XAdES or not
bool IsXAdESRelevant();
+ /// Attempts to initialize the platform-specific crypto.
+ bool init();
+ /// Get the security environment.
+ css::uno::Reference<css::xml::crypto::XSecurityEnvironment> getSecurityEnvironment();