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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <com/sun/star/lang/XInitialization.hpp>
23 #include <com/sun/star/uno/Any.h>
24 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
25 #include <com/sun/star/xml/sax/XLocator.hpp>
27 #include <cppuhelper/implbase.hxx>
29 #include <xmloff/namespacemap.hxx>
35 class XMLSignatureHelper
;
38 class XSecParser
: public cppu::WeakImplHelper
40 css::xml::sax::XDocumentHandler
,
41 css::lang::XInitialization
43 /****** XSecController.hxx/CLASS XSecParser ***********************************
46 * XSecParser -- a SAX parser that can detect security elements
49 * The XSecParser object is connected on the SAX chain and detects
50 * security elements in the SAX event stream, then notifies
54 * This class is used when importing a document.
55 ******************************************************************************/
57 friend class XSecController
;
62 class ReferencedContextImpl
;
63 class LoPGPOwnerContext
;
64 class DsPGPKeyPacketContext
;
65 class DsPGPKeyIDContext
;
66 class DsPGPDataContext
;
67 class DsX509CertificateContext
;
68 class DsX509SerialNumberContext
;
69 class DsX509IssuerNameContext
;
70 class DsX509IssuerSerialContext
;
71 class DsX509DataContext
;
72 class DsKeyInfoContext
;
73 class DsSignatureValueContext
;
74 class DsDigestValueContext
;
75 class DsDigestMethodContext
;
76 class DsTransformContext
;
77 class DsTransformsContext
;
78 class DsReferenceContext
;
79 class DsSignatureMethodContext
;
80 class DsSignedInfoContext
;
81 class XadesEncapsulatedX509CertificateContext
;
82 class XadesCertificateValuesContext
;
83 class XadesUnsignedSignaturePropertiesContext
;
84 class XadesUnsignedPropertiesContext
;
85 class LoSignatureLineIdContext
;
86 class LoSignatureLineValidImageContext
;
87 class LoSignatureLineInvalidImageContext
;
88 class LoSignatureLineContext
;
89 class XadesCertDigestContext
;
90 class XadesCertContext
;
91 class XadesSigningCertificateContext
;
92 class XadesSigningTimeContext
;
93 class XadesSignedSignaturePropertiesContext
;
94 class XadesSignedPropertiesContext
;
95 class XadesQualifyingPropertiesContext
;
97 class DcDescriptionContext
;
98 class DsSignaturePropertyContext
;
99 class DsSignaturePropertiesContext
;
100 class DsObjectContext
;
101 class DsSignatureContext
;
102 class DsigSignaturesContext
;
104 std::stack
<std::unique_ptr
<Context
>> m_ContextStack
;
105 std::optional
<SvXMLNamespaceMap
> m_pNamespaceMap
;
108 * the XSecController collaborating with XSecParser
110 XSecController
* m_pXSecController
;
113 * the next XDocumentHandler on the SAX chain
116 css::xml::sax::XDocumentHandler
> m_xNextHandler
;
118 XMLSignatureHelper
& m_rXMLSignatureHelper
;
120 OUString
HandleIdAttr(css::uno::Reference
<css::xml::sax::XAttributeList
> const& xAttrs
);
121 static OUString
getIdAttr(const css::uno::Reference
<
122 css::xml::sax::XAttributeList
>& xAttribs
);
125 XSecParser(XMLSignatureHelper
& rXMLSignatureHelper
, XSecController
* pXSecController
);
130 virtual void SAL_CALL
startDocument( ) override
;
132 virtual void SAL_CALL
endDocument( ) override
;
134 virtual void SAL_CALL
startElement(
135 const OUString
& aName
,
136 const css::uno::Reference
<
137 css::xml::sax::XAttributeList
>& xAttribs
) override
;
139 virtual void SAL_CALL
endElement( const OUString
& aName
) override
;
141 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
143 virtual void SAL_CALL
ignorableWhitespace( const OUString
& aWhitespaces
) override
;
145 virtual void SAL_CALL
processingInstruction(
146 const OUString
& aTarget
,
147 const OUString
& aData
) override
;
149 virtual void SAL_CALL
setDocumentLocator(
150 const css::uno::Reference
<
151 css::xml::sax::XLocator
>& xLocator
) override
;
156 virtual void SAL_CALL
initialize(
157 const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */