summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/digitalsignatures.hxx13
-rw-r--r--include/sfx2/docfile.hxx3
-rw-r--r--include/sfx2/lokhelper.hxx4
-rw-r--r--include/sfx2/objsh.hxx3
-rw-r--r--include/svl/cryptosign.hxx11
5 files changed, 27 insertions, 7 deletions
diff --git a/include/sfx2/digitalsignatures.hxx b/include/sfx2/digitalsignatures.hxx
index 84b77fd759dd..fe5f2bc97874 100644
--- a/include/sfx2/digitalsignatures.hxx
+++ b/include/sfx2/digitalsignatures.hxx
@@ -19,6 +19,10 @@
#include <sal/types.h>
class SfxViewShell;
+namespace svl::crypto
+{
+class SigningContext;
+}
namespace sfx2
{
@@ -27,11 +31,10 @@ class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") Digita
{
public:
/// Same as signDocumentWithCertificate(), but passes the xModel as well.
- virtual bool
- SignModelWithCertificate(const css::uno::Reference<css::frame::XModel>& xModel,
- const css::uno::Reference<css::security::XCertificate>& xCertificate,
- const css::uno::Reference<css::embed::XStorage>& xStorage,
- const css::uno::Reference<css::io::XStream>& xStream)
+ virtual bool SignModelWithCertificate(const css::uno::Reference<css::frame::XModel>& xModel,
+ svl::crypto::SigningContext& rSigningContext,
+ const css::uno::Reference<css::embed::XStorage>& xStorage,
+ const css::uno::Reference<css::io::XStream>& xStream)
= 0;
/// Async replacement for signDocumentContent().
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 9725a71340e5..ccf143c7e2a2 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -47,6 +47,7 @@ namespace com::sun::star::frame
class XModel;
}
namespace ucbhelper { class Content; }
+namespace svl::crypto { class SigningContext; }
class SvKeyValueIterator;
class SfxFilter;
@@ -289,7 +290,7 @@ public:
SAL_DLLPRIVATE bool SignDocumentContentUsingCertificate(
const css::uno::Reference<css::frame::XModel>& xModel, bool bHasValidDocumentSignature,
- const css::uno::Reference<css::security::XCertificate>& xCertificate);
+ svl::crypto::SigningContext& rSigningContext);
// the following two methods must be used and make sense only during saving currently
// TODO/LATER: in future the signature state should be controlled by the medium not by the document
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index bdf7d0816786..a35670332097 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -249,6 +249,10 @@ public:
static void addCertificates(const std::vector<std::string>& rCerts);
/// Parses a private key + certificate pair.
static css::uno::Reference<css::security::XCertificate> getSigningCertificate(const std::string& rCert, const std::string& rKey);
+ /// Decides if it's OK to call getCommandValues(rCommand).
+ static bool supportsCommand(std::u16string_view rCommand);
+ /// Returns information about a given command in JSON format.
+ static void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand);
private:
static int createView(SfxViewFrame& rViewFrame, ViewShellDocId docId);
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 14855e8b62f0..7e6682c57bee 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -147,6 +147,7 @@ namespace o3tl
}
namespace weld { class Window; }
+namespace svl::crypto { class SigningContext; }
enum class HiddenWarningFact
{
@@ -368,7 +369,7 @@ public:
const css::uno::Reference<css::security::XDocumentDigitalSignatures>& xSigner
= css::uno::Reference<css::security::XDocumentDigitalSignatures>());
- bool SignDocumentContentUsingCertificate(const css::uno::Reference<css::security::XCertificate>& xCertificate);
+ bool SignDocumentContentUsingCertificate(svl::crypto::SigningContext& rSigningContext);
bool ResignDocument(css::uno::Sequence< css::security::DocumentSignatureInformation >& rSignaturesInfo);
void SignSignatureLine(weld::Window* pDialogParent, const OUString& aSignatureLineId,
diff --git a/include/svl/cryptosign.hxx b/include/svl/cryptosign.hxx
index 3bb682916edc..a558690bbf48 100644
--- a/include/svl/cryptosign.hxx
+++ b/include/svl/cryptosign.hxx
@@ -92,6 +92,17 @@ private:
OUString m_aSignPassword;
};
+/// Wrapper around a certificate: allows either an actual signing or extracting enough info, so a
+/// 3rd-party can sign our document.
+class SVL_DLLPUBLIC SigningContext
+{
+public:
+ /// If set, the certificate used for signing.
+ css::uno::Reference<css::security::XCertificate> m_xCertificate;
+ /// If m_xCertificate is not set, the time that would be used.
+ sal_Int64 m_nSignatureTime = 0;
+};
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */