1*ebfcd9afSAndrew Rist /**************************************************************
2*ebfcd9afSAndrew Rist  *
3*ebfcd9afSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ebfcd9afSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ebfcd9afSAndrew Rist  * distributed with this work for additional information
6*ebfcd9afSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ebfcd9afSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ebfcd9afSAndrew Rist  * "License"); you may not use this file except in compliance
9*ebfcd9afSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ebfcd9afSAndrew Rist  *
11*ebfcd9afSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ebfcd9afSAndrew Rist  *
13*ebfcd9afSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ebfcd9afSAndrew Rist  * software distributed under the License is distributed on an
15*ebfcd9afSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ebfcd9afSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ebfcd9afSAndrew Rist  * specific language governing permissions and limitations
18*ebfcd9afSAndrew Rist  * under the License.
19*ebfcd9afSAndrew Rist  *
20*ebfcd9afSAndrew Rist  *************************************************************/
21*ebfcd9afSAndrew Rist 
22*ebfcd9afSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _NSSINITIALIZER_HXX
25cdf0e10cSrcweir #define _NSSINITIALIZER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/xml/crypto/XDigestContextSupplier.hpp>
28cdf0e10cSrcweir #include <com/sun/star/xml/crypto/XCipherContextSupplier.hpp>
29cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #define NSS_SERVICE_NAME "com.sun.star.xml.crypto.NSSInitializer"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class ONSSInitializer : public cppu::WeakImplHelper3
37cdf0e10cSrcweir <
38cdf0e10cSrcweir     ::com::sun::star::xml::crypto::XDigestContextSupplier,
39cdf0e10cSrcweir     ::com::sun::star::xml::crypto::XCipherContextSupplier,
40cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo
41cdf0e10cSrcweir >
42cdf0e10cSrcweir {
43cdf0e10cSrcweir protected:
44cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
45cdf0e10cSrcweir 
ONSSInitializer()46cdf0e10cSrcweir     ONSSInitializer()
47cdf0e10cSrcweir     {}
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir     ONSSInitializer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF );
51cdf0e10cSrcweir     virtual ~ONSSInitializer();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     bool initNSS( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &xMSF );
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     /* XDigestContextSupplier */
56cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XDigestContext > SAL_CALL getDigestContext( ::sal_Int32 nDigestID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aParams ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     /* XCipherContextSupplier */
59cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > SAL_CALL getCipherContext( ::sal_Int32 nCipherID, const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aKey, const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aInitializationVector, ::sal_Bool bEncryption, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aParams ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     /* XServiceInfo */
62cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName()
63cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
66cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
69cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir };
71cdf0e10cSrcweir 
72cdf0e10cSrcweir rtl::OUString ONSSInitializer_getImplementationName()
73cdf0e10cSrcweir     throw ( ::com::sun::star::uno::RuntimeException );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir sal_Bool SAL_CALL ONSSInitializer_supportsService( const rtl::OUString& ServiceName )
76cdf0e10cSrcweir     throw ( ::com::sun::star::uno::RuntimeException );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL ONSSInitializer_getSupportedServiceNames()
79cdf0e10cSrcweir     throw ( ::com::sun::star::uno::RuntimeException );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
82cdf0e10cSrcweir SAL_CALL ONSSInitializer_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
83cdf0e10cSrcweir     throw ( ::com::sun::star::uno::Exception );
84cdf0e10cSrcweir 
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir 
87