1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include <com/sun/star/lang/XInitialization.hpp>
13 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
15 #include <cppuhelper/implbase.hxx>
17 #include <xmloff/namespacemap.hxx>
24 class XMLSignatureHelper
;
26 /// Parses an OOXML digital signature.
27 class OOXMLSecParser
: public cppu::WeakImplHelper
29 css::xml::sax::XDocumentHandler
,
30 css::lang::XInitialization
37 class ReferencedContextImpl
;
38 class DsX509CertificateContext
;
39 class DsX509SerialNumberContext
;
40 class DsX509IssuerNameContext
;
41 class DsX509IssuerSerialContext
;
42 class DsX509DataContext
;
43 class DsKeyInfoContext
;
44 class DsSignatureValueContext
;
45 class DsDigestValueContext
;
46 class DsDigestMethodContext
;
47 class DsTransformContext
;
48 class DsTransformsContext
;
49 class DsReferenceContext
;
50 class DsSignatureMethodContext
;
51 class DsSignedInfoContext
;
52 class XadesEncapsulatedX509CertificateContext
;
53 class XadesCertificateValuesContext
;
54 class XadesUnsignedSignaturePropertiesContext
;
55 class XadesUnsignedPropertiesContext
;
56 class XadesCertDigestContext
;
57 class XadesCertContext
;
58 class XadesSigningCertificateContext
;
59 class XadesSigningTimeContext
;
60 class XadesSignedSignaturePropertiesContext
;
61 class XadesSignedPropertiesContext
;
62 class XadesQualifyingPropertiesContext
;
63 class MdssiValueContext
;
64 class MdssiSignatureTimeContext
;
65 class MsodigsigSetupIDContext
;
66 class MsodigsigSignatureCommentsContext
;
67 class MsodigsigSignatureInfoV1Context
;
68 class DsSignaturePropertyContext
;
69 class DsSignaturePropertiesContext
;
70 class DsManifestContext
;
71 class DsObjectContext
;
72 class DsSignatureContext
;
73 class DsigSignaturesContext
;
75 std::stack
<std::unique_ptr
<Context
>> m_ContextStack
;
76 std::optional
<SvXMLNamespaceMap
> m_pNamespaceMap
;
78 XSecController
* m_pXSecController
;
79 css::uno::Reference
<css::xml::sax::XDocumentHandler
> m_xNextHandler
;
81 XMLSignatureHelper
& m_rXMLSignatureHelper
;
83 OUString
HandleIdAttr(css::uno::Reference
<css::xml::sax::XAttributeList
> const& xAttrs
);
86 explicit OOXMLSecParser(XMLSignatureHelper
& rXMLSignatureHelper
, XSecController
* pXSecController
);
87 virtual ~OOXMLSecParser() override
;
90 virtual void SAL_CALL
startDocument() override
;
92 virtual void SAL_CALL
endDocument() override
;
94 virtual void SAL_CALL
startElement(const OUString
& aName
, const css::uno::Reference
<css::xml::sax::XAttributeList
>& xAttribs
) override
;
96 virtual void SAL_CALL
endElement(const OUString
& aName
) override
;
98 virtual void SAL_CALL
characters(const OUString
& aChars
) override
;
100 virtual void SAL_CALL
ignorableWhitespace(const OUString
& aWhitespaces
) override
;
102 virtual void SAL_CALL
processingInstruction(const OUString
& aTarget
, const OUString
& aData
) override
;
104 virtual void SAL_CALL
setDocumentLocator(const css::uno::Reference
<css::xml::sax::XLocator
>& xLocator
) override
;
107 virtual void SAL_CALL
initialize(const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */