xref: /aoo4110/main/package/inc/EncryptionData.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _ENCRYPTION_DATA_HXX_
24 #define _ENCRYPTION_DATA_HXX_
25 
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <cppuhelper/weak.hxx>
28 
29 class BaseEncryptionData : public cppu::OWeakObject
30 {
31 public:
32     ::com::sun::star::uno::Sequence< sal_Int8 > m_aSalt;
33     ::com::sun::star::uno::Sequence< sal_Int8 > m_aInitVector;
34     ::com::sun::star::uno::Sequence< sal_Int8 > m_aDigest;
35     sal_Int32 m_nIterationCount;
36 
BaseEncryptionData()37     BaseEncryptionData()
38     : m_nIterationCount ( 0 ){}
39 
BaseEncryptionData(const BaseEncryptionData & aData)40     BaseEncryptionData( const BaseEncryptionData& aData )
41     : cppu::OWeakObject()
42     , m_aSalt( aData.m_aSalt )
43     , m_aInitVector( aData.m_aInitVector )
44     , m_aDigest( aData.m_aDigest )
45     , m_nIterationCount( aData.m_nIterationCount )
46     {}
47 };
48 
49 class EncryptionData : public BaseEncryptionData
50 {
51 public:
52     ::com::sun::star::uno::Sequence < sal_Int8 > m_aKey;
53     sal_Int32 m_nEncAlg;
54     sal_Int32 m_nCheckAlg;
55     sal_Int32 m_nDerivedKeySize;
56     sal_Int32 m_nStartKeyGenID;
57 
EncryptionData(const BaseEncryptionData & aData,const::com::sun::star::uno::Sequence<sal_Int8> & aKey,sal_Int32 nEncAlg,sal_Int32 nCheckAlg,sal_Int32 nDerivedKeySize,sal_Int32 nStartKeyGenID)58     EncryptionData( const BaseEncryptionData& aData, const ::com::sun::star::uno::Sequence< sal_Int8 >& aKey, sal_Int32 nEncAlg, sal_Int32 nCheckAlg, sal_Int32 nDerivedKeySize, sal_Int32 nStartKeyGenID )
59     : BaseEncryptionData( aData )
60     , m_aKey( aKey )
61     , m_nEncAlg( nEncAlg )
62     , m_nCheckAlg( nCheckAlg )
63     , m_nDerivedKeySize( nDerivedKeySize )
64     , m_nStartKeyGenID( nStartKeyGenID )
65     {}
66 
EncryptionData(const EncryptionData & aData)67     EncryptionData( const EncryptionData& aData )
68     : BaseEncryptionData( aData )
69     , m_aKey( aData.m_aKey )
70     , m_nEncAlg( aData.m_nEncAlg )
71     , m_nCheckAlg( aData.m_nCheckAlg )
72     , m_nDerivedKeySize( aData.m_nDerivedKeySize )
73     , m_nStartKeyGenID( aData.m_nStartKeyGenID )
74     {}
75 };
76 
77 #endif
78