LibreOffice Module xmlsecurity (master) 1
xsecparser.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#include "xsecparser.hxx"
22#include <xsecctl.hxx>
24
26#include <xmloff/xmltkmap.hxx>
27#include <xmloff/xmlimp.hxx>
28
29#include <com/sun/star/xml/sax/SAXException.hpp>
31#include <sal/log.hxx>
32
34{
35 protected:
36 friend class XSecParser;
38 private:
39 std::optional<SvXMLNamespaceMap> m_pOldNamespaceMap;
40
41 public:
43 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
44 : m_rParser(rParser)
45 , m_pOldNamespaceMap(std::move(pOldNamespaceMap))
46 {
47 }
48
49 virtual ~Context() = default;
50
51 virtual void StartElement(
52 css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/)
53 {
54 }
55
56 virtual void EndElement()
57 {
58 }
59
60 virtual std::unique_ptr<Context> CreateChildContext(
61 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
62 sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/);
63
64 virtual void Characters(OUString const& /*rChars*/)
65 {
66 }
67};
68
69// it's possible that an unsupported element has an Id attribute and a
70// ds:Reference digesting it - probably this means XSecController needs to know
71// about it. (For known elements, the Id attribute is only processed according
72// to the schema.)
74 : public XSecParser::Context
75{
76 public:
78 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
79 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
80 {
81 }
82
83 virtual void StartElement(
84 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
85 {
86 m_rParser.HandleIdAttr(xAttrs);
87 }
88};
89
91 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
92 sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/)
93-> std::unique_ptr<Context>
94{
95 // default: create new base context
96 return std::make_unique<UnknownContext>(m_rParser, std::move(pOldNamespaceMap));
97}
98
110 : public XSecParser::Context
111{
112 protected:
114
115 public:
117 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
118 bool const isReferenced)
119 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
120 , m_isReferenced(isReferenced)
121 {
122 }
123
124 OUString CheckIdAttrReferenced(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
125 {
126 OUString const id(m_rParser.HandleIdAttr(xAttrs));
127 if (!id.isEmpty() && m_rParser.m_pXSecController->haveReferenceForId(id))
128 {
129 m_isReferenced = true;
130 }
131 return id;
132 }
133};
134
136 : public XSecParser::Context
137{
138 private:
139 OUString m_Value;
140
141 public:
143 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
144 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
145 {
146 }
147
148 virtual void EndElement() override
149 {
151 }
152
153 virtual void Characters(OUString const& rChars) override
154 {
155 m_Value += rChars;
156 }
157};
158
160 : public XSecParser::Context
161{
162 private:
163 OUString m_Value;
164
165 public:
167 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
168 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
169 {
170 }
171
172 virtual void EndElement() override
173 {
175 }
176
177 virtual void Characters(OUString const& rChars) override
178 {
179 m_Value += rChars;
180 }
181};
182
184 : public XSecParser::Context
185{
186 private:
187 OUString m_Value;
188
189 public:
191 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
192 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
193 {
194 }
195
196 virtual void EndElement() override
197 {
199 }
200
201 virtual void Characters(OUString const& rChars) override
202 {
203 m_Value += rChars;
204 }
205};
206
208 : public XSecParser::Context
209{
210 public:
212 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
213 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
214 {
215 }
216
217 virtual void StartElement(
218 css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/) override
219 {
221 }
222
223 virtual std::unique_ptr<Context> CreateChildContext(
224 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
225 sal_uInt16 const nNamespace, OUString const& rName) override
226 {
227 if (nNamespace == XML_NAMESPACE_DS && rName == "PGPKeyID")
228 {
229 return std::make_unique<DsPGPKeyIDContext>(m_rParser, std::move(pOldNamespaceMap));
230 }
231 if (nNamespace == XML_NAMESPACE_DS && rName == "PGPKeyPacket")
232 {
233 return std::make_unique<DsPGPKeyPacketContext>(m_rParser, std::move(pOldNamespaceMap));
234 }
235 if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "PGPOwner")
236 {
237 return std::make_unique<LoPGPOwnerContext>(m_rParser, std::move(pOldNamespaceMap));
238 }
239 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
240 }
241};
242
244 : public XSecParser::Context
245{
246 private:
247 OUString & m_rValue;
248
249 public:
251 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
252 OUString& rValue)
253 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
254 , m_rValue(rValue)
255 {
256 }
257
258 virtual void Characters(OUString const& rChars) override
259 {
260 m_rValue += rChars;
261 }
262};
263
265 : public XSecParser::Context
266{
267 private:
268 OUString & m_rValue;
269
270 public:
272 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
273 OUString& rValue)
274 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
275 , m_rValue(rValue)
276 {
277 }
278
279 virtual void Characters(OUString const& rChars) override
280 {
281 m_rValue += rChars;
282 }
283};
284
286 : public XSecParser::Context
287{
288 private:
289 OUString & m_rValue;
290
291 public:
293 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
294 OUString& rValue)
295 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
296 , m_rValue(rValue)
297 {
298 }
299
300 virtual void Characters(OUString const& rChars) override
301 {
302 m_rValue += rChars;
303 }
304};
305
307 : public XSecParser::Context
308{
309 private:
312
313 public:
315 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
316 OUString& rIssuerName, OUString& rSerialNumber)
317 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
318 , m_rX509IssuerName(rIssuerName)
319 , m_rX509SerialNumber(rSerialNumber)
320 {
321 }
322
323 virtual std::unique_ptr<Context> CreateChildContext(
324 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
325 sal_uInt16 const nNamespace, OUString const& rName) override
326 {
327 if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerName")
328 {
329 return std::make_unique<DsX509IssuerNameContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509IssuerName);
330 }
331 if (nNamespace == XML_NAMESPACE_DS && rName == "X509SerialNumber")
332 {
333 return std::make_unique<DsX509SerialNumberContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509SerialNumber);
334 }
335 // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
336 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
337 }
338};
339
342 : public XSecParser::Context
343{
344 private:
345 // sigh... "No ordering is implied by the above constraints."
346 // so store the ball of mud in vectors and try to figure it out later.
347 std::vector<std::pair<OUString, OUString>> m_X509IssuerSerials;
348 std::vector<OUString> m_X509Certificates;
349
350 public:
352 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
353 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
354 {
355 }
356
357 virtual void EndElement() override
358 {
360 }
361
362 virtual std::unique_ptr<Context> CreateChildContext(
363 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
364 sal_uInt16 const nNamespace, OUString const& rName) override
365 {
366 if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerSerial")
367 {
368 m_X509IssuerSerials.emplace_back();
369 return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerSerials.back().first, m_X509IssuerSerials.back().second);
370 }
371 if (nNamespace == XML_NAMESPACE_DS && rName == "X509Certificate")
372 {
373 m_X509Certificates.emplace_back();
374 return std::make_unique<DsX509CertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_X509Certificates.back());
375 }
376 // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
377 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
378 }
379};
380
382 : public XSecParser::Context
383{
384 public:
386 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
387 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
388 {
389 }
390
391 virtual void StartElement(
392 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
393 {
394 m_rParser.HandleIdAttr(xAttrs);
395 }
396
397 virtual std::unique_ptr<Context> CreateChildContext(
398 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
399 sal_uInt16 const nNamespace, OUString const& rName) override
400 {
401 if (nNamespace == XML_NAMESPACE_DS && rName == "X509Data")
402 {
403 return std::make_unique<DsX509DataContext>(m_rParser, std::move(pOldNamespaceMap));
404 }
405 if (nNamespace == XML_NAMESPACE_DS && rName == "PGPData")
406 {
407 return std::make_unique<DsPGPDataContext>(m_rParser, std::move(pOldNamespaceMap));
408 }
409 // missing: ds:KeyName, ds:KeyValue, ds:RetrievalMethod, ds:SPKIData, ds:MgmtData
410 // (old code would read ds:Transform inside ds:RetrievalMethod but
411 // presumably that was a bug)
412 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
413 }
414
415};
416
418 : public XSecParser::Context
419{
420 private:
421 OUString m_Value;
422
423 public:
425 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
426 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
427 {
428 }
429
430 virtual void StartElement(
431 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
432 {
433 m_rParser.HandleIdAttr(xAttrs);
434 }
435
436 virtual void EndElement() override
437 {
439 }
440
441 virtual void Characters(OUString const& rChars) override
442 {
443 m_Value += rChars;
444 }
445};
446
448 : public XSecParser::Context
449{
450 private:
451 OUString & m_rValue;
452
453 public:
455 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
456 OUString& rValue)
457 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
458 , m_rValue(rValue)
459 {
460 }
461
462 virtual void StartElement(
463 css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/) override
464 {
465 m_rValue.clear();
466 }
467
468 virtual void Characters(OUString const& rChars) override
469 {
470 m_rValue += rChars;
471 }
472};
473
475 : public XSecParser::Context
476{
477 private:
479
480 public:
482 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
483 sal_Int32& rReferenceDigestID)
484 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
485 , m_rReferenceDigestID(rReferenceDigestID)
486 {
487 }
488
489 virtual void StartElement(
490 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
491 {
492 OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
493
494 SAL_WARN_IF( ouAlgorithm.isEmpty(), "xmlsecurity.helper", "no Algorithm in Reference" );
495 if (ouAlgorithm.isEmpty())
496 return;
497
498 SAL_WARN_IF( ouAlgorithm != ALGO_XMLDSIGSHA1
499 && ouAlgorithm != ALGO_XMLDSIGSHA256
500 && ouAlgorithm != ALGO_XMLDSIGSHA512,
501 "xmlsecurity.helper", "Algorithm neither SHA1, SHA256 nor SHA512");
502 if (ouAlgorithm == ALGO_XMLDSIGSHA1)
503 m_rReferenceDigestID = css::xml::crypto::DigestID::SHA1;
504 else if (ouAlgorithm == ALGO_XMLDSIGSHA256)
505 m_rReferenceDigestID = css::xml::crypto::DigestID::SHA256;
506 else if (ouAlgorithm == ALGO_XMLDSIGSHA512)
507 m_rReferenceDigestID = css::xml::crypto::DigestID::SHA512;
508 else
510 }
511};
512
514 : public XSecParser::Context
515{
516 private:
517 bool & m_rIsC14N;
518
519 public:
521 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
522 bool& rIsC14N)
523 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
524 , m_rIsC14N(rIsC14N)
525 {
526 }
527
528 virtual void StartElement(
529 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
530 {
531 OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
532
533 if (ouAlgorithm == ALGO_C14N)
534 /*
535 * a xml stream
536 */
537 {
538 m_rIsC14N = true;
539 }
540 }
541};
542
544 : public XSecParser::Context
545{
546 private:
547 bool & m_rIsC14N;
548
549 public:
551 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
552 bool& rIsC14N)
553 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
554 , m_rIsC14N(rIsC14N)
555 {
556 }
557
558 virtual std::unique_ptr<Context> CreateChildContext(
559 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
560 sal_uInt16 const nNamespace, OUString const& rName) override
561 {
562 if (nNamespace == XML_NAMESPACE_DS && rName == "Transform")
563 {
564 return std::make_unique<DsTransformContext>(m_rParser, std::move(pOldNamespaceMap), m_rIsC14N);
565 }
566 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
567 }
568};
569
571 : public XSecParser::Context
572{
573 private:
574 OUString m_URI;
575 OUString m_Type;
577 bool m_IsC14N = false;
578 // Relevant for ODF. The digest algorithm selected by the DigestMethod
579 // element's Algorithm attribute. @see css::xml::crypto::DigestID.
580 sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
581
582 public:
584 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
585 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
586 {
587 }
588
589 virtual void StartElement(
590 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
591 {
592 m_rParser.HandleIdAttr(xAttrs);
593
594 m_URI = xAttrs->getValueByName("URI");
595 SAL_WARN_IF(m_URI.isEmpty(), "xmlsecurity.helper", "URI is empty");
596 // Remember the type of this reference.
597 m_Type = xAttrs->getValueByName("Type");
598 }
599
600 virtual void EndElement() override
601 {
602 if (m_URI.startsWith("#"))
603 {
604 /*
605 * remove the first character '#' from the attribute value
606 */
608 }
609 else
610 {
611 if (m_IsC14N) // this is determined by nested ds:Transform
612 {
614 }
615 else
616 /*
617 * it must be an octet stream
618 */
619 {
621 }
622 }
623
625 }
626
627 virtual std::unique_ptr<Context> CreateChildContext(
628 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
629 sal_uInt16 const nNamespace, OUString const& rName) override
630 {
631 if (nNamespace == XML_NAMESPACE_DS && rName == "Transforms")
632 {
633 return std::make_unique<DsTransformsContext>(m_rParser, std::move(pOldNamespaceMap), m_IsC14N);
634 }
635 if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
636 {
637 return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_nReferenceDigestID);
638 }
639 if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
640 {
641 return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_DigestValue);
642 }
643 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
644 }
645};
646
648 : public XSecParser::Context
649{
650 public:
652 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
653 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
654 {
655 }
656
657 virtual void StartElement(
658 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
659 {
660 OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
661 if (ouAlgorithm == ALGO_ECDSASHA1 || ouAlgorithm == ALGO_ECDSASHA256
662 || ouAlgorithm == ALGO_ECDSASHA512)
663 {
665 }
666 }
667};
668
670 : public XSecParser::Context
671{
672 public:
674 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
675 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
676 {
677 }
678
679 virtual void StartElement(
680 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
681 {
682 m_rParser.HandleIdAttr(xAttrs);
683 }
684
685 virtual void EndElement() override
686 {
688 }
689
690 virtual std::unique_ptr<Context> CreateChildContext(
691 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
692 sal_uInt16 const nNamespace, OUString const& rName) override
693 {
694 if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureMethod")
695 {
696 return std::make_unique<DsSignatureMethodContext>(m_rParser, std::move(pOldNamespaceMap));
697 }
698 if (nNamespace == XML_NAMESPACE_DS && rName == "Reference")
699 {
700 return std::make_unique<DsReferenceContext>(m_rParser, std::move(pOldNamespaceMap));
701 }
702 // missing: ds:CanonicalizationMethod
703 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
704 }
705};
706
708 : public XSecParser::Context
709{
710 private:
711 OUString m_Value;
712
713 public:
715 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
716 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
717 {
718 }
719
720 virtual void StartElement(
721 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
722 {
723 m_rParser.HandleIdAttr(xAttrs);
724 }
725
726 virtual void EndElement() override
727 {
729 }
730
731 virtual void Characters(OUString const& rChars) override
732 {
733 m_Value += rChars;
734 }
735};
736
738 : public XSecParser::Context
739{
740 public:
742 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
743 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
744 {
745 }
746
747 virtual void StartElement(
748 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
749 {
750 m_rParser.HandleIdAttr(xAttrs);
751 }
752
753 virtual std::unique_ptr<Context> CreateChildContext(
754 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
755 sal_uInt16 const nNamespace, OUString const& rName) override
756 {
757 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "EncapsulatedX509Certificate")
758 {
759 return std::make_unique<XadesEncapsulatedX509CertificateContext>(m_rParser, std::move(pOldNamespaceMap));
760 }
761 // missing: xades:OtherCertificate
762 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
763 }
764};
765
767 : public XSecParser::Context
768{
769 public:
771 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
772 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
773 {
774 }
775
776 virtual void StartElement(
777 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
778 {
779 m_rParser.HandleIdAttr(xAttrs);
780 }
781
782 virtual std::unique_ptr<Context> CreateChildContext(
783 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
784 sal_uInt16 const nNamespace, OUString const& rName) override
785 {
786 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "CertificateValues")
787 {
788 return std::make_unique<XadesCertificateValuesContext>(m_rParser, std::move(pOldNamespaceMap));
789 }
790 // missing:
791 // xades:CounterSignature
792 // ^ old code would read a ds:Signature inside it?
793 // xades:SignatureTimeStamp
794 // xades:CompleteCertificateRefs
795 // xades:CompleteRevocationRefs
796 // xades:AttributeCertificateRefs
797 // xades:AttributeRevocationRefs
798 // xades:SigAndRefsTimeStamp
799 // xades:RefsOnlyTimeStamp
800 // xades:RevocationValues
801 // xades:AttrAuthoritiesCertValues
802 // ^ old code: was equivalent to CertificateValues ???
803 // xades:AttributeRevocationValues
804 // xades:ArchiveTimeStamp
805 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
806 }
807};
808
810 : public XSecParser::Context
811{
812 public:
814 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
815 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
816 {
817 }
818
819 virtual void StartElement(
820 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
821 {
822 m_rParser.HandleIdAttr(xAttrs);
823 }
824
825 virtual std::unique_ptr<Context> CreateChildContext(
826 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
827 sal_uInt16 const nNamespace, OUString const& rName) override
828 {
829 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "UnsignedSignatureProperties")
830 {
831 return std::make_unique<XadesUnsignedSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap));
832 }
833 // missing: xades:UnsignedDataObjectProperties
834 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
835 }
836};
837
840{
841 private:
842 OUString m_Value;
843
844 public:
846 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
847 bool const isReferenced)
848 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
849 {
850 }
851
852 virtual void EndElement() override
853 {
854 if (m_isReferenced)
855 {
857 }
858 else
859 {
860 SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineId");
861 }
862 }
863
864 virtual void Characters(OUString const& rChars) override
865 {
866 m_Value += rChars;
867 }
868};
869
872{
873 private:
874 OUString m_Value;
875
876 public:
878 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
879 bool const isReferenced)
880 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
881 {
882 }
883
884 virtual void EndElement() override
885 {
886 if (m_isReferenced)
887 {
889 }
890 else
891 {
892 SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineValidImage");
893 }
894 }
895
896 virtual void Characters(OUString const& rChars) override
897 {
898 m_Value += rChars;
899 }
900};
901
904{
905 private:
906 OUString m_Value;
907
908 public:
910 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
911 bool const isReferenced)
912 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
913 {
914 }
915
916 virtual void EndElement() override
917 {
918 if (m_isReferenced)
919 {
921 }
922 else
923 {
924 SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineInvalidImage");
925 }
926 }
927
928 virtual void Characters(OUString const& rChars) override
929 {
930 m_Value += rChars;
931 }
932};
933
936{
937 public:
939 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
940 bool const isReferenced)
941 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
942 {
943 }
944
945 virtual std::unique_ptr<Context> CreateChildContext(
946 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
947 sal_uInt16 const nNamespace, OUString const& rName) override
948 {
949 if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineId")
950 {
951 return std::make_unique<LoSignatureLineIdContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
952 }
953 if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineValidImage")
954 {
955 return std::make_unique<LoSignatureLineValidImageContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
956 }
957 if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineInvalidImage")
958 {
959 return std::make_unique<LoSignatureLineInvalidImageContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
960 }
961 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
962 }
963};
964
966 : public XSecParser::Context
967{
968 private:
969 OUString & m_rDigestValue;
971
972 public:
974 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
975 OUString& rDigestValue, sal_Int32& rReferenceDigestID)
976 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
977 , m_rDigestValue(rDigestValue)
978 , m_rReferenceDigestID(rReferenceDigestID)
979 {
980 }
981
982 virtual std::unique_ptr<Context> CreateChildContext(
983 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
984 sal_uInt16 const nNamespace, OUString const& rName) override
985 {
986 if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
987 {
988 return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_rReferenceDigestID);
989 }
990 if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
991 {
992 return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_rDigestValue);
993 }
994 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
995 }
996};
997
1000{
1001 private:
1002 sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
1006
1007 public:
1009 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1010 bool const isReferenced)
1011 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1012 {
1013 }
1014
1015 virtual void EndElement() override
1016 {
1017 if (m_isReferenced)
1018 {
1020 }
1021 else
1022 {
1023 SAL_INFO("xmlsecurity.helper", "ignoring unsigned xades:Cert");
1024 }
1025 }
1026
1027 virtual std::unique_ptr<Context> CreateChildContext(
1028 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1029 sal_uInt16 const nNamespace, OUString const& rName) override
1030 {
1031 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "CertDigest")
1032 {
1033 return std::make_unique<XadesCertDigestContext>(m_rParser, std::move(pOldNamespaceMap), m_CertDigest, m_nReferenceDigestID);
1034 }
1035 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "IssuerSerial")
1036 {
1037 return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerName, m_X509SerialNumber);
1038 }
1039 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1040 }
1041};
1042
1045{
1046 public:
1048 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1049 bool const isReferenced)
1050 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1051 {
1052 }
1053
1054 virtual std::unique_ptr<Context> CreateChildContext(
1055 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1056 sal_uInt16 const nNamespace, OUString const& rName) override
1057 {
1058 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "Cert")
1059 {
1060 return std::make_unique<XadesCertContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1061 }
1062 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1063 }
1064};
1065
1068{
1069 private:
1070 OUString m_Value;
1071
1072 public:
1074 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1075 bool const isReferenced)
1076 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1077 {
1078 }
1079
1080 virtual void EndElement() override
1081 {
1082 if (m_isReferenced)
1083 {
1085 }
1086 else
1087 {
1088 SAL_INFO("xmlsecurity.helper", "ignoring unsigned SigningTime");
1089 }
1090 }
1091
1092 virtual void Characters(OUString const& rChars) override
1093 {
1094 m_Value += rChars;
1095 }
1096};
1097
1100{
1101 public:
1103 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1104 bool const isReferenced)
1105 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1106 {
1107 }
1108
1109 virtual void StartElement(
1110 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1111 {
1112 CheckIdAttrReferenced(xAttrs);
1113 }
1114
1115 virtual std::unique_ptr<Context> CreateChildContext(
1116 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1117 sal_uInt16 const nNamespace, OUString const& rName) override
1118 {
1119 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningTime")
1120 {
1121 return std::make_unique<XadesSigningTimeContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1122 }
1123 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningCertificate")
1124 {
1125 return std::make_unique<XadesSigningCertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1126 }
1127 if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLine")
1128 {
1129 return std::make_unique<LoSignatureLineContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1130 }
1131 // missing: xades:SignaturePolicyIdentifier, xades:SignatureProductionPlace, xades:SignerRole
1132 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1133 }
1134};
1135
1138{
1139 public:
1141 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1142 bool const isReferenced)
1143 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1144 {
1145 }
1146
1147 virtual void StartElement(
1148 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1149 {
1150 CheckIdAttrReferenced(xAttrs);
1151 }
1152
1153 virtual std::unique_ptr<Context> CreateChildContext(
1154 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1155 sal_uInt16 const nNamespace, OUString const& rName) override
1156 {
1157 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedSignatureProperties")
1158 {
1159 return std::make_unique<XadesSignedSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1160 }
1161 // missing: xades:SignedDataObjectProperties
1162 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1163 }
1164};
1165
1168{
1169 public:
1171 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1172 bool const isReferenced)
1173 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1174 {
1175 }
1176
1177 virtual void StartElement(
1178 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1179 {
1180 CheckIdAttrReferenced(xAttrs);
1181 }
1182
1183 virtual std::unique_ptr<Context> CreateChildContext(
1184 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1185 sal_uInt16 const nNamespace, OUString const& rName) override
1186 {
1187 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedProperties")
1188 {
1189 return std::make_unique<XadesSignedPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1190 }
1191 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "UnsignedProperties")
1192 {
1193 return std::make_unique<XadesUnsignedPropertiesContext>(m_rParser, std::move(pOldNamespaceMap));
1194 }
1195 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1196 }
1197};
1198
1200 : public XSecParser::Context
1201{
1202 private:
1203 OUString & m_rValue;
1204
1205 public:
1207 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1208 OUString& rValue)
1209 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
1210 , m_rValue(rValue)
1211 {
1212 }
1213
1214 virtual void Characters(OUString const& rChars) override
1215 {
1216 m_rValue += rChars;
1217 }
1218};
1219
1221 : public XSecParser::Context
1222{
1223 private:
1224 OUString & m_rValue;
1225
1226 public:
1228 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1229 OUString& rValue)
1230 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
1231 , m_rValue(rValue)
1232 {
1233 }
1234
1235 virtual void Characters(OUString const& rChars) override
1236 {
1237 m_rValue += rChars;
1238 }
1239};
1240
1243{
1244 private:
1245 enum class SignatureProperty { Unknown, Date, Description };
1247 OUString m_Id;
1248 OUString m_Value;
1249
1250 public:
1252 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1253 bool const isReferenced)
1254 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1255 {
1256 }
1257
1258 virtual void StartElement(
1259 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1260 {
1261 m_Id = CheckIdAttrReferenced(xAttrs);
1262 }
1263
1264 virtual void EndElement() override
1265 {
1266 if (m_isReferenced)
1267 {
1268 switch (m_Property)
1269 {
1271 SAL_INFO("xmlsecurity.helper", "Unknown property in ds:Object ignored");
1272 break;
1275 break;
1278 break;
1279 }
1280 }
1281 else
1282 {
1283 SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureProperty");
1284 }
1285 }
1286
1287 virtual std::unique_ptr<Context> CreateChildContext(
1288 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1289 sal_uInt16 const nNamespace, OUString const& rName) override
1290 {
1291 if (nNamespace == XML_NAMESPACE_DC && rName == "date")
1292 {
1294 return std::make_unique<DcDateContext>(m_rParser, std::move(pOldNamespaceMap), m_Value);
1295 }
1296 if (nNamespace == XML_NAMESPACE_DC && rName == "description")
1297 {
1299 return std::make_unique<DcDescriptionContext>(m_rParser, std::move(pOldNamespaceMap), m_Value);
1300 }
1301 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1302 }
1303};
1304
1307{
1308 public:
1310 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1311 bool const isReferenced)
1312 : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
1313 {
1314 }
1315
1316 virtual void StartElement(
1317 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1318 {
1319 CheckIdAttrReferenced(xAttrs);
1320 }
1321
1322 virtual std::unique_ptr<Context> CreateChildContext(
1323 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1324 sal_uInt16 const nNamespace, OUString const& rName) override
1325 {
1326 if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperty")
1327 {
1328 return std::make_unique<DsSignaturePropertyContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1329 }
1330 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1331 }
1332};
1333
1336{
1337 public:
1339 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
1340 // init with "false" here - the Signature element can't be referenced by its child
1341 : XSecParser::ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), false)
1342 {
1343 }
1344
1345 virtual void StartElement(
1346 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1347 {
1348 CheckIdAttrReferenced(xAttrs);
1349 }
1350
1351 virtual std::unique_ptr<Context> CreateChildContext(
1352 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1353 sal_uInt16 const nNamespace, OUString const& rName) override
1354 {
1355 if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperties")
1356 {
1357 return std::make_unique<DsSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1358 }
1359 if (nNamespace == XML_NAMESPACE_XADES132 && rName == "QualifyingProperties")
1360 {
1361 return std::make_unique<XadesQualifyingPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
1362 }
1363 // missing: ds:Manifest
1364 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1365 }
1366};
1367
1369 : public XSecParser::Context
1370{
1371 public:
1373 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
1374 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
1375 {
1376 }
1377
1378 virtual void StartElement(
1379 css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
1380 {
1381 OUString const ouIdAttr(m_rParser.HandleIdAttr(xAttrs));
1384 if (!ouIdAttr.isEmpty())
1385 {
1386 m_rParser.m_pXSecController->setId( ouIdAttr );
1387 }
1388 }
1389
1390 virtual std::unique_ptr<Context> CreateChildContext(
1391 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1392 sal_uInt16 const nNamespace, OUString const& rName) override
1393 {
1394 if (nNamespace == XML_NAMESPACE_DS && rName == "SignedInfo")
1395 {
1396 return std::make_unique<DsSignedInfoContext>(m_rParser, std::move(pOldNamespaceMap));
1397 }
1398 if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureValue")
1399 {
1400 return std::make_unique<DsSignatureValueContext>(m_rParser, std::move(pOldNamespaceMap));
1401 }
1402 if (nNamespace == XML_NAMESPACE_DS && rName == "KeyInfo")
1403 {
1404 return std::make_unique<DsKeyInfoContext>(m_rParser, std::move(pOldNamespaceMap));
1405 }
1406 if (nNamespace == XML_NAMESPACE_DS && rName == "Object")
1407 {
1408 return std::make_unique<DsObjectContext>(m_rParser, std::move(pOldNamespaceMap));
1409 }
1410 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1411 }
1412};
1413
1415 : public XSecParser::Context
1416{
1417 public:
1419 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap)
1420 : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
1421 {
1422 }
1423
1424 virtual std::unique_ptr<Context> CreateChildContext(
1425 std::optional<SvXMLNamespaceMap>&& pOldNamespaceMap,
1426 sal_uInt16 const nNamespace, OUString const& rName) override
1427 {
1428 if (nNamespace == XML_NAMESPACE_DS && rName == "Signature")
1429 {
1430 return std::make_unique<DsSignatureContext>(m_rParser, std::move(pOldNamespaceMap));
1431 }
1432 return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
1433 }
1434};
1435
1436
1438 XSecController* pXSecController)
1439 : m_pNamespaceMap(SvXMLNamespaceMap())
1440 , m_pXSecController(pXSecController)
1441 , m_rXMLSignatureHelper(rXMLSignatureHelper)
1442{
1443 using namespace xmloff::token;
1451 m_pNamespaceMap->Add( "_office_libo",
1453}
1454
1455OUString XSecParser::HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
1456{
1457 OUString ouIdAttr = getIdAttr(xAttrs);
1458 if (!ouIdAttr.isEmpty())
1459 {
1461 }
1462 return ouIdAttr;
1463}
1464
1465OUString XSecParser::getIdAttr(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
1466{
1467 OUString ouIdAttr = xAttribs->getValueByName("id");
1468
1469 if (ouIdAttr.isEmpty())
1470 {
1471 ouIdAttr = xAttribs->getValueByName("Id");
1472 }
1473
1474 return ouIdAttr;
1475}
1476
1477/*
1478 * XDocumentHandler
1479 */
1481{
1482 if (m_xNextHandler.is())
1483 {
1484 m_xNextHandler->startDocument();
1485 }
1486}
1487
1489{
1490 if (m_xNextHandler.is())
1491 {
1492 m_xNextHandler->endDocument();
1493 }
1494}
1495
1497 const OUString& rName,
1498 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
1499{
1500 assert(m_pNamespaceMap);
1501 std::optional<SvXMLNamespaceMap> pRewindMap(
1502 SvXMLImport::processNSAttributes(m_pNamespaceMap, nullptr, xAttribs));
1503
1504 OUString localName;
1505 sal_uInt16 const nPrefix(m_pNamespaceMap->GetKeyByAttrName(rName, &localName));
1506
1507 std::unique_ptr<Context> pContext;
1508
1509 if (m_ContextStack.empty())
1510 {
1511 if ((nPrefix != XML_NAMESPACE_DSIG && nPrefix != XML_NAMESPACE_DSIG_OOO)
1512 || localName != "document-signatures")
1513 {
1514 throw css::xml::sax::SAXException(
1515 "xmlsecurity: unexpected root element", nullptr,
1516 css::uno::Any());
1517 }
1518
1519 pContext.reset(new DsigSignaturesContext(*this, std::move(pRewindMap)));
1520
1521 }
1522 else
1523 {
1524 pContext = m_ContextStack.top()->CreateChildContext(
1525 std::move(pRewindMap), nPrefix, localName);
1526 }
1527
1528 m_ContextStack.push(std::move(pContext));
1529
1530 try
1531 {
1532 m_ContextStack.top()->StartElement(xAttribs);
1533
1534 if (m_xNextHandler.is())
1535 {
1536 m_xNextHandler->startElement(rName, xAttribs);
1537 }
1538 }
1539 catch (css::uno::Exception& )
1540 {//getCaughtException MUST be the first line in the catch block
1541 css::uno::Any exc = cppu::getCaughtException();
1542 throw css::xml::sax::SAXException(
1543 "xmlsecurity: Exception in XSecParser::startElement",
1544 nullptr, exc);
1545 }
1546 catch (...)
1547 {
1548 throw css::xml::sax::SAXException(
1549 "xmlsecurity: unexpected exception in XSecParser::startElement", nullptr,
1550 css::uno::Any());
1551 }
1552}
1553
1554void SAL_CALL XSecParser::endElement(const OUString& rName)
1555{
1556 assert(!m_ContextStack.empty()); // this should be checked by sax parser?
1557
1558 try
1559 {
1560 m_ContextStack.top()->EndElement();
1561
1562 if (m_xNextHandler.is())
1563 {
1564 m_xNextHandler->endElement(rName);
1565 }
1566 }
1567 catch (css::uno::Exception& )
1568 {//getCaughtException MUST be the first line in the catch block
1569 css::uno::Any exc = cppu::getCaughtException();
1570 throw css::xml::sax::SAXException(
1571 "xmlsecurity: Exception in XSecParser::endElement",
1572 nullptr, exc);
1573 }
1574 catch (...)
1575 {
1576 throw css::xml::sax::SAXException(
1577 "xmlsecurity: unexpected exception in XSecParser::endElement", nullptr,
1578 css::uno::Any());
1579 }
1580
1581 if (m_ContextStack.top()->m_pOldNamespaceMap)
1582 {
1583 m_pNamespaceMap = std::move(m_ContextStack.top()->m_pOldNamespaceMap);
1584 }
1585 m_ContextStack.pop();
1586}
1587
1588void SAL_CALL XSecParser::characters(const OUString& rChars)
1589{
1590 assert(!m_ContextStack.empty()); // this should be checked by sax parser?
1591 m_ContextStack.top()->Characters(rChars);
1592
1593 if (m_xNextHandler.is())
1594 {
1595 m_xNextHandler->characters(rChars);
1596 }
1597}
1598
1599void SAL_CALL XSecParser::ignorableWhitespace( const OUString& aWhitespaces )
1600{
1601 if (m_xNextHandler.is())
1602 {
1603 m_xNextHandler->ignorableWhitespace( aWhitespaces );
1604 }
1605}
1606
1607void SAL_CALL XSecParser::processingInstruction( const OUString& aTarget, const OUString& aData )
1608{
1609 if (m_xNextHandler.is())
1610 {
1611 m_xNextHandler->processingInstruction(aTarget, aData);
1612 }
1613}
1614
1615void SAL_CALL XSecParser::setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
1616{
1617 if (m_xNextHandler.is())
1618 {
1619 m_xNextHandler->setDocumentLocator( xLocator );
1620 }
1621}
1622
1623/*
1624 * XInitialization
1625 */
1627 const css::uno::Sequence< css::uno::Any >& aArguments )
1628{
1630}
1631
1632/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool haveReferenceForId(std::u16string_view rId) const
Definition: xsecverify.cxx:150
void setGpgCertificate(OUString const &ouGpgCert)
Definition: xsecverify.cxx:346
void setDescription(OUString const &rId, OUString const &rDescription)
Definition: xsecverify.cxx:390
void setDigestValue(sal_Int32 nDigestID, OUString const &ouDigestValue)
Definition: xsecverify.cxx:316
void setGpgKeyID(OUString const &ouKeyID)
Definition: xsecverify.cxx:335
void switchGpgSignature()
Definition: xsecverify.cxx:127
void setId(OUString const &ouId)
Definition: xsecverify.cxx:535
void setSignatureMethod(svl::crypto::SignatureMethodAlgorithm eAlgorithmID)
Sets algorithm from <SignatureMethod Algorithm="...">.
Definition: xsecverify.cxx:119
void setX509CertDigest(OUString const &rCertDigest, sal_Int32 const nReferenceDigestID, std::u16string_view const &rX509IssuerName, std::u16string_view const &rX509SerialNumber)
Definition: xsecverify.cxx:412
void addSignature()
Definition: xsecverify.cxx:101
void setSignatureValue(OUString const &ouSignatureValue)
Definition: xsecverify.cxx:305
void setInvalidSignatureImage(std::u16string_view rInvalidSigImg)
Definition: xsecverify.cxx:505
void collectToVerify(std::u16string_view referenceId)
Definition: xsecverify.cxx:547
void setGpgOwner(OUString const &ouGpgOwner)
Definition: xsecverify.cxx:357
void addStreamReference(const OUString &ouUri, bool isBinary, sal_Int32 nDigestID)
Definition: xsecverify.cxx:180
void setDate(OUString const &rId, OUString const &ouDate)
Definition: xsecverify.cxx:368
void setX509Data(std::vector< std::pair< OUString, OUString > > &rX509IssuerSerials, std::vector< OUString > const &rX509Certificates)
Definition: xsecverify.cxx:247
void setValidSignatureImage(std::u16string_view rValidSigImg)
Definition: xsecverify.cxx:496
void addReference(const OUString &ouUri, sal_Int32 nDigestID, const OUString &ouType)
Definition: xsecverify.cxx:169
void setReferenceCount() const
Definition: xsecverify.cxx:213
void addEncapsulatedX509Certificate(const OUString &rEncapsulatedX509Certificate)
Definition: xsecverify.cxx:523
void setSignatureLineId(const OUString &rSignatureLineId)
Definition: xsecverify.cxx:514
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &)
Definition: xsecparser.cxx:51
std::optional< SvXMLNamespaceMap > m_pOldNamespaceMap
Definition: xsecparser.cxx:39
virtual void EndElement()
Definition: xsecparser.cxx:56
XSecParser & m_rParser
Definition: xsecparser.cxx:37
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const, OUString const &)
Definition: xsecparser.cxx:90
virtual void Characters(OUString const &)
Definition: xsecparser.cxx:64
Context(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:42
virtual ~Context()=default
virtual void Characters(OUString const &rChars) override
DcDateContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
DcDescriptionContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
virtual void Characters(OUString const &rChars) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:489
DsDigestMethodContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_Int32 &rReferenceDigestID)
Definition: xsecparser.cxx:481
DsDigestValueContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
Definition: xsecparser.cxx:454
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:468
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &) override
Definition: xsecparser.cxx:462
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:391
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:397
DsKeyInfoContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:385
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
DsObjectContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
DsPGPDataContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:211
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &) override
Definition: xsecparser.cxx:217
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:223
DsPGPKeyIDContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:190
virtual void EndElement() override
Definition: xsecparser.cxx:196
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:201
DsPGPKeyPacketContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:166
virtual void EndElement() override
Definition: xsecparser.cxx:172
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:177
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:627
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:589
DsReferenceContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:583
virtual void EndElement() override
Definition: xsecparser.cxx:600
DsSignatureContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:657
DsSignatureMethodContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:651
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
DsSignaturePropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void EndElement() override
DsSignaturePropertyContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:441
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:430
DsSignatureValueContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:424
virtual void EndElement() override
Definition: xsecparser.cxx:436
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:690
DsSignedInfoContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:673
virtual void EndElement() override
Definition: xsecparser.cxx:685
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:679
DsTransformContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool &rIsC14N)
Definition: xsecparser.cxx:520
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:528
DsTransformsContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool &rIsC14N)
Definition: xsecparser.cxx:550
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:558
DsX509CertificateContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
Definition: xsecparser.cxx:250
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:258
can't be sure what is supposed to happen here because the spec is clear as mud
Definition: xsecparser.cxx:343
std::vector< OUString > m_X509Certificates
Definition: xsecparser.cxx:348
virtual void EndElement() override
Definition: xsecparser.cxx:357
std::vector< std::pair< OUString, OUString > > m_X509IssuerSerials
Definition: xsecparser.cxx:347
DsX509DataContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:351
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:362
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:300
DsX509IssuerNameContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
Definition: xsecparser.cxx:292
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:323
DsX509IssuerSerialContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rIssuerName, OUString &rSerialNumber)
Definition: xsecparser.cxx:314
DsX509SerialNumberContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rValue)
Definition: xsecparser.cxx:271
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:279
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
DsigSignaturesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
virtual void EndElement() override
Definition: xsecparser.cxx:148
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:153
LoPGPOwnerContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:142
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:945
LoSignatureLineContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
Definition: xsecparser.cxx:938
virtual void EndElement() override
Definition: xsecparser.cxx:852
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:864
LoSignatureLineIdContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
Definition: xsecparser.cxx:845
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:928
LoSignatureLineInvalidImageContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
Definition: xsecparser.cxx:909
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:896
LoSignatureLineValidImageContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
Definition: xsecparser.cxx:877
note: anything in ds:Object should be trusted only if there is a ds:Reference to it so it is signed (...
Definition: xsecparser.cxx:111
ReferencedContextImpl(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
Definition: xsecparser.cxx:116
OUString CheckIdAttrReferenced(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs)
Definition: xsecparser.cxx:124
UnknownContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:77
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:83
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
XadesCertContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void EndElement() override
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:982
XadesCertDigestContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, OUString &rDigestValue, sal_Int32 &rReferenceDigestID)
Definition: xsecparser.cxx:973
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:753
XadesCertificateValuesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:741
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:747
virtual void Characters(OUString const &rChars) override
Definition: xsecparser.cxx:731
XadesEncapsulatedX509CertificateContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:714
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:720
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
XadesQualifyingPropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
XadesSignedPropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
XadesSignedSignaturePropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
XadesSigningCertificateContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
XadesSigningTimeContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, bool const isReferenced)
virtual void EndElement() override
virtual void Characters(OUString const &rChars) override
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:819
XadesUnsignedPropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:813
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:825
virtual std::unique_ptr< Context > CreateChildContext(std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap, sal_uInt16 const nNamespace, OUString const &rName) override
Definition: xsecparser.cxx:782
XadesUnsignedSignaturePropertiesContext(XSecParser &rParser, std::optional< SvXMLNamespaceMap > &&pOldNamespaceMap)
Definition: xsecparser.cxx:770
virtual void StartElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs) override
Definition: xsecparser.cxx:776
XMLSignatureHelper & m_rXMLSignatureHelper
Definition: xsecparser.hxx:116
static OUString getIdAttr(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs)
XSecParser(XMLSignatureHelper &rXMLSignatureHelper, XSecController *pXSecController)
OUString HandleIdAttr(css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrs)
virtual void SAL_CALL startDocument() override
virtual void SAL_CALL endDocument() override
XSecController * m_pXSecController
Definition: xsecparser.hxx:108
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xNextHandler
Definition: xsecparser.hxx:114
virtual void SAL_CALL endElement(const OUString &aName) override
std::optional< SvXMLNamespaceMap > m_pNamespaceMap
Definition: xsecparser.hxx:103
virtual void SAL_CALL characters(const OUString &aChars) override
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
std::stack< std::unique_ptr< Context > > m_ContextStack
Definition: xsecparser.hxx:100
FastSaxParserImpl & m_rParser
Sequence< PropertyValue > aArguments
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
constexpr OUStringLiteral aData
Any SAL_CALL getCaughtException()
Unknown
XML_N_DSIG
XML_N_LO_EXT
XML_N_DS
XML_XML
XML_N_XADES132
XML_N_DSIG_OOO
XML_N_DC
XML_N_XADES141
XML_N_XML
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
OReadStatusBarDocumentHandler::StatusBar_XML_Namespace nNamespace
constexpr sal_uInt16 XML_NAMESPACE_DC
constexpr sal_uInt16 XML_NAMESPACE_XADES132
constexpr sal_uInt16 XML_NAMESPACE_XML
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_XADES141
constexpr sal_uInt16 XML_NAMESPACE_DS
constexpr sal_uInt16 XML_NAMESPACE_DSIG_OOO
constexpr sal_uInt16 XML_NAMESPACE_DSIG
constexpr OUStringLiteral ALGO_XMLDSIGSHA512
Definition: xsecctl.hxx:60
constexpr OUStringLiteral ALGO_XMLDSIGSHA256
Definition: xsecctl.hxx:59
constexpr OUStringLiteral ALGO_ECDSASHA512
Definition: xsecctl.hxx:57
constexpr OUStringLiteral ALGO_ECDSASHA1
Definition: xsecctl.hxx:55
constexpr OUStringLiteral ALGO_C14N
Definition: xsecctl.hxx:51
constexpr OUStringLiteral ALGO_XMLDSIGSHA1
Definition: xsecctl.hxx:58
constexpr OUStringLiteral ALGO_ECDSASHA256
Definition: xsecctl.hxx:56