Bump version to 24.04.3.4
[LibreOffice.git] / xmlsecurity / inc / pdfsignaturehelper.hxx
blobea24685d2ae4bc6dca40215d72003c6afd851675
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 */
11 #pragma once
13 #include "xmlsecuritydllapi.h"
15 #include <svl/sigstruct.hxx>
17 namespace com::sun::star
19 namespace frame
21 class XModel;
23 namespace io
25 class XInputStream;
27 namespace security
29 class XCertificate;
31 namespace security
33 struct DocumentSignatureInformation;
35 namespace xml::crypto
37 class XSecurityEnvironment;
40 class SvStream;
42 /// Handles signatures of a PDF file.
43 class XMLSECURITY_DLLPUBLIC PDFSignatureHelper
45 SignatureInformations m_aSignatureInfos;
47 css::uno::Reference<css::security::XCertificate> m_xCertificate;
48 OUString m_aDescription;
50 public:
51 PDFSignatureHelper();
52 bool ReadAndVerifySignature(const css::uno::Reference<css::io::XInputStream>& xInputStream);
53 bool ReadAndVerifySignatureSvStream(SvStream& rStream);
54 css::uno::Sequence<css::security::DocumentSignatureInformation>
55 GetDocumentSignatureInformations(
56 const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& xSecEnv) const;
57 SignatureInformations const& GetSignatureInformations() const;
59 /// Return the ID of the next created signature.
60 sal_Int32 GetNewSecurityId() const;
61 /// Certificate to be used next time signing is performed.
62 void SetX509Certificate(const css::uno::Reference<css::security::XCertificate>& xCertificate);
63 /// Comment / reason to be used next time signing is performed.
64 void SetDescription(const OUString& rDescription);
65 /// Append a new signature at the end of xInputStream.
66 bool Sign(const css::uno::Reference<css::frame::XModel>& xModel,
67 const css::uno::Reference<css::io::XInputStream>& xInputStream, bool bAdES);
68 /// Remove the signature at nPosition (and all dependent signatures) from xInputStream.
69 static bool RemoveSignature(const css::uno::Reference<css::io::XInputStream>& xInputStream,
70 sal_uInt16 nPosition);
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */