LibreOffice Module xmlsecurity (master) 1
documentsignaturehelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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#pragma once
21
22#include <com/sun/star/uno/Reference.h>
23#include <rtl/ustring.hxx>
24#include <svl/sigstruct.hxx>
25
26#include <vector>
27
28namespace com::sun::star {
29 namespace io { class XStream; }
30 namespace embed { class XStorage; }
31}
32
33namespace com::sun::star::xml::sax { class XDocumentHandler; }
34
36{
37 Content,
38 Macros,
40};
41
43{
44 OOo2,
45 OOo3_0,
46 OOo3_2
47};
48
50{
51 css::uno::Reference < css::embed::XStorage > xSignatureStorage;
52 css::uno::Reference < css::io::XStream > xSignatureStream;
54 sal_Int32 nStorageFormat;
55
58 {
59 }
60};
61
63{
65 const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode,
66 DocumentSignatureMode eDocSigMode );
67
68 std::vector< OUString > CreateElementList(
69 const css::uno::Reference < css::embed::XStorage >& rxStore,
72
73 bool isODFPre_1_2(std::u16string_view sODFVersion);
74 bool isOOo3_2_Signature(const SignatureInformation & sigInfo);
75
77 std::u16string_view sODFVersion, const SignatureInformation & sigInfo);
78
79 bool CanSignWithGPG(const css::uno::Reference < css::embed::XStorage >& rxStore,
80 std::u16string_view sOdfVersion);
81
82 bool checkIfAllFilesAreSigned( const ::std::vector< OUString > & sElementList,
83 const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg);
84
86 std::u16string_view rUri, std::u16string_view rPath);
87
91
93 void AppendContentTypes(const css::uno::Reference<css::embed::XStorage>& xStorage, std::vector<OUString>& rElements);
94
96 const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler);
98 const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler,
99 const SignatureInformation& signatureInfo,
100 const OUString& sDate,
101 const bool bWriteSignatureLineData);
102};
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DocumentSignatureAlgorithm
void writeDigestMethod(const css::uno::Reference< css::xml::sax::XDocumentHandler > &xDocumentHandler)
void AppendContentTypes(const css::uno::Reference< css::embed::XStorage > &xStorage, std::vector< OUString > &rElements)
In case the storage is OOXML, prepend a leading '/' and append content type to the element URIs.
SignatureStreamHelper OpenSignatureStream(const css::uno::Reference< css::embed::XStorage > &rxStore, sal_Int32 nOpenMode, DocumentSignatureMode eDocSigMode)
bool checkIfAllFilesAreSigned(const ::std::vector< OUString > &sElementList, const SignatureInformation &sigInfo, const DocumentSignatureAlgorithm alg)
void writeSignedProperties(const css::uno::Reference< css::xml::sax::XDocumentHandler > &xDocumentHandler, const SignatureInformation &signatureInfo, const OUString &sDate, const bool bWriteSignatureLineData)
bool CanSignWithGPG(const css::uno::Reference< css::embed::XStorage > &rxStore, std::u16string_view sOdfVersion)
OUString GetDocumentContentSignatureDefaultStreamName()
bool equalsReferenceUriManifestPath(std::u16string_view rUri, std::u16string_view rPath)
DocumentSignatureAlgorithm getDocumentAlgorithm(std::u16string_view sODFVersion, const SignatureInformation &sigInfo)
bool isOOo3_2_Signature(const SignatureInformation &sigInfo)
std::vector< OUString > CreateElementList(const css::uno::Reference< css::embed::XStorage > &rxStore, DocumentSignatureMode eMode, const DocumentSignatureAlgorithm mode)
bool isODFPre_1_2(std::u16string_view sODFVersion)
OUString GetScriptingContentSignatureDefaultStreamName()
css::uno::Reference< css::io::XStream > xSignatureStream
css::uno::Reference< css::embed::XStorage > xSignatureStorage
sal_Int32 nStorageFormat
If this is embed::StorageFormats::OFOPXML, then it's expected that xSignatureStream is an empty refer...