2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-16 17:32:30 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-11-07 09:05:57 +00:00
|
|
|
|
|
|
|
#ifndef _XCERTIFICATECONTAINER_HXX_
|
|
|
|
#define _XCERTIFICATECONTAINER_HXX_
|
|
|
|
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <cppuhelper/factory.hxx>
|
|
|
|
#include <cppuhelper/implbase2.hxx>
|
|
|
|
|
|
|
|
#include <com/sun/star/security/XCertificateContainer.hpp>
|
|
|
|
#include <com/sun/star/security/CertificateContainerStatus.hpp>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
class CertificateContainer : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo, css::security::XCertificateContainer >
|
2007-11-07 09:05:57 +00:00
|
|
|
{
|
|
|
|
private:
|
2013-04-07 12:06:47 +02:00
|
|
|
typedef std::map< OUString, OUString > Map;
|
2007-11-07 09:05:57 +00:00
|
|
|
Map certMap;
|
|
|
|
Map certTrustMap;
|
|
|
|
|
2014-04-03 13:52:06 +02:00
|
|
|
sal_Bool SAL_CALL searchMap( const OUString & url, const OUString & certificate_name, Map &_certMap );
|
|
|
|
virtual sal_Bool SAL_CALL isTemporaryCertificate( const OUString & url, const OUString & certificate_name ) throw(css::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL isCertificateTrust( const OUString & url, const OUString & certificate_name ) throw(css::uno::RuntimeException);
|
2007-11-07 09:05:57 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
CertificateContainer(const css::uno::Reference< css::lang::XMultiServiceFactory >& ) {};
|
2007-11-07 09:05:57 +00:00
|
|
|
virtual ~CertificateContainer(){};
|
|
|
|
|
2014-04-03 13:52:06 +02:00
|
|
|
virtual sal_Bool SAL_CALL addCertificate( const OUString & url, const OUString & certificate_name, sal_Bool trust ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual css::security::CertificateContainerStatus SAL_CALL hasCertificate( const OUString & url, const OUString & certificate_name ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2013-04-26 17:14:48 +02:00
|
|
|
|
2007-11-07 09:05:57 +00:00
|
|
|
// provide factory
|
2013-04-26 17:14:48 +02:00
|
|
|
static OUString SAL_CALL impl_getStaticImplementationName( ) throw(css::uno::RuntimeException);
|
2007-11-07 09:05:57 +00:00
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
static css::uno::Sequence< OUString > SAL_CALL
|
|
|
|
impl_getStaticSupportedServiceNames( ) throw(css::uno::RuntimeException);
|
2007-11-07 09:05:57 +00:00
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
static css::uno::Reference< css::uno::XInterface > SAL_CALL
|
|
|
|
impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::RuntimeException );
|
2007-11-07 09:05:57 +00:00
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
// XServiceInfo
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2014-04-03 13:52:06 +02:00
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2007-11-07 09:05:57 +00:00
|
|
|
|
2013-04-26 17:14:48 +02:00
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL
|
2014-03-27 18:12:18 +01:00
|
|
|
getSupportedServiceNames( ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2007-11-07 09:05:57 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|