1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24//i20156 - new file for xmlsecurity module
25
26/** -- idl definition -- **/
27
28#ifndef __com_sun_star_security_XDocumentDigitalSignatures_idl_
29#define __com_sun_star_security_XDocumentDigitalSignatures_idl_
30
31#include <com/sun/star/uno/XInterface.idl>
32#include <com/sun/star/io/XInputStream.idl>
33#include <com/sun/star/io/XStream.idl>
34#include <com/sun/star/embed/XStorage.idl>
35#include <com/sun/star/security/DocumentSignatureInformation.idl>
36#include <com/sun/star/security/XCertificate.idl>
37
38module com { module sun { module star { module security {
39
40/** interface for signing and verifying digital signatures in office documents
41
42    <p>
43    This interface can be used to digitaly sign different content in a office document.
44    It can also be used to verify digital signatures.
45    </p>
46 */
47
48interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface
49{
50	/** signs the content of the document including text and pictures.
51
52       <p>Macros will not be signed.</p>
53	 */
54    boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage,
55								 [in] ::com::sun::star::io::XStream xSignStream);
56
57    /** checks for digital signatures and their status.
58
59        <p>Only document content will be checked.</p>
60	 */
61    sequence< com::sun::star::security::DocumentSignatureInformation > verifyDocumentContentSignatures(
62								[in] ::com::sun::star::embed::XStorage xStorage,
63								[in] ::com::sun::star::io::XInputStream xSignInStream );
64
65    /** shows the digital signatures of the document content
66	 */
67    void showDocumentContentSignatures(
68								[in] ::com::sun::star::embed::XStorage xStorage,
69								[in] ::com::sun::star::io::XInputStream xSignInStream );
70
71    /** allows to get the default stream name for storing of the signature of
72	    the document content.
73	 */
74	string getDocumentContentSignatureDefaultStreamName();
75
76	/** signs the content of the Scripting including macros and basic dialogs
77
78        <p>The rest of document content will not be signed.</p>
79	 */
80    boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage,
81								  [in] ::com::sun::star::io::XStream xSignStream);
82
83    /** checks for digital signatures and their status.
84
85        <p>Only Scripting content will be checked.</p>
86	 */
87    sequence< com::sun::star::security::DocumentSignatureInformation > verifyScriptingContentSignatures(
88								[in] ::com::sun::star::embed::XStorage xStorage,
89								[in] ::com::sun::star::io::XInputStream xSignInStream );
90
91    /** shows the digital signatures of the scripting content
92	 */
93    void showScriptingContentSignatures(
94								[in] ::com::sun::star::embed::XStorage xStorage,
95								[in] ::com::sun::star::io::XInputStream xSignInStream );
96
97    /** allows to get the default stream name for storing of the signature of
98	    the scripting content.
99	 */
100	string getScriptingContentSignatureDefaultStreamName();
101
102	/** signs the full Package, which means everything in the storage excecpt the content of META-INF
103	 */
104    boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage,
105						 [in] ::com::sun::star::io::XStream xSignStream);
106
107    /** checks for digital signatures and their status.
108
109        <p>Only Package content will be checked.</p>
110	 */
111    sequence< com::sun::star::security::DocumentSignatureInformation > verifyPackageSignatures(
112						[in] ::com::sun::star::embed::XStorage Storage,
113						[in] ::com::sun::star::io::XInputStream xSignInStream );
114
115    /** shows the digital signatures of the package
116	 */
117    void showPackageSignatures(
118						[in] ::com::sun::star::embed::XStorage xStorage,
119						[in] ::com::sun::star::io::XInputStream xSignInStream );
120
121    /** allows to get the default stream name for storing of the signature of
122	    the package.
123	 */
124	string getPackageSignatureDefaultStreamName();
125
126
127    void showCertificate( [in] com::sun::star::security::XCertificate Certificate );
128
129
130   	/** manages trusted sources (Authors and paths )
131     */
132
133    void    manageTrustedSources();
134    boolean isAuthorTrusted( [in] com::sun::star::security::XCertificate Author );
135    boolean isLocationTrusted( [in] string Location );
136
137    // These method should raise confirmation dialog, so it can not used from bad macros...
138    void    addAuthorToTrustedSources( [in] com::sun::star::security::XCertificate Author );
139    void    addLocationToTrustedSources( [in] string Location );
140
141
142
143} ;
144
145} ; } ; } ; } ;
146
147#endif
148
149
150