Line data Source code
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 _XCERTIFICATECONTAINER_HXX_
21 : #define _XCERTIFICATECONTAINER_HXX_
22 :
23 : #include <com/sun/star/lang/XServiceInfo.hpp>
24 : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
25 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 : #include <cppuhelper/factory.hxx>
27 : #include <cppuhelper/implbase2.hxx>
28 :
29 : #include <com/sun/star/security/XCertificateContainer.hpp>
30 :
31 : #include <com/sun/star/security/CertificateContainerStatus.hpp>
32 :
33 :
34 : #include <vector>
35 : #include <map>
36 :
37 : using namespace com::sun::star;
38 : using namespace cppu;
39 : using namespace ::com::sun::star::uno;
40 : using namespace ::com::sun::star::lang;
41 :
42 : class CertificateContainer : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::security::XCertificateContainer >
43 : {
44 : private:
45 : typedef std::map< ::rtl::OUString, ::rtl::OUString > Map;
46 : Map certMap;
47 : Map certTrustMap;
48 :
49 : ::sal_Bool SAL_CALL searchMap( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, Map &_certMap );
50 : virtual ::sal_Bool SAL_CALL isTemporaryCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
51 : virtual ::sal_Bool SAL_CALL isCertificateTrust( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
52 :
53 : public:
54 :
55 0 : CertificateContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) {};
56 0 : virtual ~CertificateContainer(){};
57 :
58 : virtual ::sal_Bool SAL_CALL addCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, ::sal_Bool trust ) throw(::com::sun::star::uno::RuntimeException);
59 : virtual ::security::CertificateContainerStatus SAL_CALL hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
60 : // provide factory
61 : static ::rtl::OUString SAL_CALL
62 : impl_getStaticImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
63 :
64 : static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
65 : impl_getStaticSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
66 :
67 : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
68 : impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) throw( ::com::sun::star::uno::RuntimeException );
69 :
70 : // XServiceInfo
71 : virtual ::rtl::OUString SAL_CALL
72 : getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
73 : virtual ::sal_Bool SAL_CALL
74 : supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
75 :
76 : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
77 : getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
78 :
79 : };
80 :
81 :
82 :
83 : #endif
84 :
85 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|