1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 __com_sun_star_security_XDocumentDigitalSignatures_idl_
21 #define __com_sun_star_security_XDocumentDigitalSignatures_idl_
23 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/io
/XInputStream.idl
>
25 #include
<com
/sun
/star
/io
/XStream.idl
>
26 #include
<com
/sun
/star
/embed
/XStorage.idl
>
27 #include
<com
/sun
/star
/security
/DocumentSignatureInformation.idl
>
28 #include
<com
/sun
/star
/security
/XCertificate.idl
>
30 module com
{ module sun
{ module star
{ module security
{
32 /** interface for signing and verifying digital signatures in office documents
35 This interface can be used to digitally sign different content in a office document.
36 It can also be used to verify digital signatures.
40 interface XDocumentDigitalSignatures
: com
::sun
::star
::uno
::XInterface
42 /** signs the content of the document including text and pictures.
44 <p>Macros will not be signed.</p>
46 boolean signDocumentContent
( [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
47 [in] ::com
::sun
::star
::io
::XStream xSignStream
);
49 /** checks for digital signatures and their status.
51 <p>Only document content will be checked.</p>
53 sequence
< com
::sun
::star
::security
::DocumentSignatureInformation
> verifyDocumentContentSignatures
(
54 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
55 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
57 /** shows the digital signatures of the document content
59 void showDocumentContentSignatures
(
60 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
61 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
63 /** allows to get the default stream name for storing of the signature of
66 string getDocumentContentSignatureDefaultStreamName
();
68 /** signs the content of the Scripting including macros and basic dialogs
70 <p>The rest of document content will not be signed.</p>
72 boolean signScriptingContent
( [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
73 [in] ::com
::sun
::star
::io
::XStream xSignStream
);
75 /** checks for digital signatures and their status.
77 <p>Only Scripting content will be checked.</p>
79 sequence
< com
::sun
::star
::security
::DocumentSignatureInformation
> verifyScriptingContentSignatures
(
80 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
81 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
83 /** shows the digital signatures of the scripting content
85 void showScriptingContentSignatures
(
86 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
87 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
89 /** allows to get the default stream name for storing of the signature of
90 the scripting content.
92 string getScriptingContentSignatureDefaultStreamName
();
94 /** signs the full Package, which means everything in the storage except the content of META-INF
96 boolean signPackage
( [in] ::com
::sun
::star
::embed
::XStorage Storage
,
97 [in] ::com
::sun
::star
::io
::XStream xSignStream
);
99 /** checks for digital signatures and their status.
101 <p>Only Package content will be checked.</p>
103 sequence
< com
::sun
::star
::security
::DocumentSignatureInformation
> verifyPackageSignatures
(
104 [in] ::com
::sun
::star
::embed
::XStorage Storage
,
105 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
107 /** shows the digital signatures of the package
109 void showPackageSignatures
(
110 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
111 [in] ::com
::sun
::star
::io
::XInputStream xSignInStream
);
113 /** allows to get the default stream name for storing of the signature of
116 string getPackageSignatureDefaultStreamName
();
119 void showCertificate
( [in] com
::sun
::star
::security
::XCertificate Certificate
);
122 /** manages trusted sources (Authors and paths )
125 void manageTrustedSources
();
126 boolean isAuthorTrusted
( [in] com
::sun
::star
::security
::XCertificate Author
);
127 boolean isLocationTrusted
( [in] string Location
);
129 // These method should raise confirmation dialog, so it can not used from bad macros...
130 void addAuthorToTrustedSources
( [in] com
::sun
::star
::security
::XCertificate Author
);
131 void addLocationToTrustedSources
( [in] string Location
);
133 /** This method shows CertificateChooser dialog, used by document and PDF signing
135 com
::sun
::star
::security
::XCertificate chooseCertificate
();
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */