1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2/* 3 * This file is part of the LibreOffice project. 4 * 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/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 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 . 18 */ 19 20#ifndef __com_sun_star_security_XDocumentDigitalSignatures_idl_ 21#define __com_sun_star_security_XDocumentDigitalSignatures_idl_ 22 23#include <com/sun/star/awt/XWindow.idl> 24#include <com/sun/star/uno/XInterface.idl> 25#include <com/sun/star/io/XInputStream.idl> 26#include <com/sun/star/io/XStream.idl> 27#include <com/sun/star/embed/XStorage.idl> 28#include <com/sun/star/security/DocumentSignatureInformation.idl> 29#include <com/sun/star/security/XCertificate.idl> 30 31module com { module sun { module star { module security { 32 33/** Interface for signing and verifying digital signatures in office documents 34 35 <p> 36 This interface can be used to digitally sign different content in an office document. 37 It can also be used to verify digital signatures. 38 </p> 39 */ 40 41interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface 42{ 43 /** signs the content of the document including text and pictures. 44 45 <p>Macros will not be signed.</p> 46 */ 47 boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage, 48 [in] ::com::sun::star::io::XStream xSignStream); 49 50 /** Signs the content of the document including text and pictures 51 using the given XCertificate. 52 53 Also adds the given Signature Line Id and the signed and unsigned graphics to 54 the signature. 55 56 Macros will not be signed. 57 58 @since LibreOffice 6.1 59 */ 60 boolean signSignatureLine( [in] ::com::sun::star::embed::XStorage xStorage, 61 [in] ::com::sun::star::io::XStream xSignStream, 62 [in] string signatureLineId, 63 [in] ::com::sun::star::security::XCertificate xCertificate, 64 [in] ::com::sun::star::graphic::XGraphic xValidGraphic, 65 [in] ::com::sun::star::graphic::XGraphic xInvalidGraphic, 66 [in] string comment); 67 68 /** checks for digital signatures and their status. 69 70 <p>Only document content will be checked.</p> 71 */ 72 sequence< com::sun::star::security::DocumentSignatureInformation > verifyDocumentContentSignatures( 73 [in] ::com::sun::star::embed::XStorage xStorage, 74 [in] ::com::sun::star::io::XInputStream xSignInStream ); 75 76 /** shows the digital signatures of the document content 77 */ 78 void showDocumentContentSignatures( 79 [in] ::com::sun::star::embed::XStorage xStorage, 80 [in] ::com::sun::star::io::XInputStream xSignInStream ); 81 82 /** allows to get the default stream name for storing of the signature of 83 the document content. 84 */ 85 string getDocumentContentSignatureDefaultStreamName(); 86 87 /** signs the content of the Scripting including macros and basic dialogs 88 89 <p>The rest of document content will not be signed.</p> 90 */ 91 boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage, 92 [in] ::com::sun::star::io::XStream xSignStream); 93 94 /** checks for digital signatures and their status. 95 96 <p>Only Scripting content will be checked.</p> 97 */ 98 sequence< com::sun::star::security::DocumentSignatureInformation > verifyScriptingContentSignatures( 99 [in] ::com::sun::star::embed::XStorage xStorage, 100 [in] ::com::sun::star::io::XInputStream xSignInStream ); 101 102 /** shows the digital signatures of the scripting content 103 */ 104 void showScriptingContentSignatures( 105 [in] ::com::sun::star::embed::XStorage xStorage, 106 [in] ::com::sun::star::io::XInputStream xSignInStream ); 107 108 /** allows to get the default stream name for storing of the signature of 109 the scripting content. 110 */ 111 string getScriptingContentSignatureDefaultStreamName(); 112 113 /** signs the full Package, which means everything in the storage except the content of META-INF 114 */ 115 boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage, 116 [in] ::com::sun::star::io::XStream xSignStream); 117 118 /** checks for digital signatures and their status. 119 120 <p>Only Package content will be checked.</p> 121 */ 122 sequence< com::sun::star::security::DocumentSignatureInformation > verifyPackageSignatures( 123 [in] ::com::sun::star::embed::XStorage Storage, 124 [in] ::com::sun::star::io::XInputStream xSignInStream ); 125 126 /** shows the digital signatures of the package 127 */ 128 void showPackageSignatures( 129 [in] ::com::sun::star::embed::XStorage xStorage, 130 [in] ::com::sun::star::io::XInputStream xSignInStream ); 131 132 /** allows to get the default stream name for storing of the signature of 133 the package. 134 */ 135 string getPackageSignatureDefaultStreamName(); 136 137 138 void showCertificate( [in] com::sun::star::security::XCertificate Certificate ); 139 140 141 /** manages trusted sources (Authors and paths ) 142 */ 143 void manageTrustedSources(); 144 boolean isAuthorTrusted( [in] com::sun::star::security::XCertificate Author ); 145 boolean isLocationTrusted( [in] string Location ); 146 147 // These methods should raise a confirmation dialog, so they can not be misused from bad macros. 148 void addAuthorToTrustedSources( [in] com::sun::star::security::XCertificate Author ); 149 void addLocationToTrustedSources( [in] string Location ); 150 151 /** This method shows the CertificateChooser dialog, used by document and PDF signing 152 Shows only private certificates 153 154 @since LibreOffice 5.3 155 */ 156 com::sun::star::security::XCertificate chooseCertificate( [out] string Description ); 157 158 /** This is an alias for 'chooseCertificate', shows the CertificateChooser dialog 159 with private certificates 160 161 @since LibreOffice 6.0 162 */ 163 com::sun::star::security::XCertificate chooseSigningCertificate( [out] string Description ); 164 165 /** This shows the certificate selection dialog and allows to only select the certificate 166 without actually signing the document. 167 168 @since LibreOffice 6.1 169 */ 170 com::sun::star::security::XCertificate selectSigningCertificate( [out] string Description ); 171 172 /** This shows the certificate selection dialog and allows to only select the certificate 173 without actually signing the document. Only certificates of the given type will be shown. 174 175 @since LibreOffice 6.2 176 */ 177 com::sun::star::security::XCertificate selectSigningCertificateWithType( 178 [in] CertificateKind certificateKind, 179 [out] string Description); 180 181 /** This method shows the CertificateChooser dialog with all certificates, private and 182 other people's. Useful when choosing certificate/key for encryption 183 184 @since LibreOffice 6.0 185 */ 186 sequence< com::sun::star::security::XCertificate > chooseEncryptionCertificate( ); 187 188 /** This method shows the CertificateChooser dialog, used by document and PDF signing 189 Shows only private certificates and returns usage string in addition to description. 190 191 @since LibreOffice 6.0 192 */ 193 com::sun::star::security::XCertificate chooseCertificateWithProps( [out] sequence<::com::sun::star::beans::PropertyValue> Properties); 194 195 /** Signs the content of the document with the provided certificate. 196 197 @since LibreOffice 6.2 198 */ 199 boolean signDocumentWithCertificate([in] ::com::sun::star::security::XCertificate xCertificate, 200 [in] ::com::sun::star::embed::XStorage xStorage, 201 [in] ::com::sun::star::io::XStream xStream); 202 203 /** Set parent window to use when showing dialogs 204 205 @since LibreOffice 6.3 206 */ 207 void setParentWindow([in] ::com::sun::star::awt::XWindow xParentWindow); 208}; 209 210} ; } ; } ; } ; 211 212#endif 213 214/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 215