1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28//i20156 - new file for xmlsecurity module
29
30/** -- idl definition -- **/
31
32#ifndef __com_sun_star_security_XDocumentDigitalSignatures_idl_
33#define __com_sun_star_security_XDocumentDigitalSignatures_idl_
34
35#include <com/sun/star/uno/XInterface.idl>
36#include <com/sun/star/io/XInputStream.idl>
37#include <com/sun/star/io/XStream.idl>
38#include <com/sun/star/embed/XStorage.idl>
39#include <com/sun/star/security/DocumentSignatureInformation.idl>
40#include <com/sun/star/security/XCertificate.idl>
41
42module com { module sun { module star { module security {
43
44/** interface for signing and verifying digital signatures in office documents
45
46    <p>
47    This interface can be used to digitaly sign different content in a office document.
48    It can also be used to verify digital signatures.
49    </p>
50 */
51
52interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface
53{
54	/** signs the content of the document including text and pictures.
55
56       <p>Macros will not be signed.</p>
57	 */
58    boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage,
59								 [in] ::com::sun::star::io::XStream xSignStream);
60
61    /** checks for digital signatures and their status.
62
63        <p>Only document content will be checked.</p>
64	 */
65    sequence< com::sun::star::security::DocumentSignatureInformation > verifyDocumentContentSignatures(
66								[in] ::com::sun::star::embed::XStorage xStorage,
67								[in] ::com::sun::star::io::XInputStream xSignInStream );
68
69    /** shows the digital signatures of the document content
70	 */
71    void showDocumentContentSignatures(
72								[in] ::com::sun::star::embed::XStorage xStorage,
73								[in] ::com::sun::star::io::XInputStream xSignInStream );
74
75    /** allows to get the default stream name for storing of the signature of
76	    the document content.
77	 */
78	string getDocumentContentSignatureDefaultStreamName();
79
80	/** signs the content of the Scripting including macros and basic dialogs
81
82        <p>The rest of document content will not be signed.</p>
83	 */
84    boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage,
85								  [in] ::com::sun::star::io::XStream xSignStream);
86
87    /** checks for digital signatures and their status.
88
89        <p>Only Scripting content will be checked.</p>
90	 */
91    sequence< com::sun::star::security::DocumentSignatureInformation > verifyScriptingContentSignatures(
92								[in] ::com::sun::star::embed::XStorage xStorage,
93								[in] ::com::sun::star::io::XInputStream xSignInStream );
94
95    /** shows the digital signatures of the scripting content
96	 */
97    void showScriptingContentSignatures(
98								[in] ::com::sun::star::embed::XStorage xStorage,
99								[in] ::com::sun::star::io::XInputStream xSignInStream );
100
101    /** allows to get the default stream name for storing of the signature of
102	    the scripting content.
103	 */
104	string getScriptingContentSignatureDefaultStreamName();
105
106	/** signs the full Package, which means everything in the storage excecpt the content of META-INF
107	 */
108    boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage,
109						 [in] ::com::sun::star::io::XStream xSignStream);
110
111    /** checks for digital signatures and their status.
112
113        <p>Only Package content will be checked.</p>
114	 */
115    sequence< com::sun::star::security::DocumentSignatureInformation > verifyPackageSignatures(
116						[in] ::com::sun::star::embed::XStorage Storage,
117						[in] ::com::sun::star::io::XInputStream xSignInStream );
118
119    /** shows the digital signatures of the package
120	 */
121    void showPackageSignatures(
122						[in] ::com::sun::star::embed::XStorage xStorage,
123						[in] ::com::sun::star::io::XInputStream xSignInStream );
124
125    /** allows to get the default stream name for storing of the signature of
126	    the package.
127	 */
128	string getPackageSignatureDefaultStreamName();
129
130
131    void showCertificate( [in] com::sun::star::security::XCertificate Certificate );
132
133
134   	/** manages trusted sources (Authors and pathes )
135     */
136
137    void    manageTrustedSources();
138    boolean isAuthorTrusted( [in] com::sun::star::security::XCertificate Author );
139    boolean isLocationTrusted( [in] string Location );
140
141    // These method should raise confirmation dialog, so it can not used from bad macros...
142    void    addAuthorToTrustedSources( [in] com::sun::star::security::XCertificate Author );
143    void    addLocationToTrustedSources( [in] string Location );
144
145
146
147} ;
148
149} ; } ; } ; } ;
150
151#endif
152
153
154