|
1 /* |
|
2 * Copyright (c) 2009 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 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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "pluginentry.h" |
|
20 #include "pluginconfig.h" |
|
21 #include "dummyeccimpl.h" |
|
22 #include "dummyeccsignerimpl.h" |
|
23 #include "keys.h" |
|
24 #include <cryptospi/cryptospidef.h> |
|
25 |
|
26 using namespace DummyEccHwCrypto; |
|
27 |
|
28 EXPORT_C const TCharacteristics** CCryptoPluginEntry::Enumerate( |
|
29 TUid aInterface, TInt& aNumPlugins) |
|
30 { |
|
31 const TCharacteristics** ptr(0); |
|
32 |
|
33 switch (aInterface.iUid) |
|
34 { |
|
35 case KAsymmetricCipherInterface: |
|
36 { |
|
37 aNumPlugins = sizeof(KAsymmetricCipherCharacteristics) |
|
38 / sizeof(TAsymmetricCipherCharacteristics*); |
|
39 ptr |
|
40 = (const TCharacteristics**) &KAsymmetricCipherCharacteristics[0]; |
|
41 } |
|
42 break; |
|
43 |
|
44 case KSignerInterface: |
|
45 { |
|
46 aNumPlugins = sizeof(KSignerCharacteristics) |
|
47 / sizeof(TAsymmetricSignatureCharacteristics*); |
|
48 ptr = (const TCharacteristics**) &KSignerCharacteristics[0]; |
|
49 } |
|
50 break; |
|
51 |
|
52 default: |
|
53 aNumPlugins = 0; |
|
54 } |
|
55 |
|
56 return ptr; |
|
57 } |
|
58 |
|
59 EXPORT_C void CCryptoPluginEntry::GetExtendedCharacteristicsL( |
|
60 TUid /* aImplementationUid */, CExtendedCharacteristics*& /* aExt */) |
|
61 { |
|
62 User::Leave(KErrNotSupported); |
|
63 } |
|
64 |
|
65 EXPORT_C void CCryptoPluginEntry::CreateAsymmetricCipherL( |
|
66 MAsymmetricCipher*& aPlugin, TUid aImplementationId, |
|
67 const CKey& aKey, TUid aCryptoMode, TUid aPaddingMode, |
|
68 const CCryptoParams* /* aAlgorithmParams */) |
|
69 { |
|
70 switch (aImplementationId.iUid) |
|
71 { |
|
72 case KCryptoPluginEccCipher: |
|
73 { |
|
74 aPlugin = CDummyECCCipherImpl::NewL(aKey, aCryptoMode, aPaddingMode); |
|
75 } |
|
76 break; |
|
77 |
|
78 default: |
|
79 User::Leave(KErrNotFound); |
|
80 } |
|
81 } |
|
82 |
|
83 EXPORT_C void CCryptoPluginEntry::CreateAsymmetricSignerL( |
|
84 MSigner*& aPlugin, TUid aImplementationId, |
|
85 const CKey& aKey, TUid aPaddingMode, const CCryptoParams* /* aAlgorithmParams */) |
|
86 { |
|
87 switch (aImplementationId.iUid) |
|
88 { |
|
89 case KCryptoPluginEccSigner: |
|
90 { |
|
91 aPlugin = CDummyECCSignerImpl::NewL(aKey, aPaddingMode); |
|
92 } |
|
93 break; |
|
94 |
|
95 default: |
|
96 User::Leave(KErrNotFound); |
|
97 } |
|
98 } |
|
99 |
|
100 EXPORT_C void CCryptoPluginEntry::CreateAsymmetricVerifierL( |
|
101 MVerifier*& /*aPlugin*/, TUid /*aImplementationId*/, |
|
102 const CKey& /*aKey*/, TUid /*aPaddingMode*/, const CCryptoParams* /*aAlgorithmParams*/) |
|
103 { |
|
104 User::Leave(KErrNotFound); |
|
105 } |
|
106 |
|
107 EXPORT_C void CCryptoPluginEntry::CreateHashL(MHash*& /*aPlugin*/, |
|
108 TUid /*aImplementationId*/, TUid /*aOperationMode*/, |
|
109 const CKey* /*aKey*/, const CCryptoParams* /*aAlgorithmParams*/) |
|
110 { |
|
111 User::Leave(KErrNotFound); |
|
112 } |
|
113 |
|
114 EXPORT_C void CCryptoPluginEntry::CreateKeyAgreementL( |
|
115 MKeyAgreement*& /*aPlugin*/, TUid /*aImplementationId*/, |
|
116 const CKey& /*aPrivateKey*/, const CCryptoParams* /*aAlgorithmParams*/) |
|
117 { |
|
118 User::Leave(KErrNotFound); |
|
119 } |
|
120 |
|
121 EXPORT_C void CCryptoPluginEntry::CreateKeyPairGeneratorL( |
|
122 MKeyPairGenerator*& /*aPlugin*/, TUid /*aImplementationId*/, |
|
123 const CCryptoParams* /*aAlgorithmParams*/) |
|
124 { |
|
125 User::Leave(KErrNotFound); |
|
126 } |
|
127 |
|
128 EXPORT_C void CCryptoPluginEntry::CreateRandomL(MRandom*& /*aPlugin*/, |
|
129 TUid /*aImplementationId*/, const CCryptoParams* /*aAlgorithmParams*/) |
|
130 { |
|
131 User::Leave(KErrNotFound); |
|
132 } |
|
133 |
|
134 EXPORT_C void CCryptoPluginEntry::CreateSymmetricCipherL( |
|
135 MSymmetricCipher*& /*aPlugin*/, TUid /*aImplementationId*/, const CKey& /*aKey*/, |
|
136 TUid /*aCryptoMode*/, TUid /*aOperationMode*/, TUid /*aPadding*/, |
|
137 const CCryptoParams* /*aAlgorithmParams*/) |
|
138 { |
|
139 User::Leave(KErrNotSupported); |
|
140 } |
|
141 // End of file |