46 public: |
46 public: |
47 |
47 |
48 /** |
48 /** |
49 Set the padding mode for the signer or verifier. Reset() is called to reinitialise the cipher. |
49 Set the padding mode for the signer or verifier. Reset() is called to reinitialise the cipher. |
50 @param aPaddingMode The padding mode of the signer |
50 @param aPaddingMode The padding mode of the signer |
|
51 |
|
52 @leave KErrNotSupported if the padding mode is not supported. |
|
53 @leave ... Any of the crypto error codes defined in |
|
54 cryptospi_errs.h or any of the system-wide error codes. |
|
55 |
51 */ |
56 */ |
52 IMPORT_C void SetPaddingModeL(TUid aPaddingMode); |
57 IMPORT_C void SetPaddingModeL(TUid aPaddingMode); |
53 |
58 |
54 /** |
59 /** |
55 Set the private key for the signer or verifier. Reset() is called to reinitialise the cipher. |
60 Set the private key for the signer or verifier. Reset() is called to reinitialise the cipher. |
56 @param aPrivateKey The privatekey that used to sign |
61 @param aPrivateKey The privatekey that used to sign |
|
62 @leave KErrArgument if key is not of the expected type. |
|
63 @leave KErrNotSupported if the key is not of valid length. |
|
64 @leave ... Any of the crypto error codes defined in |
|
65 cryptospi_errs.h or any of the system-wide error codes. |
57 */ |
66 */ |
58 IMPORT_C void SetKeyL(const CKey& aPrivateKey); |
67 IMPORT_C void SetKeyL(const CKey& aPrivateKey); |
59 |
68 |
60 /** |
69 /** |
61 Gets the maximum size of input accepted by this object. |
70 Gets the maximum size of input accepted by this object. |
62 @return The maximum length allowed in bytes |
71 @return The maximum length allowed in bytes |
|
72 @leave ... Any of the crypto error codes defined in |
|
73 cryptospi_errs.h or any of the system-wide error codes. |
63 */ |
74 */ |
64 IMPORT_C TInt GetMaximumInputLengthL() const; |
75 IMPORT_C TInt GetMaximumInputLengthL() const; |
65 |
76 |
66 /** |
77 /** |
67 Gets the maximum size of output that can be generated by this object. |
78 Gets the maximum size of output that can be generated by this object. |
68 @return The maximum output length in bytes |
79 @return The maximum output length in bytes |
|
80 @leave ... Any of the crypto error codes defined in |
|
81 cryptospi_errs.h or any of the system-wide error codes. |
69 */ |
82 */ |
70 IMPORT_C TInt GetMaximumOutputLengthL() const; |
83 IMPORT_C TInt GetMaximumOutputLengthL() const; |
71 |
84 |
72 /** |
85 /** |
73 Destructor |
86 Destructor |
106 |
119 |
107 /** |
120 /** |
108 Signs the input hash |
121 Signs the input hash |
109 @param aInput The hash of the message to sign |
122 @param aInput The hash of the message to sign |
110 @param aSignature The signature of the hash |
123 @param aSignature The signature of the hash |
|
124 @leave ... Any of the crypto error codes defined in |
|
125 cryptospi_errs.h or any of the system-wide error codes. |
111 */ |
126 */ |
112 IMPORT_C void SignL(const TDesC8& aInput, CCryptoParams& aSignature); |
127 IMPORT_C void SignL(const TDesC8& aInput, CCryptoParams& aSignature); |
113 |
128 |
114 private: |
129 private: |
115 CSigner(MSigner* aSigner, TInt aHandle); |
130 CSigner(MSigner* aSigner, TInt aHandle); |
139 /** |
154 /** |
140 Set the public key for the signer |
155 Set the public key for the signer |
141 @param aInput The hash of the message to sign |
156 @param aInput The hash of the message to sign |
142 @param aSignature The signature of the hash |
157 @param aSignature The signature of the hash |
143 @param aRequestStatus |
158 @param aRequestStatus |
|
159 @leave ... Any of the crypto error codes defined in |
|
160 cryptospi_errs.h or any of the system-wide error codes. |
144 */ |
161 */ |
145 IMPORT_C void SignL(const TDesC8& aInput, CCryptoParams& aSignature, TRequestStatus& aRequestStatus); |
162 IMPORT_C void SignL(const TDesC8& aInput, CCryptoParams& aSignature, TRequestStatus& aRequestStatus); |
146 |
163 |
147 /** |
164 /** |
148 Cancel the outstanding request |
165 Cancel the outstanding request |
178 /** |
195 /** |
179 Verify the signature |
196 Verify the signature |
180 @param aInput The hash of the message to be verified |
197 @param aInput The hash of the message to be verified |
181 @param aSignature The signature of the hash |
198 @param aSignature The signature of the hash |
182 @param aVerificationResult indicates the success or failure of the verification |
199 @param aVerificationResult indicates the success or failure of the verification |
|
200 @leave ... Any of the crypto error codes defined in |
|
201 cryptospi_errs.h or any of the system-wide error codes. |
183 */ |
202 */ |
184 IMPORT_C void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult); |
203 IMPORT_C void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult); |
185 |
204 |
186 /** |
205 /** |
187 Unsign the signature |
206 Unsign the signature |
188 @param aOutput The unsigned hash |
207 @param aOutput The unsigned hash |
189 @param aSignature The signature of the hash |
208 @param aSignature The signature of the hash |
|
209 @leave ... Any of the crypto error codes defined in |
|
210 cryptospi_errs.h or any of the system-wide error codes. |
190 */ |
211 */ |
191 IMPORT_C void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature); |
212 IMPORT_C void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature); |
192 |
213 |
193 private: |
214 private: |
194 /** |
215 /** |
222 Verify the signature |
243 Verify the signature |
223 @param aInput The hash of the message to be verified |
244 @param aInput The hash of the message to be verified |
224 @param aSignature The signature of the hash. |
245 @param aSignature The signature of the hash. |
225 @param aVerificationResult Indicates the success or failure of the verification |
246 @param aVerificationResult Indicates the success or failure of the verification |
226 @param aRequestStatus the request status. |
247 @param aRequestStatus the request status. |
|
248 @leave ... Any of the crypto error codes defined in |
|
249 cryptospi_errs.h or any of the system-wide error codes. |
227 */ |
250 */ |
228 IMPORT_C void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult, TRequestStatus& aRequestStatus); |
251 IMPORT_C void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult, TRequestStatus& aRequestStatus); |
229 |
252 |
230 /** |
253 /** |
231 Unsign the signature |
254 Unsign the signature |
232 @param aOutput The unsigned hash |
255 @param aOutput The unsigned hash |
233 @param aSignature The signature of the hash |
256 @param aSignature The signature of the hash |
234 @param aRequestStatus the request status. |
257 @param aRequestStatus the request status. |
|
258 @leave ... Any of the crypto error codes defined in |
|
259 cryptospi_errs.h or any of the system-wide error codes. |
235 */ |
260 */ |
236 IMPORT_C void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature, TRequestStatus& aRequestStatus); |
261 IMPORT_C void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature, TRequestStatus& aRequestStatus); |
237 |
262 |
238 /** |
263 /** |
239 Cancel the outstanding request |
264 Cancel the outstanding request |