Bump version to 5.0-14
[LibreOffice.git] / xmlsecurity / inc / xmlsecurity / documentsignaturehelper.hxx
blob1e2db05762a3ed5a4d6414a5cab433f6cd206652
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX
21 #define INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX
23 #include <com/sun/star/uno/Reference.h>
24 #include <rtl/ustring.hxx>
25 #include "xmlsecurity/sigstruct.hxx"
27 #include <vector>
29 namespace com {
30 namespace sun {
31 namespace star {
32 namespace io {
33 class XStream; }
34 namespace embed {
35 class XStorage; }
36 }}}
39 /**********************************************************
40 DocumentSignatureHelper
42 Helper class for signing and verifieng document signatures
44 Functions:
45 1. help to create a list of content to be signed/verified
47 **********************************************************/
49 enum DocumentSignatureMode { SignatureModeDocumentContent, SignatureModeMacros, SignatureModePackage };
51 enum DocumentSignatureAlgorithm
53 OOo2Document,
54 OOo3_0Document,
55 OOo3_2Document
58 struct SignatureStreamHelper
60 css::uno::Reference < css::embed::XStorage > xSignatureStorage;
61 css::uno::Reference < css::io::XStream > xSignatureStream;
65 class DocumentSignatureHelper
67 public:
69 static SignatureStreamHelper OpenSignatureStream(
70 const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode,
71 DocumentSignatureMode eDocSigMode );
72 static std::vector< OUString > CreateElementList(
73 const css::uno::Reference < css::embed::XStorage >& rxStore,
74 DocumentSignatureMode eMode,
75 const DocumentSignatureAlgorithm mode);
76 static bool isODFPre_1_2(const OUString & sODFVersion);
77 static bool isOOo3_2_Signature(const SignatureInformation & sigInfo);
78 static DocumentSignatureAlgorithm getDocumentAlgorithm(
79 const OUString & sODFVersion, const SignatureInformation & sigInfo);
80 static bool checkIfAllFilesAreSigned( const ::std::vector< OUString > & sElementList,
81 const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg);
82 static bool equalsReferenceUriManifestPath(
83 const OUString & rUri, const OUString & rPath);
84 static OUString GetDocumentContentSignatureDefaultStreamName();
85 static OUString GetScriptingContentSignatureDefaultStreamName();
86 static OUString GetPackageSignatureDefaultStreamName();
90 #endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */