41 public: |
41 public: |
42 |
42 |
43 /** |
43 /** |
44 Set the key of this cipher. Reset() is called to reinitialise the cipher. |
44 Set the key of this cipher. Reset() is called to reinitialise the cipher. |
45 @param aKey The symmetric key. |
45 @param aKey The symmetric key. |
|
46 @leave KErrArgument if aKey is not of the expected type. |
|
47 @leave KErrNotSupported if the key is not of valid length. |
|
48 @leave ... Any of the crypto error codes defined in |
|
49 cryptospi_errs.h or any of the system-wide error codes. |
46 */ |
50 */ |
47 virtual void SetKeyL(const CKey& aKey) = 0; |
51 virtual void SetKeyL(const CKey& aKey) = 0; |
48 |
52 |
49 /** |
53 /** |
50 Set the operation mode of this cipher |
54 Set the operation mode of this cipher |
51 @param aOperationMode The operation mode e.g. CBC, ECB etc |
55 @param aOperationMode The operation mode e.g. CBC, ECB etc |
|
56 @leave KErrNotSupported if the operation mode is not supported. |
|
57 @leave ... Any of the crypto error codes defined in |
|
58 cryptospi_errs.h or any of the system-wide error codes. |
52 */ |
59 */ |
53 virtual void SetOperationModeL(TUid aOperationMode) = 0; |
60 virtual void SetOperationModeL(TUid aOperationMode) = 0; |
54 |
61 |
55 /** |
62 /** |
56 Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher. |
63 Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher. |
57 @param aCryptoMode The crypto mode e.g encryption, decryption |
64 @param aCryptoMode The crypto mode e.g encryption, decryption |
|
65 @leave KErrNotSupported if the crypto mode is not supported. |
|
66 @leave ... Any of the crypto error codes defined in |
|
67 cryptospi_errs.h or any of the system-wide error codes. |
58 */ |
68 */ |
59 virtual void SetCryptoModeL(TUid aCryptoMode) = 0; |
69 virtual void SetCryptoModeL(TUid aCryptoMode) = 0; |
60 |
70 |
61 /** |
71 /** |
62 Set padding Mode of this cipher. Reset() is called to reinitialise the cipher. |
72 Set padding Mode of this cipher. Reset() is called to reinitialise the cipher. |
63 @param aPaddingMode The padding mode e.g. SSLv3, PKCS7 |
73 @param aPaddingMode The padding mode e.g. SSLv3, PKCS7 |
|
74 @leave KErrNotSupported if the padding mode is not supported. |
|
75 @leave ... Any of the crypto error codes defined in |
|
76 cryptospi_errs.h or any of the system-wide error codes. |
64 */ |
77 */ |
65 virtual void SetPaddingModeL(TUid aPaddingMode) = 0; |
78 virtual void SetPaddingModeL(TUid aPaddingMode) = 0; |
66 |
79 |
67 /** |
80 /** |
68 Set the initialization vector of this cipher. Reset() is called to reinitialise the cipher. |
81 Set the initialization vector of this cipher. Reset() is called to reinitialise the cipher. |
69 @param aIv The initialization vector. |
82 @param aIv The initialization vector. |
|
83 @leave KErrNotSupported if the current mode of operation does not support this. |
|
84 @leave KErrArgument If the length of the Iv is not equal to the block size. |
|
85 @leave ... Any of the crypto error codes defined in |
|
86 cryptospi_errs.h or any of the system-wide error codes. |
70 */ |
87 */ |
71 virtual void SetIvL(const TDesC8& aIv) = 0; |
88 virtual void SetIvL(const TDesC8& aIv) = 0; |
72 |
89 |
73 /** |
90 /** |
74 Returns the maximum length that an output buffer would need to be in order to hold the result |
91 Returns the maximum length that an output buffer would need to be in order to hold the result |
107 { |
124 { |
108 public: |
125 public: |
109 /** |
126 /** |
110 Encrypts or decrypts aInput and appends the result to aOutput. |
127 Encrypts or decrypts aInput and appends the result to aOutput. |
111 @param aInput The input data to be processed. |
128 @param aInput The input data to be processed. |
112 @param aOutput The resulting processed data appended to aOutput. |
129 @param aOutput The resulting processed data appended to aOutput. |
|
130 @leave ... Any of the crypto error codes defined in |
|
131 cryptospi_errs.h or any of the system-wide error codes. |
113 */ |
132 */ |
114 virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput) = 0; |
133 virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput) = 0; |
115 |
134 |
116 /** |
135 /** |
117 Pads aInput to be block aligned using the underlying padding system, then |
136 Pads aInput to be block aligned using the underlying padding system, then |
118 encrypts or decrypts the input data, and appends the result to aOutput |
137 encrypts or decrypts the input data, and appends the result to aOutput |
119 @param aInput The input buffer to be encrypted or decrypted. |
138 @param aInput The input buffer to be encrypted or decrypted. |
120 @param aOutput The resulting, padded, processed data is appended to aOutput. |
139 @param aOutput The resulting, padded, processed data is appended to aOutput. |
|
140 @leave ... Any of the crypto error codes defined in |
|
141 cryptospi_errs.h or any of the system-wide error codes. |
121 */ |
142 */ |
122 virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput) = 0; |
143 virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput) = 0; |
123 }; |
144 }; |
124 |
145 |
125 |
146 |
130 /** |
151 /** |
131 Encrypts or decrypts aInput and appends the result to aOutput asynchronously |
152 Encrypts or decrypts aInput and appends the result to aOutput asynchronously |
132 @param aInput The input data to be processed. |
153 @param aInput The input data to be processed. |
133 @param aOutput The resulting processed data appended to aOutput. |
154 @param aOutput The resulting processed data appended to aOutput. |
134 @param aRequestStatus |
155 @param aRequestStatus |
|
156 @leave ... Any of the crypto error codes defined in |
|
157 cryptospi_errs.h or any of the system-wide error codes. |
135 */ |
158 */ |
136 virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0; |
159 virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0; |
137 |
160 |
138 /** |
161 /** |
139 Asynchronously Pads aInput to be block aligned using the underlying padding system, the |
162 Asynchronously Pads aInput to be block aligned using the underlying padding system, the |
140 encrypts or decrypts the input data, and appends the result to aOutput |
163 encrypts or decrypts the input data, and appends the result to aOutput |
141 @param aInput The input buffer to be encrypted or decrypted. |
164 @param aInput The input buffer to be encrypted or decrypted. |
142 @param aOutput The resulting, padded, processed data is appended to aOutput. |
165 @param aOutput The resulting, padded, processed data is appended to aOutput. |
143 @param aRequestStatus |
166 @param aRequestStatus |
|
167 @leave ... Any of the crypto error codes defined in |
|
168 cryptospi_errs.h or any of the system-wide error codes. |
144 */ |
169 */ |
145 virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0; |
170 virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0; |
146 |
171 |
147 /** |
172 /** |
148 Cancel the outstanding request |
173 Cancel the outstanding request |