PageRenderTime 49ms CodeModel.GetById 13ms app.highlight 31ms RepoModel.GetById 1ms app.codeStats 1ms

/security/nss/lib/pki/symmkey.c

http://github.com/zpao/v8monkey
C | 300 lines | 240 code | 25 blank | 35 comment | 0 complexity | 4a2ea39e4e8096c266a09fea968708be MD5 | raw file
  1/* ***** BEGIN LICENSE BLOCK *****
  2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3 *
  4 * The contents of this file are subject to the Mozilla Public License Version
  5 * 1.1 (the "License"); you may not use this file except in compliance with
  6 * the License. You may obtain a copy of the License at
  7 * http://www.mozilla.org/MPL/
  8 *
  9 * Software distributed under the License is distributed on an "AS IS" basis,
 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 11 * for the specific language governing rights and limitations under the
 12 * License.
 13 *
 14 * The Original Code is the Netscape security libraries.
 15 *
 16 * The Initial Developer of the Original Code is
 17 * Netscape Communications Corporation.
 18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
 19 * the Initial Developer. All Rights Reserved.
 20 *
 21 * Contributor(s):
 22 *
 23 * Alternatively, the contents of this file may be used under the terms of
 24 * either the GNU General Public License Version 2 or later (the "GPL"), or
 25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 26 * in which case the provisions of the GPL or the LGPL are applicable instead
 27 * of those above. If you wish to allow use of your version of this file only
 28 * under the terms of either the GPL or the LGPL, and not to allow others to
 29 * use your version of this file under the terms of the MPL, indicate your
 30 * decision by deleting the provisions above and replace them with the notice
 31 * and other provisions required by the GPL or the LGPL. If you do not delete
 32 * the provisions above, a recipient may use your version of this file under
 33 * the terms of any one of the MPL, the GPL or the LGPL.
 34 *
 35 * ***** END LICENSE BLOCK ***** */
 36
 37#ifdef DEBUG
 38static const char CVS_ID[] = "@(#) $RCSfile: symmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:49 $";
 39#endif /* DEBUG */
 40
 41#ifndef NSSPKI_H
 42#include "nsspki.h"
 43#endif /* NSSPKI_H */
 44
 45extern const NSSError NSS_ERROR_NOT_FOUND;
 46
 47NSS_IMPLEMENT PRStatus
 48NSSSymmetricKey_Destroy (
 49  NSSSymmetricKey *mk
 50)
 51{
 52    nss_SetError(NSS_ERROR_NOT_FOUND);
 53    return PR_FAILURE;
 54}
 55
 56NSS_IMPLEMENT PRStatus
 57NSSSymmetricKey_DeleteStoredObject (
 58  NSSSymmetricKey *mk,
 59  NSSCallback *uhh
 60)
 61{
 62    nss_SetError(NSS_ERROR_NOT_FOUND);
 63    return PR_FAILURE;
 64}
 65
 66NSS_IMPLEMENT PRUint32
 67NSSSymmetricKey_GetKeyLength (
 68  NSSSymmetricKey *mk
 69)
 70{
 71    nss_SetError(NSS_ERROR_NOT_FOUND);
 72    return -1;
 73}
 74
 75NSS_IMPLEMENT PRUint32
 76NSSSymmetricKey_GetKeyStrength (
 77  NSSSymmetricKey *mk
 78)
 79{
 80    nss_SetError(NSS_ERROR_NOT_FOUND);
 81    return -1;
 82}
 83
 84NSS_IMPLEMENT PRStatus
 85NSSSymmetricKey_IsStillPresent (
 86  NSSSymmetricKey *mk
 87)
 88{
 89    nss_SetError(NSS_ERROR_NOT_FOUND);
 90    return PR_FAILURE;
 91}
 92
 93NSS_IMPLEMENT NSSTrustDomain *
 94NSSSymmetricKey_GetTrustDomain (
 95  NSSSymmetricKey *mk,
 96  PRStatus *statusOpt
 97)
 98{
 99    nss_SetError(NSS_ERROR_NOT_FOUND);
100    return NULL;
101}
102
103NSS_IMPLEMENT NSSToken *
104NSSSymmetricKey_GetToken (
105  NSSSymmetricKey *mk,
106  PRStatus *statusOpt
107)
108{
109    nss_SetError(NSS_ERROR_NOT_FOUND);
110    return NULL;
111}
112
113NSS_IMPLEMENT NSSSlot *
114NSSSymmetricKey_GetSlot (
115  NSSSymmetricKey *mk,
116  PRStatus *statusOpt
117)
118{
119    nss_SetError(NSS_ERROR_NOT_FOUND);
120    return NULL;
121}
122
123NSS_IMPLEMENT NSSModule *
124NSSSymmetricKey_GetModule (
125  NSSSymmetricKey *mk,
126  PRStatus *statusOpt
127)
128{
129    nss_SetError(NSS_ERROR_NOT_FOUND);
130    return NULL;
131}
132
133NSS_IMPLEMENT NSSItem *
134NSSSymmetricKey_Encrypt (
135  NSSSymmetricKey *mk,
136  NSSAlgorithmAndParameters *apOpt,
137  NSSItem *data,
138  NSSCallback *uhh,
139  NSSItem *rvOpt,
140  NSSArena *arenaOpt
141)
142{
143    nss_SetError(NSS_ERROR_NOT_FOUND);
144    return NULL;
145}
146
147NSS_IMPLEMENT NSSItem *
148NSSSymmetricKey_Decrypt (
149  NSSSymmetricKey *mk,
150  NSSAlgorithmAndParameters *apOpt,
151  NSSItem *encryptedData,
152  NSSCallback *uhh,
153  NSSItem *rvOpt,
154  NSSArena *arenaOpt
155)
156{
157    nss_SetError(NSS_ERROR_NOT_FOUND);
158    return NULL;
159}
160
161NSS_IMPLEMENT NSSItem *
162NSSSymmetricKey_Sign (
163  NSSSymmetricKey *mk,
164  NSSAlgorithmAndParameters *apOpt,
165  NSSItem *data,
166  NSSCallback *uhh,
167  NSSItem *rvOpt,
168  NSSArena *arenaOpt
169)
170{
171    nss_SetError(NSS_ERROR_NOT_FOUND);
172    return NULL;
173}
174
175NSS_IMPLEMENT NSSItem *
176NSSSymmetricKey_SignRecover (
177  NSSSymmetricKey *mk,
178  NSSAlgorithmAndParameters *apOpt,
179  NSSItem *data,
180  NSSCallback *uhh,
181  NSSItem *rvOpt,
182  NSSArena *arenaOpt
183)
184{
185    nss_SetError(NSS_ERROR_NOT_FOUND);
186    return NULL;
187}
188
189NSS_IMPLEMENT PRStatus
190NSSSymmetricKey_Verify (
191  NSSSymmetricKey *mk,
192  NSSAlgorithmAndParameters *apOpt,
193  NSSItem *data,
194  NSSItem *signature,
195  NSSCallback *uhh
196)
197{
198    nss_SetError(NSS_ERROR_NOT_FOUND);
199    return PR_FAILURE;
200}
201
202NSS_IMPLEMENT NSSItem *
203NSSSymmetricKey_VerifyRecover (
204  NSSSymmetricKey *mk,
205  NSSAlgorithmAndParameters *apOpt,
206  NSSItem *signature,
207  NSSCallback *uhh,
208  NSSItem *rvOpt,
209  NSSArena *arenaOpt
210)
211{
212    nss_SetError(NSS_ERROR_NOT_FOUND);
213    return NULL;
214}
215
216NSS_IMPLEMENT NSSItem *
217NSSSymmetricKey_WrapSymmetricKey (
218  NSSSymmetricKey *wrappingKey,
219  NSSAlgorithmAndParameters *apOpt,
220  NSSSymmetricKey *keyToWrap,
221  NSSCallback *uhh,
222  NSSItem *rvOpt,
223  NSSArena *arenaOpt
224)
225{
226    nss_SetError(NSS_ERROR_NOT_FOUND);
227    return NULL;
228}
229
230NSS_IMPLEMENT NSSItem *
231NSSSymmetricKey_WrapPrivateKey (
232  NSSSymmetricKey *wrappingKey,
233  NSSAlgorithmAndParameters *apOpt,
234  NSSPrivateKey *keyToWrap,
235  NSSCallback *uhh,
236  NSSItem *rvOpt,
237  NSSArena *arenaOpt
238)
239{
240    nss_SetError(NSS_ERROR_NOT_FOUND);
241    return NULL;
242}
243
244NSS_IMPLEMENT NSSSymmetricKey *
245NSSSymmetricKey_UnwrapSymmetricKey (
246  NSSSymmetricKey *wrappingKey,
247  NSSAlgorithmAndParameters *apOpt,
248  NSSItem *wrappedKey,
249  NSSOID *target,
250  PRUint32 keySizeOpt,
251  NSSOperations operations,
252  NSSCallback *uhh
253)
254{
255    nss_SetError(NSS_ERROR_NOT_FOUND);
256    return NULL;
257}
258
259NSS_IMPLEMENT NSSPrivateKey *
260NSSSymmetricKey_UnwrapPrivateKey (
261  NSSSymmetricKey *wrappingKey,
262  NSSAlgorithmAndParameters *apOpt,
263  NSSItem *wrappedKey,
264  NSSUTF8 *labelOpt,
265  NSSItem *keyIDOpt,
266  PRBool persistant,
267  PRBool sensitive,
268  NSSToken *destinationOpt,
269  NSSCallback *uhh
270)
271{
272    nss_SetError(NSS_ERROR_NOT_FOUND);
273    return NULL;
274}
275
276NSS_IMPLEMENT NSSSymmetricKey *
277NSSSymmetricKey_DeriveSymmetricKey (
278  NSSSymmetricKey *originalKey,
279  NSSAlgorithmAndParameters *apOpt,
280  NSSOID *target,
281  PRUint32 keySizeOpt,
282  NSSOperations operations,
283  NSSCallback *uhh
284)
285{
286    nss_SetError(NSS_ERROR_NOT_FOUND);
287    return NULL;
288}
289
290NSS_IMPLEMENT NSSCryptoContext *
291NSSSymmetricKey_CreateCryptoContext (
292  NSSSymmetricKey *mk,
293  NSSAlgorithmAndParameters *apOpt,
294  NSSCallback *uhh
295)
296{
297    nss_SetError(NSS_ERROR_NOT_FOUND);
298    return NULL;
299}
300