/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: XDocumentDigitalSignatures.idl,v $
 *
 *  $Revision: 1.5 $
 *
 *  last change: $Author: rt $ $Date: 2005-11-11 09:09:53 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

//i20156 - new file for xmlsecurity module

/** -- idl definition -- **/

#ifndef __com_sun_star_security_XDocumentDigitalSignatures_idl_
#define __com_sun_star_security_XDocumentDigitalSignatures_idl_

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/io/XInputStream.idl>
#include <com/sun/star/io/XStream.idl>
#include <com/sun/star/embed/XStorage.idl>
#include <com/sun/star/security/DocumentSignatureInformation.idl>
#include <com/sun/star/security/XCertificate.idl>

module com { module sun { module star { module security {

/** interface for signing and verifying digital signatures in office documents

    <p>
    This interface can be used to digitaly sign different content in a office document.
    It can also be used to verify digital signatures.
    </p>
 */

interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface
{
    /**
     * Sign the content of the document including text and pictures.
       Macros will not be signed.
     */
    boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage,
                                 [in] ::com::sun::star::io::XStream xSignStream);

    /**
     * Check for digital signatures and their status.
       Only document content will be checked.
     */
    sequence< com::sun::star::security::DocumentSignatureInformation > verifyDocumentContentSignatures(
                                [in] ::com::sun::star::embed::XStorage xStorage,
                                [in] ::com::sun::star::io::XInputStream xSignInStream );

    /**
     * Show the digital signatures of the document content
     */
    void showDocumentContentSignatures(
                                [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 document content.
     */
    string getDocumentContentSignatureDefaultStreamName();

    /**
     * Sign the content of the Scripting including macros and basic dialogs
       Rest of document content will not be signed.
     */
    boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage,
                                  [in] ::com::sun::star::io::XStream xSignStream);

    /**
     * Check for digital signatures and their status.
       Only Scripting content will be checked.
     */
    sequence< com::sun::star::security::DocumentSignatureInformation > verifyScriptingContentSignatures(
                                [in] ::com::sun::star::embed::XStorage xStorage,
                                [in] ::com::sun::star::io::XInputStream xSignInStream );

    /**
     * Show the digital signatures of the scripting content
     */
    void showScriptingContentSignatures(
                                [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 scripting content.
     */
    string getScriptingContentSignatureDefaultStreamName();

    /**
     * Sign the full Package, which means everything in the storage excecpt the content of META-INF
     */
    boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage,
                         [in] ::com::sun::star::io::XStream xSignStream);

    /**
     * Check 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 );

    /**
     * Show 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 );


       /**
     * Manage trusted sources (Authors and pathes )
     */

    void    manageTrustedSources();
    boolean isAuthorTrusted( [in] com::sun::star::security::XCertificate Author );
    boolean isLocationTrusted( [in] string Location );

    // These method should raise confirmation dialog, so it can not used from bad macros...
    void    addAuthorToTrustedSources( [in] com::sun::star::security::XCertificate Author );
    void    addLocationToTrustedSources( [in] string Location );



} ;

} ; } ; } ; } ;

#endif


