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 // MARKER(update_precomp.py): autogen include statement, do not remove
29 
30 #include "precompiled_xmlsecurity.hxx"
31 
32 #include <documentdigitalsignatures.hxx>
33 #include <xmlsecurity/digitalsignaturesdialog.hxx>
34 #include <xmlsecurity/certificateviewer.hxx>
35 #include <xmlsecurity/macrosecurity.hxx>
36 #include <xmlsecurity/biginteger.hxx>
37 #include <xmlsecurity/global.hrc>
38 
39 #include <xmloff/xmluconv.hxx>
40 
41 #include <../dialogs/resourcemanager.hxx>
42 #include <com/sun/star/embed/XStorage.hpp>
43 #include <com/sun/star/embed/XTransactedObject.hpp>
44 #include <com/sun/star/embed/ElementModes.hpp>
45 #include <com/sun/star/ucb/XContent.hpp>
46 #include <com/sun/star/ucb/XContentProvider.hpp>
47 #include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
48 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
49 #include <com/sun/star/ucb/XCommandProcessor.hpp>
50 #include <com/sun/star/ucb/Command.hpp>
51 #include <tools/urlobj.hxx>
52 #include <vcl/msgbox.hxx>
53 #include <unotools/securityoptions.hxx>
54 #include <com/sun/star/security/CertificateValidity.hpp>
55 #include <com/sun/star/security/SerialNumberAdapter.hpp>
56 #include <ucbhelper/contentbroker.hxx>
57 #include <unotools/ucbhelper.hxx>
58 #include <comphelper/componentcontext.hxx>
59 #include "comphelper/documentconstants.hxx"
60 
61 #include "com/sun/star/lang/IllegalArgumentException.hpp"
62 
63 #include <stdio.h>
64 
65 
66 using namespace ::com::sun::star;
67 using namespace ::com::sun::star::uno;
68 namespace css = ::com::sun::star;
69 
70 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
71 
72 DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< XComponentContext >& rxCtx ):
73     mxCtx(rxCtx),
74     m_sODFVersion(ODFVER_012_TEXT),
75     m_nArgumentsCount(0),
76     m_bHasDocumentSignature(false)
77 {
78 }
79 
80 void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments)
81 		throw (css::uno::Exception, css::uno::RuntimeException)
82 {
83     if (aArguments.getLength() == 0 || aArguments.getLength() > 2)
84         throw css::lang::IllegalArgumentException(
85         OUSTR("DocumentDigitalSignatures::initialize requires one or two arguments"),
86         Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 0);
87 
88     m_nArgumentsCount = aArguments.getLength();
89 
90     if (!(aArguments[0] >>= m_sODFVersion))
91         throw css::lang::IllegalArgumentException(
92         OUSTR("DocumentDigitalSignatures::initialize: the first arguments must be a string"),
93         Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 0);
94 
95     if (aArguments.getLength() == 2
96         && !(aArguments[1] >>= m_bHasDocumentSignature))
97         throw css::lang::IllegalArgumentException(
98         OUSTR("DocumentDigitalSignatures::initialize: the second arguments must be a bool"),
99         Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 1);
100 
101     //the Version is supported as of ODF1.2, so for and 1.1 document or older we will receive the
102     //an empty string. In this case we set it to ODFVER_010_TEXT. Then we can later check easily
103     //if initialize was called. Only then m_sODFVersion.getLength() is greater than 0
104     if (m_sODFVersion.getLength() == 0)
105         m_sODFVersion = ODFVER_010_TEXT;
106 }
107 
108 sal_Bool DocumentDigitalSignatures::signDocumentContent(
109     const Reference< css::embed::XStorage >& rxStorage,
110     const Reference< css::io::XStream >& xSignStream)
111         throw (RuntimeException)
112 {
113     OSL_ENSURE(m_sODFVersion.getLength(), "DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
114     return ImplViewSignatures( rxStorage, xSignStream, SignatureModeDocumentContent, false );
115 }
116 
117 Sequence< css::security::DocumentSignatureInformation >
118 DocumentDigitalSignatures::verifyDocumentContentSignatures(
119     const Reference< css::embed::XStorage >& rxStorage,
120     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
121 {
122     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
123     return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeDocumentContent );
124 }
125 
126 void DocumentDigitalSignatures::showDocumentContentSignatures(
127     const Reference< css::embed::XStorage >& rxStorage,
128     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
129 {
130     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
131     ImplViewSignatures( rxStorage, xSignInStream, SignatureModeDocumentContent, true );
132 }
133 
134 ::rtl::OUString DocumentDigitalSignatures::getDocumentContentSignatureDefaultStreamName()
135     throw (css::uno::RuntimeException)
136 {
137 	return DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName();
138 }
139 
140 sal_Bool DocumentDigitalSignatures::signScriptingContent(
141     const Reference< css::embed::XStorage >& rxStorage,
142     const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException)
143 {
144     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
145     OSL_ENSURE(m_nArgumentsCount == 2, "DocumentDigitalSignatures: Service was not initialized properly");
146     return ImplViewSignatures( rxStorage, xSignStream, SignatureModeMacros, false );
147 }
148 
149 Sequence< css::security::DocumentSignatureInformation >
150 DocumentDigitalSignatures::verifyScriptingContentSignatures(
151     const Reference< css::embed::XStorage >& rxStorage,
152     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
153 {
154     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
155     return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeMacros );
156 }
157 
158 void DocumentDigitalSignatures::showScriptingContentSignatures(
159     const Reference< css::embed::XStorage >& rxStorage,
160     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
161 {
162     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
163     ImplViewSignatures( rxStorage, xSignInStream, SignatureModeMacros, true );
164 }
165 
166 ::rtl::OUString DocumentDigitalSignatures::getScriptingContentSignatureDefaultStreamName()
167     throw (css::uno::RuntimeException)
168 {
169 	return DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName();
170 }
171 
172 
173 sal_Bool DocumentDigitalSignatures::signPackage(
174     const Reference< css::embed::XStorage >& rxStorage,
175     const Reference< css::io::XStream >& xSignStream  ) throw (RuntimeException)
176 {
177     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
178     return ImplViewSignatures( rxStorage, xSignStream, SignatureModePackage, false );
179 }
180 
181 Sequence< css::security::DocumentSignatureInformation >
182 DocumentDigitalSignatures::verifyPackageSignatures(
183     const Reference< css::embed::XStorage >& rxStorage,
184     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
185 {
186     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
187     return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModePackage );
188 }
189 
190 void DocumentDigitalSignatures::showPackageSignatures(
191     const Reference< css::embed::XStorage >& rxStorage,
192     const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException)
193 {
194     OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2");
195     ImplViewSignatures( rxStorage, xSignInStream, SignatureModePackage, true );
196 }
197 
198 ::rtl::OUString DocumentDigitalSignatures::getPackageSignatureDefaultStreamName(  )
199     throw (::com::sun::star::uno::RuntimeException)
200 {
201 	return DocumentSignatureHelper::GetPackageSignatureDefaultStreamName();
202 }
203 
204 
205 sal_Bool DocumentDigitalSignatures::ImplViewSignatures(
206     const Reference< css::embed::XStorage >& rxStorage,
207     const Reference< css::io::XInputStream >& xSignStream,
208     DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException)
209 {
210 	Reference< io::XStream > xStream;
211 	if ( xSignStream.is() )
212 		xStream = Reference< io::XStream >( xSignStream, UNO_QUERY );
213 	return ImplViewSignatures( rxStorage, xStream, eMode, bReadOnly );
214 }
215 
216 sal_Bool DocumentDigitalSignatures::ImplViewSignatures(
217     const Reference< css::embed::XStorage >& rxStorage, const Reference< css::io::XStream >& xSignStream,
218     DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException)
219 {
220     sal_Bool bChanges = sal_False;
221     DigitalSignaturesDialog aSignaturesDialog(
222         NULL, mxCtx, eMode, bReadOnly, m_sODFVersion, m_bHasDocumentSignature);
223     bool bInit = aSignaturesDialog.Init();
224     DBG_ASSERT( bInit, "Error initializing security context!" );
225     if ( bInit )
226     {
227         aSignaturesDialog.SetStorage( rxStorage );
228         aSignaturesDialog.SetSignatureStream( xSignStream );
229         if ( aSignaturesDialog.Execute() )
230         {
231             if ( aSignaturesDialog.SignaturesChanged() )
232     		{
233     			bChanges = sal_True;
234     			// If we have a storage and no stream, we are responsible for commit
235     			if ( rxStorage.is() && !xSignStream.is() )
236     			{
237                     uno::Reference< embed::XTransactedObject > xTrans( rxStorage, uno::UNO_QUERY );
238                     xTrans->commit();
239     			}
240     		}
241     	}
242     }
243     else
244     {
245         WarningBox aBox( NULL, XMLSEC_RES( RID_XMLSECWB_NO_MOZILLA_PROFILE ) );
246         aBox.Execute();
247     }
248 
249     return bChanges;
250 }
251 
252 Sequence< css::security::DocumentSignatureInformation >
253 DocumentDigitalSignatures::ImplVerifySignatures(
254     const Reference< css::embed::XStorage >& rxStorage,
255     const Reference< css::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (RuntimeException)
256 {
257     if (!rxStorage.is())
258     {
259         DBG_ASSERT(0, "Error, no XStorage provided");
260         return Sequence<css::security::DocumentSignatureInformation>();
261     }
262 	// First check for the InputStream, to avoid unnecessary initialization of the security environemnt...
263 	SignatureStreamHelper aStreamHelper;
264 	Reference< io::XInputStream > xInputStream = xSignStream;
265 
266 	if ( !xInputStream.is() )
267 	{
268 		aStreamHelper = DocumentSignatureHelper::OpenSignatureStream( rxStorage, embed::ElementModes::READ, eMode );
269 		if ( aStreamHelper.xSignatureStream.is() )
270 			xInputStream = Reference< io::XInputStream >( aStreamHelper.xSignatureStream, UNO_QUERY );
271 	}
272 
273 	if ( !xInputStream.is() )
274 		return Sequence< ::com::sun::star::security::DocumentSignatureInformation >(0);
275 
276 
277 	XMLSignatureHelper aSignatureHelper( mxCtx );
278 
279     bool bInit = aSignatureHelper.Init();
280 
281 	DBG_ASSERT( bInit, "Error initializing security context!" );
282 
283 	if ( !bInit )
284 		return Sequence< ::com::sun::star::security::DocumentSignatureInformation >(0);
285 
286 	aSignatureHelper.SetStorage(rxStorage, m_sODFVersion);
287 
288     aSignatureHelper.StartMission();
289 
290 	aSignatureHelper.ReadAndVerifySignature( xInputStream );
291 
292     aSignatureHelper.EndMission();
293 
294     Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecEnv = aSignatureHelper.GetSecurityEnvironment();
295 
296     SignatureInformations aSignInfos = aSignatureHelper.GetSignatureInformations();
297 	int nInfos = aSignInfos.size();
298     Sequence< css::security::DocumentSignatureInformation > aInfos(nInfos);
299     css::security::DocumentSignatureInformation* arInfos = aInfos.getArray();
300 
301     if ( nInfos )
302     {
303        Reference<security::XSerialNumberAdapter> xSerialNumberAdapter =
304             ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
305 
306         for( int n = 0; n < nInfos; ++n )
307         {
308             DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm(
309                 m_sODFVersion, aSignInfos[n]);
310             const std::vector< rtl::OUString > aElementsToBeVerified =
311                 DocumentSignatureHelper::CreateElementList(
312                 rxStorage, ::rtl::OUString(), eMode, mode);
313 
314 		    const SignatureInformation& rInfo = aSignInfos[n];
315             css::security::DocumentSignatureInformation& rSigInfo = arInfos[n];
316 
317             if (rInfo.ouX509Certificate.getLength())
318            	rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
319             if (!rSigInfo.Signer.is())
320                 rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
321 
322             // --> PB 2004-12-14 #i38744# time support again
323             Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year );
324             Time aTime( rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes,
325                         rInfo.stDateTime.Seconds, rInfo.stDateTime.HundredthSeconds );
326             rSigInfo.SignatureDate = aDate.GetDate();
327             rSigInfo.SignatureTime = aTime.GetTime();
328 
329             // Verify certificate
330             //We have patched our version of libxmlsec, so that it does not verify the certificates. This has two
331             //reasons. First we want two separate status for signature and certificate. Second libxmlsec calls
332             //CERT_VerifyCertificate (solaris, linux) falsly, so that it always regards the certificate as valid.
333             //On Window the checking of the certificate path is buggy. It does name matching (issuer, subject name)
334             //to find the parent certificate. It does not take into account that there can be several certificates
335             //with the same subject name.
336             if (rSigInfo.Signer.is())
337             {
338                 try {
339                     rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer,
340                         Sequence<Reference<css::security::XCertificate> >());
341                 } catch (SecurityException& ) {
342                     OSL_ENSURE(0, "Verification of certificate failed");
343                     rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
344                 }
345             }
346             else
347             {
348                 //We should always be aible to get the certificates because it is contained in the document,
349 				//unless the document is damaged so that signature xml file could not be parsed.
350                 rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
351             }
352 
353             rSigInfo.SignatureIsValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED );
354 
355 
356             if ( rSigInfo.SignatureIsValid )
357             {
358                  rSigInfo.SignatureIsValid =
359                       DocumentSignatureHelper::checkIfAllFilesAreSigned(
360                       aElementsToBeVerified, rInfo, mode);
361             }
362             if (eMode == SignatureModeDocumentContent)
363                 rSigInfo.PartialDocumentSignature =
364                     ! DocumentSignatureHelper::isOOo3_2_Signature(aSignInfos[n]);
365 
366         }
367     }
368     return aInfos;
369 
370 }
371 
372 void DocumentDigitalSignatures::manageTrustedSources(  ) throw (RuntimeException)
373 {
374 	// MT: i45295
375 	// SecEnv is only needed to display certificate information from trusted sources.
376 	// Macro Security also has some options where no security environment is needed, so raise dialog anyway.
377 	// Later I should change the code so the Dialog creates the SecEnv on demand...
378 
379 	Reference< dcss::xml::crypto::XSecurityEnvironment > xSecEnv;
380 
381 	XMLSignatureHelper aSignatureHelper( mxCtx );
382 	if ( aSignatureHelper.Init() )
383 		xSecEnv = aSignatureHelper.GetSecurityEnvironment();
384 
385 	MacroSecurity aDlg( NULL, mxCtx, xSecEnv );
386 	aDlg.Execute();
387 }
388 
389 void DocumentDigitalSignatures::showCertificate(
390     const Reference< css::security::XCertificate >& _Certificate ) throw (RuntimeException)
391 {
392     XMLSignatureHelper aSignatureHelper( mxCtx );
393 
394 	bool bInit = aSignatureHelper.Init();
395 
396 	DBG_ASSERT( bInit, "Error initializing security context!" );
397 
398 	if ( bInit )
399 	{
400 		CertificateViewer aViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, sal_False );
401 		aViewer.Execute();
402 	}
403 
404 }
405 
406 ::sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
407     const Reference< css::security::XCertificate >& Author ) throw (RuntimeException)
408 {
409 	sal_Bool bFound = sal_False;
410 
411     Reference<security::XSerialNumberAdapter> xSerialNumberAdapter =
412         ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
413 
414 	::rtl::OUString sSerialNum = xSerialNumberAdapter->toString( Author->getSerialNumber() );
415 
416     Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors();
417 	const SvtSecurityOptions::Certificate* pAuthors = aTrustedAuthors.getConstArray();
418 	const SvtSecurityOptions::Certificate* pAuthorsEnd = pAuthors + aTrustedAuthors.getLength();
419 	for ( ; pAuthors != pAuthorsEnd; ++pAuthors )
420 	{
421 		SvtSecurityOptions::Certificate aAuthor = *pAuthors;
422 		if ( ( aAuthor[0] == Author->getIssuerName() ) && ( aAuthor[1] == sSerialNum ) )
423 		{
424 			bFound = sal_True;
425 			break;
426 		}
427 	}
428 
429 	return bFound;
430 }
431 
432 ::sal_Bool DocumentDigitalSignatures::isLocationTrusted( const ::rtl::OUString& Location ) throw (RuntimeException)
433 {
434 	sal_Bool bFound = sal_False;
435 	INetURLObject aLocObj( Location );
436 	INetURLObject aLocObjLowCase( Location.toAsciiLowerCase() ); // will be used for case insensitive comparing
437 
438 	::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider > xContentProvider;
439 	::ucbhelper::ContentBroker* pBroker = NULL;
440 
441     //warning free code
442 	//if ( aLocObj.GetProtocol() == INET_PROT_FILE && ( pBroker = ::ucbhelper::ContentBroker::get() ) )
443 	//	xContentProvider = pBroker->getContentProviderInterface();
444 	if ( aLocObj.GetProtocol() == INET_PROT_FILE)
445     {
446         pBroker = ::ucbhelper::ContentBroker::get();
447         if (pBroker)
448 		    xContentProvider = pBroker->getContentProviderInterface();
449     }
450 
451     Sequence< ::rtl::OUString > aSecURLs = SvtSecurityOptions().GetSecureURLs();
452 	const ::rtl::OUString* pSecURLs = aSecURLs.getConstArray();
453 	const ::rtl::OUString* pSecURLsEnd = pSecURLs + aSecURLs.getLength();
454 	for ( ; pSecURLs != pSecURLsEnd && !bFound; ++pSecURLs )
455 		bFound = ::utl::UCBContentHelper::IsSubPath( *pSecURLs, Location, xContentProvider );
456 
457 	return bFound;
458 }
459 
460 void DocumentDigitalSignatures::addAuthorToTrustedSources(
461     const Reference< css::security::XCertificate >& Author ) throw (RuntimeException)
462 {
463     SvtSecurityOptions aSecOpts;
464 
465     Reference<security::XSerialNumberAdapter> xSerialNumberAdapter =
466         ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
467 
468     SvtSecurityOptions::Certificate aNewCert( 3 );
469     aNewCert[ 0 ] = Author->getIssuerName();
470     aNewCert[ 1 ] = xSerialNumberAdapter->toString( Author->getSerialNumber() );
471 
472     rtl::OUStringBuffer aStrBuffer;
473     SvXMLUnitConverter::encodeBase64(aStrBuffer, Author->getEncoded());
474     aNewCert[ 2 ] = aStrBuffer.makeStringAndClear();
475 
476 
477     Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = aSecOpts.GetTrustedAuthors();
478     sal_Int32 nCnt = aTrustedAuthors.getLength();
479     aTrustedAuthors.realloc( nCnt + 1 );
480     aTrustedAuthors[ nCnt ] = aNewCert;
481 
482     aSecOpts.SetTrustedAuthors( aTrustedAuthors );
483 }
484 
485 void DocumentDigitalSignatures::addLocationToTrustedSources( const ::rtl::OUString& Location ) throw (RuntimeException)
486 {
487     SvtSecurityOptions aSecOpt;
488 
489 	Sequence< ::rtl::OUString > aSecURLs = aSecOpt.GetSecureURLs();
490     sal_Int32 nCnt = aSecURLs.getLength();
491     aSecURLs.realloc( nCnt + 1 );
492     aSecURLs[ nCnt ] = Location;
493 
494 	aSecOpt.SetSecureURLs( aSecURLs );
495 }
496 
497 rtl::OUString DocumentDigitalSignatures::GetImplementationName() throw (RuntimeException)
498 {
499 	return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) );
500 }
501 
502 Sequence< rtl::OUString > DocumentDigitalSignatures::GetSupportedServiceNames() throw (cssu::RuntimeException)
503 {
504 	Sequence < rtl::OUString > aRet(1);
505 	rtl::OUString* pArray = aRet.getArray();
506 	pArray[0] =  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) );
507 	return aRet;
508 }
509 
510 
511 Reference< XInterface > DocumentDigitalSignatures_CreateInstance(
512 	const Reference< XComponentContext >& rCtx) throw ( Exception )
513 {
514 	return (cppu::OWeakObject*) new DocumentDigitalSignatures( rCtx );
515 }
516 
517