|
1 /* |
|
2 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class with implementation of xmlenc padding. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_XMLSEC_PADDING_H |
|
20 #define C_XMLSEC_PADDING_H |
|
21 |
|
22 #include <padding.h> |
|
23 |
|
24 /** |
|
25 * This concrete subclass of CPadding implements padding according to |
|
26 * the "XML Encryption Syntax and Processing" W3C Recomendation |
|
27 * ( @see http://www.w3.org/TR/xmlenc-core/#sec-Alg-Block). |
|
28 * |
|
29 * @lib xmlseccrypto.dll |
|
30 * @since S60 v3.2 |
|
31 */ |
|
32 class CXmlSecPadding : public CPadding |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Creates a new CXmlSecPadding object. |
|
37 * |
|
38 * @since S60 v3.2 |
|
39 * @param aBlockBytes The block size in bytes. |
|
40 * @return A pointer to the new CXmlSecPadding object. |
|
41 */ |
|
42 static CXmlSecPadding* NewL(TInt aBlockBytes); |
|
43 |
|
44 /** |
|
45 * Creates a new CXmlSecPadding object and leaves a pointer to it on the cleanup stack. |
|
46 * |
|
47 * @since S60 v3.2 |
|
48 * @param aBlockBytes The block size in bytes. |
|
49 * @return A pointer to the new CXmlSecPadding object. |
|
50 */ |
|
51 static CXmlSecPadding* NewLC(TInt aBlockBytes); |
|
52 /** |
|
53 * Pads aInput and places the result in aOutput. |
|
54 * |
|
55 * @since S60 v3.2 |
|
56 * @param aInput Data to be padded. |
|
57 * @param aOutput On return, the resulting padded. |
|
58 */ |
|
59 void DoPadL(const TDesC8& aInput,TDes8& aOutput); |
|
60 |
|
61 /** |
|
62 * Removes padding from aInput and puts result to aOutput. |
|
63 * |
|
64 * @since S60 v3.2 |
|
65 * @param aInput Data to be unpadded. |
|
66 * @param aOutput The unpadded data. |
|
67 */ |
|
68 void UnPadL(const TDesC8& aInput,TDes8& aOutput); |
|
69 |
|
70 /** |
|
71 * The smallest number of bytes that PadL() will add to aInput |
|
72 * |
|
73 * @since S60 v3.2 |
|
74 * @return The smallest number of padding bytes possible. |
|
75 */ |
|
76 TInt MinPaddingLength(void) const; |
|
77 |
|
78 protected: |
|
79 /** |
|
80 * Constructor |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 * @param aBlockBytes The block size in bytes. |
|
84 */ |
|
85 CXmlSecPadding(TInt aBlockBytes); |
|
86 |
|
87 private: |
|
88 /** |
|
89 * Minimum pad lenght |
|
90 */ |
|
91 static const TInt KMinPaddingLenght = 1; |
|
92 }; |
|
93 |
|
94 #endif // C_XMLSEC_PADDING_H |