2011-09-29 21:42:27 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +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 .
|
|
|
|
*/
|
2014-04-18 22:14:30 +02:00
|
|
|
#ifndef INCLUDED_PACKAGE_SOURCE_ZIPAPI_BLOWFISHCONTEXT_HXX
|
|
|
|
#define INCLUDED_PACKAGE_SOURCE_ZIPAPI_BLOWFISHCONTEXT_HXX
|
2011-03-17 09:16:41 +01:00
|
|
|
|
|
|
|
#include <com/sun/star/xml/crypto/XCipherContext.hpp>
|
|
|
|
|
2015-08-25 16:10:12 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2021-07-18 19:03:42 +02:00
|
|
|
#include <mutex>
|
2011-03-17 09:16:41 +01:00
|
|
|
|
2015-10-23 14:59:15 +02:00
|
|
|
class BlowfishCFB8CipherContext : public cppu::WeakImplHelper< css::xml::crypto::XCipherContext >
|
2011-03-17 09:16:41 +01:00
|
|
|
{
|
2021-07-18 19:03:42 +02:00
|
|
|
std::mutex m_aMutex;
|
2011-03-17 09:16:41 +01:00
|
|
|
void* m_pCipher;
|
2011-03-23 14:13:24 +01:00
|
|
|
bool m_bEncrypt;
|
2011-03-17 09:16:41 +01:00
|
|
|
|
|
|
|
BlowfishCFB8CipherContext()
|
2015-11-10 10:20:43 +01:00
|
|
|
: m_pCipher( nullptr )
|
2011-03-23 14:13:24 +01:00
|
|
|
, m_bEncrypt( false )
|
2011-03-17 09:16:41 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~BlowfishCFB8CipherContext() override;
|
2011-03-17 09:16:41 +01:00
|
|
|
|
2015-10-23 14:59:15 +02:00
|
|
|
static css::uno::Reference< css::xml::crypto::XCipherContext >
|
|
|
|
Create( const css::uno::Sequence< sal_Int8 >& aDerivedKey, const css::uno::Sequence< sal_Int8 >& aInitVector, bool bEncrypt );
|
2011-03-17 09:16:41 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL convertWithCipherContext( const css::uno::Sequence< ::sal_Int8 >& aData ) override;
|
|
|
|
virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL finalizeCipherContextAndDispose( ) override;
|
2011-03-17 09:16:41 +01:00
|
|
|
};
|
|
|
|
|
2014-04-18 22:14:30 +02:00
|
|
|
#endif // INCLUDED_PACKAGE_SOURCE_ZIPAPI_BLOWFISHCONTEXT_HXX
|
2011-03-17 09:16:41 +01:00
|
|
|
|
2011-09-29 21:42:27 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|