xref: /aoo41x/main/package/inc/EncryptionData.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _ENCRYPTION_DATA_HXX_
28 #define _ENCRYPTION_DATA_HXX_
29 
30 #include <com/sun/star/uno/Sequence.hxx>
31 #include <cppuhelper/weak.hxx>
32 
33 class BaseEncryptionData : public cppu::OWeakObject
34 {
35 public:
36     ::com::sun::star::uno::Sequence< sal_Int8 > m_aSalt;
37     ::com::sun::star::uno::Sequence< sal_Int8 > m_aInitVector;
38     ::com::sun::star::uno::Sequence< sal_Int8 > m_aDigest;
39     sal_Int32 m_nIterationCount;
40 
41     BaseEncryptionData()
42     : m_nIterationCount ( 0 ){}
43 
44     BaseEncryptionData( const BaseEncryptionData& aData )
45     : cppu::OWeakObject()
46     , m_aSalt( aData.m_aSalt )
47     , m_aInitVector( aData.m_aInitVector )
48     , m_aDigest( aData.m_aDigest )
49     , m_nIterationCount( aData.m_nIterationCount )
50     {}
51 };
52 
53 class EncryptionData : public BaseEncryptionData
54 {
55 public:
56     ::com::sun::star::uno::Sequence < sal_Int8 > m_aKey;
57     sal_Int32 m_nEncAlg;
58     sal_Int32 m_nCheckAlg;
59     sal_Int32 m_nDerivedKeySize;
60     sal_Int32 m_nStartKeyGenID;
61 
62     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 )
63     : BaseEncryptionData( aData )
64     , m_aKey( aKey )
65     , m_nEncAlg( nEncAlg )
66     , m_nCheckAlg( nCheckAlg )
67     , m_nDerivedKeySize( nDerivedKeySize )
68     , m_nStartKeyGenID( nStartKeyGenID )
69     {}
70 
71     EncryptionData( const EncryptionData& aData )
72     : BaseEncryptionData( aData )
73     , m_aKey( aData.m_aKey )
74     , m_nEncAlg( aData.m_nEncAlg )
75     , m_nCheckAlg( aData.m_nCheckAlg )
76     , m_nDerivedKeySize( aData.m_nDerivedKeySize )
77     , m_nStartKeyGenID( aData.m_nStartKeyGenID )
78     {}
79 };
80 
81 #endif
82