1*06b3ce53SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*06b3ce53SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*06b3ce53SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*06b3ce53SAndrew Rist  * distributed with this work for additional information
6*06b3ce53SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*06b3ce53SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*06b3ce53SAndrew Rist  * "License"); you may not use this file except in compliance
9*06b3ce53SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*06b3ce53SAndrew Rist  *
11*06b3ce53SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*06b3ce53SAndrew Rist  *
13*06b3ce53SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*06b3ce53SAndrew Rist  * software distributed under the License is distributed on an
15*06b3ce53SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*06b3ce53SAndrew Rist  * KIND, either express or implied.  See the License for the
17*06b3ce53SAndrew Rist  * specific language governing permissions and limitations
18*06b3ce53SAndrew Rist  * under the License.
19*06b3ce53SAndrew Rist  *
20*06b3ce53SAndrew Rist  *************************************************************/
21*06b3ce53SAndrew Rist 
22*06b3ce53SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_xmlsecurity.hxx"
26cdf0e10cSrcweir #include <sal/config.h>
27cdf0e10cSrcweir #include <rtl/uuid.h>
28cdf0e10cSrcweir #include "xmlsignature_nssimpl.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_
31cdf0e10cSrcweir #include "xmldocumentwrapper_xmlsecimpl.hxx"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_
35cdf0e10cSrcweir #include "xmlelementwrapper_xmlsecimpl.hxx"
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #ifndef _SECURITYENVIRONMENT_NSSIMPL_HXX_
39cdf0e10cSrcweir #include "securityenvironment_nssimpl.hxx"
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #ifndef _XMLSECURITYCONTEXT_NSSIMPL_HXX_
43cdf0e10cSrcweir #include "xmlsecuritycontext_nssimpl.hxx"
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #include "xmlstreamio.hxx"
46cdf0e10cSrcweir #include "errorcallback.hxx"
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #include <sal/types.h>
49cdf0e10cSrcweir //For reasons that escape me, this is what xmlsec does when size_t is not 4
50cdf0e10cSrcweir #if SAL_TYPES_SIZEOFPOINTER != 4
51cdf0e10cSrcweir #    define XMLSEC_NO_SIZE_T
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #include "xmlsec/xmlsec.h"
54cdf0e10cSrcweir #include "xmlsec/xmldsig.h"
55cdf0e10cSrcweir #include "xmlsec/crypto.h"
56cdf0e10cSrcweir 
57cdf0e10cSrcweir using namespace ::com::sun::star::uno ;
58cdf0e10cSrcweir using namespace ::com::sun::star::lang ;
59cdf0e10cSrcweir using ::com::sun::star::lang::XMultiServiceFactory ;
60cdf0e10cSrcweir using ::com::sun::star::lang::XSingleServiceFactory ;
61cdf0e10cSrcweir using ::rtl::OUString ;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
64cdf0e10cSrcweir using ::com::sun::star::xml::wrapper::XXMLDocumentWrapper ;
65cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
66cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XXMLSignature ;
67cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
68cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
69cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
70cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XUriBinding ;
71cdf0e10cSrcweir using ::com::sun::star::xml::crypto::XMLSignatureException ;
72cdf0e10cSrcweir 
XMLSignature_NssImpl(const Reference<XMultiServiceFactory> & aFactory)73cdf0e10cSrcweir XMLSignature_NssImpl :: XMLSignature_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) {
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
~XMLSignature_NssImpl()76cdf0e10cSrcweir XMLSignature_NssImpl :: ~XMLSignature_NssImpl() {
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir /* XXMLSignature */
80cdf0e10cSrcweir Reference< XXMLSignatureTemplate >
generate(const Reference<XXMLSignatureTemplate> & aTemplate,const Reference<XSecurityEnvironment> & aEnvironment)81cdf0e10cSrcweir SAL_CALL XMLSignature_NssImpl :: generate(
82cdf0e10cSrcweir 	const Reference< XXMLSignatureTemplate >& aTemplate ,
83cdf0e10cSrcweir 	const Reference< XSecurityEnvironment >& aEnvironment
84cdf0e10cSrcweir ) throw( com::sun::star::xml::crypto::XMLSignatureException,
85cdf0e10cSrcweir 		 com::sun::star::uno::SecurityException )
86cdf0e10cSrcweir {
87cdf0e10cSrcweir 	xmlSecKeysMngrPtr pMngr = NULL ;
88cdf0e10cSrcweir 	xmlSecDSigCtxPtr pDsigCtx = NULL ;
89cdf0e10cSrcweir 	xmlNodePtr pNode = NULL ;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	if( !aTemplate.is() )
92cdf0e10cSrcweir 		throw RuntimeException() ;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	if( !aEnvironment.is() )
95cdf0e10cSrcweir 		throw RuntimeException() ;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	//Get the xml node
98cdf0e10cSrcweir 	Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ;
99cdf0e10cSrcweir 	if( !xElement.is() ) {
100cdf0e10cSrcweir 		throw RuntimeException() ;
101cdf0e10cSrcweir 	}
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ;
104cdf0e10cSrcweir 	if( !xNodTunnel.is() ) {
105cdf0e10cSrcweir 		throw RuntimeException() ;
106cdf0e10cSrcweir 	}
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	XMLElementWrapper_XmlSecImpl* pElement =
109cdf0e10cSrcweir         reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
110cdf0e10cSrcweir             sal::static_int_cast<sal_uIntPtr>(
111cdf0e10cSrcweir                 xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() )));
112cdf0e10cSrcweir 	if( pElement == NULL ) {
113cdf0e10cSrcweir 		throw RuntimeException() ;
114cdf0e10cSrcweir 	}
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	pNode = pElement->getNativeElement() ;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	//Get the stream/URI binding
119cdf0e10cSrcweir 	Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ;
120cdf0e10cSrcweir 	if( xUriBinding.is() ) {
121cdf0e10cSrcweir 		//Register the stream input callbacks into libxml2
122cdf0e10cSrcweir 		if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 )
123cdf0e10cSrcweir 			throw RuntimeException() ;
124cdf0e10cSrcweir 	}
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	//Get Keys Manager
127cdf0e10cSrcweir 	Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ;
128cdf0e10cSrcweir 	if( !xSecTunnel.is() ) {
129cdf0e10cSrcweir 		 throw RuntimeException() ;
130cdf0e10cSrcweir 	}
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #if 0 //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext
133cdf0e10cSrcweir 	XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ;
134cdf0e10cSrcweir 	if( pSecCtxt == NULL )
135cdf0e10cSrcweir 		throw RuntimeException() ;
136cdf0e10cSrcweir #endif
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	SecurityEnvironment_NssImpl* pSecEnv =
139cdf0e10cSrcweir         reinterpret_cast<SecurityEnvironment_NssImpl*>(
140cdf0e10cSrcweir             sal::static_int_cast<sal_uIntPtr>(
141cdf0e10cSrcweir                 xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() )));
142cdf0e10cSrcweir 	if( pSecEnv == NULL )
143cdf0e10cSrcweir 		throw RuntimeException() ;
144cdf0e10cSrcweir 
145cdf0e10cSrcweir  	setErrorRecorder();
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 	pMngr = pSecEnv->createKeysManager() ; //i39448
148cdf0e10cSrcweir 	if( !pMngr ) {
149cdf0e10cSrcweir 		throw RuntimeException() ;
150cdf0e10cSrcweir 	}
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 	//Create Signature context
153cdf0e10cSrcweir 	pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
154cdf0e10cSrcweir 	if( pDsigCtx == NULL )
155cdf0e10cSrcweir 	{
156cdf0e10cSrcweir 		pSecEnv->destroyKeysManager( pMngr ) ; //i39448
157cdf0e10cSrcweir 		//throw XMLSignatureException() ;
158cdf0e10cSrcweir 		clearErrorRecorder();
159cdf0e10cSrcweir 		return aTemplate;
160cdf0e10cSrcweir 	}
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	//Sign the template
163cdf0e10cSrcweir 	if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 )
164cdf0e10cSrcweir 	{
165cdf0e10cSrcweir         if (pDsigCtx->status == xmlSecDSigStatusSucceeded)
166cdf0e10cSrcweir             aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
167cdf0e10cSrcweir         else
168cdf0e10cSrcweir             aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN);
169cdf0e10cSrcweir 	}
170cdf0e10cSrcweir     else
171cdf0e10cSrcweir 	{
172cdf0e10cSrcweir         aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN);
173cdf0e10cSrcweir 	}
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 	xmlSecDSigCtxDestroy( pDsigCtx ) ;
177cdf0e10cSrcweir 	pSecEnv->destroyKeysManager( pMngr ) ; //i39448
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	//Unregistered the stream/URI binding
180cdf0e10cSrcweir 	if( xUriBinding.is() )
181cdf0e10cSrcweir 		xmlUnregisterStreamInputCallbacks() ;
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	clearErrorRecorder();
184cdf0e10cSrcweir 	return aTemplate ;
185cdf0e10cSrcweir }
186cdf0e10cSrcweir 
187cdf0e10cSrcweir /* XXMLSignature */
188cdf0e10cSrcweir Reference< XXMLSignatureTemplate >
validate(const Reference<XXMLSignatureTemplate> & aTemplate,const Reference<XXMLSecurityContext> & aSecurityCtx)189cdf0e10cSrcweir SAL_CALL XMLSignature_NssImpl :: validate(
190cdf0e10cSrcweir 	const Reference< XXMLSignatureTemplate >& aTemplate ,
191cdf0e10cSrcweir 	const Reference< XXMLSecurityContext >& aSecurityCtx
192cdf0e10cSrcweir ) throw( com::sun::star::uno::RuntimeException,
193cdf0e10cSrcweir 		 com::sun::star::uno::SecurityException,
194cdf0e10cSrcweir 		 com::sun::star::xml::crypto::XMLSignatureException ) {
195cdf0e10cSrcweir 	xmlSecKeysMngrPtr pMngr = NULL ;
196cdf0e10cSrcweir 	xmlSecDSigCtxPtr pDsigCtx = NULL ;
197cdf0e10cSrcweir 	xmlNodePtr pNode = NULL ;
198cdf0e10cSrcweir 	//sal_Bool valid ;
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	if( !aTemplate.is() )
201cdf0e10cSrcweir 		throw RuntimeException() ;
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 	if( !aSecurityCtx.is() )
204cdf0e10cSrcweir 		throw RuntimeException() ;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 	//Get the xml node
207cdf0e10cSrcweir 	Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ;
208cdf0e10cSrcweir 	if( !xElement.is() )
209cdf0e10cSrcweir 		throw RuntimeException() ;
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 	Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ;
212cdf0e10cSrcweir 	if( !xNodTunnel.is() ) {
213cdf0e10cSrcweir 		throw RuntimeException() ;
214cdf0e10cSrcweir 	}
215cdf0e10cSrcweir 
216cdf0e10cSrcweir 	XMLElementWrapper_XmlSecImpl* pElement =
217cdf0e10cSrcweir         reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
218cdf0e10cSrcweir             sal::static_int_cast<sal_uIntPtr>(
219cdf0e10cSrcweir                 xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() )));
220cdf0e10cSrcweir 	if( pElement == NULL )
221cdf0e10cSrcweir 		throw RuntimeException() ;
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 	pNode = pElement->getNativeElement() ;
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	//Get the stream/URI binding
226cdf0e10cSrcweir 	Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ;
227cdf0e10cSrcweir 	if( xUriBinding.is() ) {
228cdf0e10cSrcweir 		//Register the stream input callbacks into libxml2
229cdf0e10cSrcweir 		if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 )
230cdf0e10cSrcweir 			throw RuntimeException() ;
231cdf0e10cSrcweir 	}
232cdf0e10cSrcweir 
233cdf0e10cSrcweir  	setErrorRecorder();
234cdf0e10cSrcweir 
235cdf0e10cSrcweir 	sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber();
236cdf0e10cSrcweir 	sal_Int32 i;
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	for (i=0; i<nSecurityEnvironment; ++i)
239cdf0e10cSrcweir 	{
240cdf0e10cSrcweir 		Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i);
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 		//Get Keys Manager
243cdf0e10cSrcweir 		Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ;
244cdf0e10cSrcweir 		if( !xSecTunnel.is() ) {
245cdf0e10cSrcweir 			 throw RuntimeException() ;
246cdf0e10cSrcweir 		}
247cdf0e10cSrcweir 
248cdf0e10cSrcweir 		SecurityEnvironment_NssImpl* pSecEnv =
249cdf0e10cSrcweir             reinterpret_cast<SecurityEnvironment_NssImpl*>(
250cdf0e10cSrcweir                 sal::static_int_cast<sal_uIntPtr>(
251cdf0e10cSrcweir                     xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() )));
252cdf0e10cSrcweir 		if( pSecEnv == NULL )
253cdf0e10cSrcweir 			throw RuntimeException() ;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 		pMngr = pSecEnv->createKeysManager() ; //i39448
256cdf0e10cSrcweir 		if( !pMngr ) {
257cdf0e10cSrcweir 			throw RuntimeException() ;
258cdf0e10cSrcweir 		}
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 		//Create Signature context
261cdf0e10cSrcweir 		pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
262cdf0e10cSrcweir 		if( pDsigCtx == NULL )
263cdf0e10cSrcweir 		{
264cdf0e10cSrcweir 			pSecEnv->destroyKeysManager( pMngr ) ; //i39448
265cdf0e10cSrcweir 			//throw XMLSignatureException() ;
266cdf0e10cSrcweir 			clearErrorRecorder();
267cdf0e10cSrcweir 			return aTemplate;
268cdf0e10cSrcweir 		}
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 		//Verify signature
271cdf0e10cSrcweir 		int rs = xmlSecDSigCtxVerify( pDsigCtx , pNode );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 		if (rs == 0 &&
275cdf0e10cSrcweir             pDsigCtx->status == xmlSecDSigStatusSucceeded)
276cdf0e10cSrcweir 		{
277cdf0e10cSrcweir             aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
278cdf0e10cSrcweir             xmlSecDSigCtxDestroy( pDsigCtx ) ;
279cdf0e10cSrcweir             pSecEnv->destroyKeysManager( pMngr );
280cdf0e10cSrcweir 			break;
281cdf0e10cSrcweir 		}
282cdf0e10cSrcweir         else
283cdf0e10cSrcweir         {
284cdf0e10cSrcweir             aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN);
285cdf0e10cSrcweir         }
286cdf0e10cSrcweir         xmlSecDSigCtxDestroy( pDsigCtx ) ;
287cdf0e10cSrcweir 		pSecEnv->destroyKeysManager( pMngr );
288cdf0e10cSrcweir 	}
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	//Unregistered the stream/URI binding
293cdf0e10cSrcweir 	if( xUriBinding.is() )
294cdf0e10cSrcweir 		xmlUnregisterStreamInputCallbacks() ;
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 	//return valid ;
297cdf0e10cSrcweir 	clearErrorRecorder();
298cdf0e10cSrcweir 	return aTemplate;
299cdf0e10cSrcweir }
300cdf0e10cSrcweir 
301cdf0e10cSrcweir /* XInitialization */
initialize(const Sequence<Any> &)302cdf0e10cSrcweir void SAL_CALL XMLSignature_NssImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) {
303cdf0e10cSrcweir 	// TBD
304cdf0e10cSrcweir } ;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir /* XServiceInfo */
getImplementationName()307cdf0e10cSrcweir OUString SAL_CALL XMLSignature_NssImpl :: getImplementationName() throw( RuntimeException ) {
308cdf0e10cSrcweir 	return impl_getImplementationName() ;
309cdf0e10cSrcweir }
310cdf0e10cSrcweir 
311cdf0e10cSrcweir /* XServiceInfo */
supportsService(const OUString & serviceName)312cdf0e10cSrcweir sal_Bool SAL_CALL XMLSignature_NssImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) {
313cdf0e10cSrcweir 	Sequence< OUString > seqServiceNames = getSupportedServiceNames() ;
314cdf0e10cSrcweir 	const OUString* pArray = seqServiceNames.getConstArray() ;
315cdf0e10cSrcweir 	for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) {
316cdf0e10cSrcweir 		if( *( pArray + i ) == serviceName )
317cdf0e10cSrcweir 			return sal_True ;
318cdf0e10cSrcweir 	}
319cdf0e10cSrcweir 	return sal_False ;
320cdf0e10cSrcweir }
321cdf0e10cSrcweir 
322cdf0e10cSrcweir /* XServiceInfo */
getSupportedServiceNames()323cdf0e10cSrcweir Sequence< OUString > SAL_CALL XMLSignature_NssImpl :: getSupportedServiceNames() throw( RuntimeException ) {
324cdf0e10cSrcweir 	return impl_getSupportedServiceNames() ;
325cdf0e10cSrcweir }
326cdf0e10cSrcweir 
327cdf0e10cSrcweir //Helper for XServiceInfo
impl_getSupportedServiceNames()328cdf0e10cSrcweir Sequence< OUString > XMLSignature_NssImpl :: impl_getSupportedServiceNames() {
329cdf0e10cSrcweir 	::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ;
330cdf0e10cSrcweir 	Sequence< OUString > seqServiceNames( 1 ) ;
331cdf0e10cSrcweir 	seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignature" ) ;
332cdf0e10cSrcweir 	return seqServiceNames ;
333cdf0e10cSrcweir }
334cdf0e10cSrcweir 
impl_getImplementationName()335cdf0e10cSrcweir OUString XMLSignature_NssImpl :: impl_getImplementationName() throw( RuntimeException ) {
336cdf0e10cSrcweir 	return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl" ) ;
337cdf0e10cSrcweir }
338cdf0e10cSrcweir 
339cdf0e10cSrcweir //Helper for registry
impl_createInstance(const Reference<XMultiServiceFactory> & aServiceManager)340cdf0e10cSrcweir Reference< XInterface > SAL_CALL XMLSignature_NssImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) {
341cdf0e10cSrcweir 	return Reference< XInterface >( *new XMLSignature_NssImpl( aServiceManager ) ) ;
342cdf0e10cSrcweir }
343cdf0e10cSrcweir 
impl_createFactory(const Reference<XMultiServiceFactory> & aServiceManager)344cdf0e10cSrcweir Reference< XSingleServiceFactory > XMLSignature_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) {
345cdf0e10cSrcweir 	//Reference< XSingleServiceFactory > xFactory ;
346cdf0e10cSrcweir 	//xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ;
347cdf0e10cSrcweir 	//return xFactory ;
348cdf0e10cSrcweir 	return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ;
349cdf0e10cSrcweir }
350cdf0e10cSrcweir 
351