diff --git a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl index 04f9ef95c1e5..c21bb0317934 100644 --- a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl +++ b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl @@ -29,15 +29,6 @@ module com { module sun { module star { module security { interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface { - /** signs the content of the document including text and pictures. - -

Macros will not be signed.

- - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xSignStream); - /** Signs the content of the document including text and pictures using the given XCertificate. @@ -75,15 +66,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface */ string getDocumentContentSignatureDefaultStreamName(); - /** signs the content of the Scripting including macros and basic dialogs - -

The rest of document content will not be signed.

- - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xSignStream); - /** checks for digital signatures and their status.

Only Scripting content will be checked.

@@ -103,33 +85,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface */ string getScriptingContentSignatureDefaultStreamName(); - /** signs the full Package, which means everything in the storage except the content of META-INF - - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage, - [in] ::com::sun::star::io::XStream xSignStream); - - /** checks for digital signatures and their status. - -

Only Package content will be checked.

- */ - sequence< com::sun::star::security::DocumentSignatureInformation > verifyPackageSignatures( - [in] ::com::sun::star::embed::XStorage Storage, - [in] ::com::sun::star::io::XInputStream xSignInStream ); - - /** shows the digital signatures of the package - */ - void showPackageSignatures( - [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XInputStream xSignInStream ); - - /** allows to get the default stream name for storing of the signature of - the package. - */ - string getPackageSignatureDefaultStreamName(); - - void showCertificate( [in] com::sun::star::security::XCertificate Certificate ); @@ -220,14 +175,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface [in] ::com::sun::star::embed::XStorage xStorage, [in] ::com::sun::star::io::XStream xStream); - /** signs the full Package, which means everything in the storage except the content of META-INF with the provided certificate. - - @since LibreOffice 7.0 - */ - boolean signPackageWithCertificate([in] ::com::sun::star::security::XCertificate xCertificate, - [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xStream); - /** queries the user if they want to trust an untrusted certificate. @since LibreOffice 24.8 diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index a56175fff5b4..924288968961 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -53,7 +53,6 @@ private: std::unique_ptr m_xHintDocFT; std::unique_ptr m_xHintBasicFT; - std::unique_ptr m_xHintPackageFT; std::unique_ptr m_xSignaturesLB; std::unique_ptr m_xSigsValidImg; std::unique_ptr m_xSigsValidFI; diff --git a/xmlsecurity/inc/documentsignaturehelper.hxx b/xmlsecurity/inc/documentsignaturehelper.hxx index eb50b3761423..e13bdc81911d 100644 --- a/xmlsecurity/inc/documentsignaturehelper.hxx +++ b/xmlsecurity/inc/documentsignaturehelper.hxx @@ -36,7 +36,6 @@ enum class DocumentSignatureMode { Content, Macros, - Package }; enum class DocumentSignatureAlgorithm diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 9c89b293bb39..07512080cf9e 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -121,9 +121,6 @@ public: css::uno::Sequence SAL_CALL getSupportedServiceNames() override; // XDocumentDigitalSignatures - sal_Bool SAL_CALL - signDocumentContent(const css::uno::Reference& xStorage, - const css::uno::Reference& xSignStream) override; sal_Bool SAL_CALL signSignatureLine( const css::uno::Reference& Storage, const css::uno::Reference& xSignStream, const OUString& aSignatureLineId, @@ -139,9 +136,6 @@ public: const css::uno::Reference& xStorage, const css::uno::Reference& xSignInStream) override; OUString SAL_CALL getDocumentContentSignatureDefaultStreamName() override; - sal_Bool SAL_CALL - signScriptingContent(const css::uno::Reference& xStorage, - const css::uno::Reference& xSignStream) override; css::uno::Sequence SAL_CALL verifyScriptingContentSignatures( const css::uno::Reference& xStorage, @@ -150,17 +144,6 @@ public: const css::uno::Reference& xStorage, const css::uno::Reference& xSignInStream) override; OUString SAL_CALL getScriptingContentSignatureDefaultStreamName() override; - sal_Bool SAL_CALL - signPackage(const css::uno::Reference& Storage, - const css::uno::Reference& xSignStream) override; - css::uno::Sequence - SAL_CALL verifyPackageSignatures( - const css::uno::Reference& Storage, - const css::uno::Reference& xSignInStream) override; - void SAL_CALL - showPackageSignatures(const css::uno::Reference& xStorage, - const css::uno::Reference& xSignInStream) override; - OUString SAL_CALL getPackageSignatureDefaultStreamName() override; void SAL_CALL showCertificate(const css::uno::Reference& Certificate) override; void SAL_CALL manageTrustedSources() override; @@ -190,11 +173,6 @@ public: css::uno::Reference const & xStoragexStorage, css::uno::Reference const & xStream) override; - sal_Bool SAL_CALL signPackageWithCertificate( - css::uno::Reference const& xCertificate, - css::uno::Reference const& xStoragexStorage, - css::uno::Reference const& xStream) override; - sal_Bool SAL_CALL trustUntrustedCertificate( css::uno::Reference const& xCertificate) override; @@ -286,13 +264,6 @@ DocumentDigitalSignatures::getSupportedServiceNames() return aRet; } -sal_Bool DocumentDigitalSignatures::signDocumentContent( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - sal_Bool DocumentDigitalSignatures::signSignatureLine( const Reference& rxStorage, const Reference& xSignStream, @@ -363,13 +334,6 @@ OUString DocumentDigitalSignatures::getDocumentContentSignatureDefaultStreamName return DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName(); } -sal_Bool DocumentDigitalSignatures::signScriptingContent( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/ ) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - Sequence< css::security::DocumentSignatureInformation > DocumentDigitalSignatures::verifyScriptingContentSignatures( const Reference< css::embed::XStorage >& rxStorage, @@ -392,37 +356,6 @@ OUString DocumentDigitalSignatures::getScriptingContentSignatureDefaultStreamNam return DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName(); } - -sal_Bool DocumentDigitalSignatures::signPackage( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/ ) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - -Sequence< css::security::DocumentSignatureInformation > -DocumentDigitalSignatures::verifyPackageSignatures( - const Reference< css::embed::XStorage >& rxStorage, - const Reference< css::io::XInputStream >& xSignInStream ) -{ - OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); - return ImplVerifySignatures( rxStorage, xSignInStream, DocumentSignatureMode::Package ); -} - -void DocumentDigitalSignatures::showPackageSignatures( - const Reference< css::embed::XStorage >& rxStorage, - const Reference< css::io::XInputStream >& xSignInStream ) -{ - OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); - ImplViewSignatures( rxStorage, xSignInStream, DocumentSignatureMode::Package, true ); -} - -OUString DocumentDigitalSignatures::getPackageSignatureDefaultStreamName( ) -{ - return DocumentSignatureHelper::GetPackageSignatureDefaultStreamName(); -} - - void DocumentDigitalSignatures::ImplViewSignatures( const Reference< css::embed::XStorage >& rxStorage, const Reference< css::io::XInputStream >& xSignStream, @@ -861,16 +794,6 @@ void DocumentDigitalSignatures::SetSignScriptingContent( mxScriptingSignStream = xScriptingSignStream; } -sal_Bool DocumentDigitalSignatures::signPackageWithCertificate( - css::uno::Reference const& xCertificate, - css::uno::Reference const& xStorage, - css::uno::Reference const& xStream) -{ - uno::Reference xModel; - return signWithCertificateImpl(xModel, xCertificate, xStorage, xStream, - DocumentSignatureMode::Package); -} - sal_Bool DocumentDigitalSignatures::trustUntrustedCertificate( css::uno::Reference const& xCertificate) { diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 0b1173f70e7a..15f8e98b4f63 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -200,7 +200,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( , m_bWarningShowSignMacro(false) , m_xHintDocFT(m_xBuilder->weld_label(u"dochint"_ustr)) , m_xHintBasicFT(m_xBuilder->weld_label(u"macrohint"_ustr)) - , m_xHintPackageFT(m_xBuilder->weld_label(u"packagehint"_ustr)) , m_xSignaturesLB(m_xBuilder->weld_tree_view(u"signatures"_ustr)) , m_xSigsValidImg(m_xBuilder->weld_image(u"validimg"_ustr)) , m_xSigsValidFI(m_xBuilder->weld_label(u"validft"_ustr)) @@ -256,9 +255,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( case DocumentSignatureMode::Macros: m_xHintBasicFT->show(); break; - case DocumentSignatureMode::Package: - m_xHintPackageFT->show(); - break; } if (comphelper::LibreOfficeKit::isActive()) diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index b35c709915f4..e3908fc5ee76 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -281,12 +281,6 @@ DocumentSignatureHelper::CreateElementList( } } break; - case DocumentSignatureMode::Package: - { - // Everything except META-INF - ImplFillElementList(aElements, rxStore, std::u16string_view(), true, mode); - } - break; } return aElements; diff --git a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui index 34e68a5eed3a..483605961f2c 100644 --- a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui +++ b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui @@ -369,17 +369,7 @@ - - False - True - The following have signed this package: - 0 - - - False - True - 5 - +