|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSTSPINCONVERTER_H |
|
20 #define CSTSPINCONVERTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 namespace java |
|
26 { |
|
27 namespace satsa |
|
28 { |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Static class for converting PIN values. Conversions made according to |
|
33 * PKCS#15 standard. |
|
34 * |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS(CSTSPinConverter) |
|
38 { |
|
39 |
|
40 public: // New functions |
|
41 |
|
42 /** |
|
43 * Convert PIN value to UTF8 format. |
|
44 * @since 3.0 |
|
45 * @param aPinValue PIN value to be converted |
|
46 * @param aConvertedPIN Descriptor where converted PIN will be put |
|
47 * @param aUpperCase Is there need to convert value to uppercase |
|
48 * @return void |
|
49 */ |
|
50 static void ConvertToUTF8L(const TDesC& aPinValue, |
|
51 TPtr8& aConvertedPIN, |
|
52 TBool aUpperCase); |
|
53 |
|
54 /** |
|
55 * Convert PIN value to BCD format. |
|
56 * @since 3.0 |
|
57 * @param aPinValue PIN value to be converted |
|
58 * @param aConvertedPIN Descriptor where converted PIN will be put |
|
59 * @param aHalfBCD If will be converted to half BCD format |
|
60 * @return void |
|
61 */ |
|
62 static void ConvertToBCDL(const TDesC& aPinValue, TPtr8& aConvertedPIN, |
|
63 TBool aHalfBCD); |
|
64 |
|
65 /** |
|
66 * Convert PIN value to ASCII format. |
|
67 * @since 3.0 |
|
68 * @param aPinValue PIN value to be converted |
|
69 * @param aConvertedPIN Descriptor where converted PIN will be put |
|
70 * @return void |
|
71 */ |
|
72 static void ConvertToASCIIL(const TDesC& aPinValue, TPtr8& aConvertedPIN); |
|
73 |
|
74 /** |
|
75 * Checks is all values digits or not |
|
76 * @since 3.0 |
|
77 * @param aPinValue PIN value to checked |
|
78 * @return ETrue if all was digits otherwice EFalse |
|
79 */ |
|
80 static TBool IsAllDigits(const TDesC& aPinValue); |
|
81 |
|
82 /** |
|
83 * Padds gived pin value up to length with padding character |
|
84 * @since 3.0 |
|
85 * @param aPinValue PIN value to be converted |
|
86 * @param aConvertedPIN Pointer to buffer where result is put |
|
87 * @param aLength Up to this length is padded |
|
88 * @param aPadChar Padding character |
|
89 * @return void |
|
90 */ |
|
91 static TInt DoBadding(const TDesC& aPinValue, HBufC8*& aConvertedPIN, |
|
92 TInt aLength, TUint8 aPadChar); |
|
93 |
|
94 } |
|
95 ; |
|
96 |
|
97 } //namespace satsa |
|
98 } //namespace java |
|
99 #endif // CSTSPINCONVERTER_H |
|
100 // End of File |