Update contrib.
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include <pbencryptor.h>
22 #include "pbesymmetricfactory.h"
24 EXPORT_C CPBEncryptorElement* CPBEncryptorElement::NewL(
25 const TPBECipher aCipher, const TDesC8& aKey, const TDesC8& aIV)
27 CPBEncryptorElement* self = NewLC(aCipher, aKey, aIV);
32 EXPORT_C CPBEncryptorElement* CPBEncryptorElement::NewLC(
33 const TPBECipher aCipher, const TDesC8& aKey, const TDesC8& aIV)
35 CPBEncryptorElement* self = new(ELeave) CPBEncryptorElement;
36 CleanupStack::PushL(self);
37 self->ConstructL(aCipher, aKey, aIV);
41 void CPBEncryptorElement::Process(const TDesC8& aInput, TDes8& aOutput)
43 iCipher->Process(aInput, aOutput);
46 void CPBEncryptorElement::ProcessFinalL(const TDesC8& aInput, TDes8& aOutput)
48 iCipher->ProcessFinalL(aInput, aOutput);
51 void CPBEncryptorElement::ConstructL(const TPBECipher aCipher,
52 const TDesC8& aKey, const TDesC8& aIV)
54 iCipher = PBE::MakeEncryptorL(aCipher, aKey, aIV);
57 CPBEncryptorElement::CPBEncryptorElement()
61 CPBEncryptorElement::~CPBEncryptorElement()
66 TInt CPBEncryptorElement::MaxOutputLength(TUint aMaxInputLength) const
68 return iCipher->MaxOutputLength(aMaxInputLength);
71 TInt CPBEncryptorElement::MaxFinalOutputLength(TUint aMaxInputLength) const
73 return iCipher->MaxFinalOutputLength(aMaxInputLength);
76 EXPORT_C CPBDecryptorElement* CPBDecryptorElement::NewL(
77 const TPBECipher aCipher, const TDesC8& aKey, const TDesC8& aIV)
79 CPBDecryptorElement* self = NewLC(aCipher, aKey, aIV);
84 EXPORT_C CPBDecryptorElement* CPBDecryptorElement::NewLC(
85 const TPBECipher aCipher, const TDesC8& aKey, const TDesC8& aIV)
87 CPBDecryptorElement* self = new(ELeave) CPBDecryptorElement;
88 CleanupStack::PushL(self);
89 self->ConstructL(aCipher, aKey, aIV);
93 void CPBDecryptorElement::Process(const TDesC8& aInput, TDes8& aOutput)
95 iCipher->Process(aInput, aOutput);
98 void CPBDecryptorElement::ProcessFinalL(const TDesC8& aInput, TDes8& aOutput)
100 iCipher->ProcessFinalL(aInput, aOutput);
103 void CPBDecryptorElement::ConstructL(const TPBECipher aCipher,
104 const TDesC8& aKey, const TDesC8& aIV)
106 iCipher = PBE::MakeDecryptorL(aCipher, aKey, aIV);
109 CPBDecryptorElement::CPBDecryptorElement()
113 CPBDecryptorElement::~CPBDecryptorElement()
118 TInt CPBDecryptorElement::MaxOutputLength(TUint aMaxInputLength) const
120 return iCipher->MaxOutputLength(aMaxInputLength);
123 TInt CPBDecryptorElement::MaxFinalOutputLength(TUint aMaxInputLength) const
125 return iCipher->MaxFinalOutputLength(aMaxInputLength);