/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. #ifdef DEBUG
  37. static const char CVS_ID[] = "@(#) $RCSfile: symmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:49 $";
  38. #endif /* DEBUG */
  39. #ifndef NSSPKI_H
  40. #include "nsspki.h"
  41. #endif /* NSSPKI_H */
  42. extern const NSSError NSS_ERROR_NOT_FOUND;
  43. NSS_IMPLEMENT PRStatus
  44. NSSSymmetricKey_Destroy (
  45. NSSSymmetricKey *mk
  46. )
  47. {
  48. nss_SetError(NSS_ERROR_NOT_FOUND);
  49. return PR_FAILURE;
  50. }
  51. NSS_IMPLEMENT PRStatus
  52. NSSSymmetricKey_DeleteStoredObject (
  53. NSSSymmetricKey *mk,
  54. NSSCallback *uhh
  55. )
  56. {
  57. nss_SetError(NSS_ERROR_NOT_FOUND);
  58. return PR_FAILURE;
  59. }
  60. NSS_IMPLEMENT PRUint32
  61. NSSSymmetricKey_GetKeyLength (
  62. NSSSymmetricKey *mk
  63. )
  64. {
  65. nss_SetError(NSS_ERROR_NOT_FOUND);
  66. return -1;
  67. }
  68. NSS_IMPLEMENT PRUint32
  69. NSSSymmetricKey_GetKeyStrength (
  70. NSSSymmetricKey *mk
  71. )
  72. {
  73. nss_SetError(NSS_ERROR_NOT_FOUND);
  74. return -1;
  75. }
  76. NSS_IMPLEMENT PRStatus
  77. NSSSymmetricKey_IsStillPresent (
  78. NSSSymmetricKey *mk
  79. )
  80. {
  81. nss_SetError(NSS_ERROR_NOT_FOUND);
  82. return PR_FAILURE;
  83. }
  84. NSS_IMPLEMENT NSSTrustDomain *
  85. NSSSymmetricKey_GetTrustDomain (
  86. NSSSymmetricKey *mk,
  87. PRStatus *statusOpt
  88. )
  89. {
  90. nss_SetError(NSS_ERROR_NOT_FOUND);
  91. return NULL;
  92. }
  93. NSS_IMPLEMENT NSSToken *
  94. NSSSymmetricKey_GetToken (
  95. NSSSymmetricKey *mk,
  96. PRStatus *statusOpt
  97. )
  98. {
  99. nss_SetError(NSS_ERROR_NOT_FOUND);
  100. return NULL;
  101. }
  102. NSS_IMPLEMENT NSSSlot *
  103. NSSSymmetricKey_GetSlot (
  104. NSSSymmetricKey *mk,
  105. PRStatus *statusOpt
  106. )
  107. {
  108. nss_SetError(NSS_ERROR_NOT_FOUND);
  109. return NULL;
  110. }
  111. NSS_IMPLEMENT NSSModule *
  112. NSSSymmetricKey_GetModule (
  113. NSSSymmetricKey *mk,
  114. PRStatus *statusOpt
  115. )
  116. {
  117. nss_SetError(NSS_ERROR_NOT_FOUND);
  118. return NULL;
  119. }
  120. NSS_IMPLEMENT NSSItem *
  121. NSSSymmetricKey_Encrypt (
  122. NSSSymmetricKey *mk,
  123. NSSAlgorithmAndParameters *apOpt,
  124. NSSItem *data,
  125. NSSCallback *uhh,
  126. NSSItem *rvOpt,
  127. NSSArena *arenaOpt
  128. )
  129. {
  130. nss_SetError(NSS_ERROR_NOT_FOUND);
  131. return NULL;
  132. }
  133. NSS_IMPLEMENT NSSItem *
  134. NSSSymmetricKey_Decrypt (
  135. NSSSymmetricKey *mk,
  136. NSSAlgorithmAndParameters *apOpt,
  137. NSSItem *encryptedData,
  138. NSSCallback *uhh,
  139. NSSItem *rvOpt,
  140. NSSArena *arenaOpt
  141. )
  142. {
  143. nss_SetError(NSS_ERROR_NOT_FOUND);
  144. return NULL;
  145. }
  146. NSS_IMPLEMENT NSSItem *
  147. NSSSymmetricKey_Sign (
  148. NSSSymmetricKey *mk,
  149. NSSAlgorithmAndParameters *apOpt,
  150. NSSItem *data,
  151. NSSCallback *uhh,
  152. NSSItem *rvOpt,
  153. NSSArena *arenaOpt
  154. )
  155. {
  156. nss_SetError(NSS_ERROR_NOT_FOUND);
  157. return NULL;
  158. }
  159. NSS_IMPLEMENT NSSItem *
  160. NSSSymmetricKey_SignRecover (
  161. NSSSymmetricKey *mk,
  162. NSSAlgorithmAndParameters *apOpt,
  163. NSSItem *data,
  164. NSSCallback *uhh,
  165. NSSItem *rvOpt,
  166. NSSArena *arenaOpt
  167. )
  168. {
  169. nss_SetError(NSS_ERROR_NOT_FOUND);
  170. return NULL;
  171. }
  172. NSS_IMPLEMENT PRStatus
  173. NSSSymmetricKey_Verify (
  174. NSSSymmetricKey *mk,
  175. NSSAlgorithmAndParameters *apOpt,
  176. NSSItem *data,
  177. NSSItem *signature,
  178. NSSCallback *uhh
  179. )
  180. {
  181. nss_SetError(NSS_ERROR_NOT_FOUND);
  182. return PR_FAILURE;
  183. }
  184. NSS_IMPLEMENT NSSItem *
  185. NSSSymmetricKey_VerifyRecover (
  186. NSSSymmetricKey *mk,
  187. NSSAlgorithmAndParameters *apOpt,
  188. NSSItem *signature,
  189. NSSCallback *uhh,
  190. NSSItem *rvOpt,
  191. NSSArena *arenaOpt
  192. )
  193. {
  194. nss_SetError(NSS_ERROR_NOT_FOUND);
  195. return NULL;
  196. }
  197. NSS_IMPLEMENT NSSItem *
  198. NSSSymmetricKey_WrapSymmetricKey (
  199. NSSSymmetricKey *wrappingKey,
  200. NSSAlgorithmAndParameters *apOpt,
  201. NSSSymmetricKey *keyToWrap,
  202. NSSCallback *uhh,
  203. NSSItem *rvOpt,
  204. NSSArena *arenaOpt
  205. )
  206. {
  207. nss_SetError(NSS_ERROR_NOT_FOUND);
  208. return NULL;
  209. }
  210. NSS_IMPLEMENT NSSItem *
  211. NSSSymmetricKey_WrapPrivateKey (
  212. NSSSymmetricKey *wrappingKey,
  213. NSSAlgorithmAndParameters *apOpt,
  214. NSSPrivateKey *keyToWrap,
  215. NSSCallback *uhh,
  216. NSSItem *rvOpt,
  217. NSSArena *arenaOpt
  218. )
  219. {
  220. nss_SetError(NSS_ERROR_NOT_FOUND);
  221. return NULL;
  222. }
  223. NSS_IMPLEMENT NSSSymmetricKey *
  224. NSSSymmetricKey_UnwrapSymmetricKey (
  225. NSSSymmetricKey *wrappingKey,
  226. NSSAlgorithmAndParameters *apOpt,
  227. NSSItem *wrappedKey,
  228. NSSOID *target,
  229. PRUint32 keySizeOpt,
  230. NSSOperations operations,
  231. NSSCallback *uhh
  232. )
  233. {
  234. nss_SetError(NSS_ERROR_NOT_FOUND);
  235. return NULL;
  236. }
  237. NSS_IMPLEMENT NSSPrivateKey *
  238. NSSSymmetricKey_UnwrapPrivateKey (
  239. NSSSymmetricKey *wrappingKey,
  240. NSSAlgorithmAndParameters *apOpt,
  241. NSSItem *wrappedKey,
  242. NSSUTF8 *labelOpt,
  243. NSSItem *keyIDOpt,
  244. PRBool persistant,
  245. PRBool sensitive,
  246. NSSToken *destinationOpt,
  247. NSSCallback *uhh
  248. )
  249. {
  250. nss_SetError(NSS_ERROR_NOT_FOUND);
  251. return NULL;
  252. }
  253. NSS_IMPLEMENT NSSSymmetricKey *
  254. NSSSymmetricKey_DeriveSymmetricKey (
  255. NSSSymmetricKey *originalKey,
  256. NSSAlgorithmAndParameters *apOpt,
  257. NSSOID *target,
  258. PRUint32 keySizeOpt,
  259. NSSOperations operations,
  260. NSSCallback *uhh
  261. )
  262. {
  263. nss_SetError(NSS_ERROR_NOT_FOUND);
  264. return NULL;
  265. }
  266. NSS_IMPLEMENT NSSCryptoContext *
  267. NSSSymmetricKey_CreateCryptoContext (
  268. NSSSymmetricKey *mk,
  269. NSSAlgorithmAndParameters *apOpt,
  270. NSSCallback *uhh
  271. )
  272. {
  273. nss_SetError(NSS_ERROR_NOT_FOUND);
  274. return NULL;
  275. }