| OLD | NEW |
| (Empty) |
| 1 /* This Source Code Form is subject to the terms of the Mozilla Public | |
| 2 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| 4 | |
| 5 #ifdef DEBUG | |
| 6 static const char CVS_ID[] = "@(#) $RCSfile: asymmkey.c,v $ $Revision: 1.7 $ $Da
te: 2012/04/25 14:50:07 $"; | |
| 7 #endif /* DEBUG */ | |
| 8 | |
| 9 #ifndef NSSPKI_H | |
| 10 #include "nsspki.h" | |
| 11 #endif /* NSSPKI_H */ | |
| 12 | |
| 13 #ifndef BASE_H | |
| 14 #include "base.h" | |
| 15 #endif /* BASE_H */ | |
| 16 | |
| 17 extern const NSSError NSS_ERROR_NOT_FOUND; | |
| 18 | |
| 19 NSS_IMPLEMENT PRStatus | |
| 20 NSSPrivateKey_Destroy ( | |
| 21 NSSPrivateKey *vk | |
| 22 ) | |
| 23 { | |
| 24 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 25 return PR_FAILURE; | |
| 26 } | |
| 27 | |
| 28 NSS_IMPLEMENT PRStatus | |
| 29 NSSPrivateKey_DeleteStoredObject ( | |
| 30 NSSPrivateKey *vk, | |
| 31 NSSCallback *uhh | |
| 32 ) | |
| 33 { | |
| 34 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 35 return PR_FAILURE; | |
| 36 } | |
| 37 | |
| 38 NSS_IMPLEMENT PRUint32 | |
| 39 NSSPrivateKey_GetSignatureLength ( | |
| 40 NSSPrivateKey *vk | |
| 41 ) | |
| 42 { | |
| 43 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 44 return -1; | |
| 45 } | |
| 46 | |
| 47 NSS_IMPLEMENT PRUint32 | |
| 48 NSSPrivateKey_GetPrivateModulusLength ( | |
| 49 NSSPrivateKey *vk | |
| 50 ) | |
| 51 { | |
| 52 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 53 return -1; | |
| 54 } | |
| 55 | |
| 56 NSS_IMPLEMENT PRBool | |
| 57 NSSPrivateKey_IsStillPresent ( | |
| 58 NSSPrivateKey *vk, | |
| 59 PRStatus *statusOpt | |
| 60 ) | |
| 61 { | |
| 62 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 63 return PR_FALSE; | |
| 64 } | |
| 65 | |
| 66 NSS_IMPLEMENT NSSItem * | |
| 67 NSSPrivateKey_Encode ( | |
| 68 NSSPrivateKey *vk, | |
| 69 NSSAlgorithmAndParameters *ap, | |
| 70 NSSItem *passwordOpt, /* NULL will cause a callback; "" for no password */ | |
| 71 NSSCallback *uhhOpt, | |
| 72 NSSItem *rvOpt, | |
| 73 NSSArena *arenaOpt | |
| 74 ) | |
| 75 { | |
| 76 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 77 return NULL; | |
| 78 } | |
| 79 | |
| 80 NSS_IMPLEMENT NSSTrustDomain * | |
| 81 NSSPrivateKey_GetTrustDomain ( | |
| 82 NSSPrivateKey *vk, | |
| 83 PRStatus *statusOpt | |
| 84 ) | |
| 85 { | |
| 86 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 87 return NULL; | |
| 88 } | |
| 89 | |
| 90 NSS_IMPLEMENT NSSToken * | |
| 91 NSSPrivateKey_GetToken ( | |
| 92 NSSPrivateKey *vk | |
| 93 ) | |
| 94 { | |
| 95 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 96 return NULL; | |
| 97 } | |
| 98 | |
| 99 NSS_IMPLEMENT NSSSlot * | |
| 100 NSSPrivateKey_GetSlot ( | |
| 101 NSSPrivateKey *vk | |
| 102 ) | |
| 103 { | |
| 104 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 105 return NULL; | |
| 106 } | |
| 107 | |
| 108 NSS_IMPLEMENT NSSModule * | |
| 109 NSSPrivateKey_GetModule ( | |
| 110 NSSPrivateKey *vk | |
| 111 ) | |
| 112 { | |
| 113 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 114 return NULL; | |
| 115 } | |
| 116 | |
| 117 NSS_IMPLEMENT NSSItem * | |
| 118 NSSPrivateKey_Decrypt ( | |
| 119 NSSPrivateKey *vk, | |
| 120 NSSAlgorithmAndParameters *apOpt, | |
| 121 NSSItem *encryptedData, | |
| 122 NSSCallback *uhh, | |
| 123 NSSItem *rvOpt, | |
| 124 NSSArena *arenaOpt | |
| 125 ) | |
| 126 { | |
| 127 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 128 return NULL; | |
| 129 } | |
| 130 | |
| 131 NSS_IMPLEMENT NSSItem * | |
| 132 NSSPrivateKey_Sign ( | |
| 133 NSSPrivateKey *vk, | |
| 134 NSSAlgorithmAndParameters *apOpt, | |
| 135 NSSItem *data, | |
| 136 NSSCallback *uhh, | |
| 137 NSSItem *rvOpt, | |
| 138 NSSArena *arenaOpt | |
| 139 ) | |
| 140 { | |
| 141 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 142 return NULL; | |
| 143 } | |
| 144 | |
| 145 NSS_IMPLEMENT NSSItem * | |
| 146 NSSPrivateKey_SignRecover ( | |
| 147 NSSPrivateKey *vk, | |
| 148 NSSAlgorithmAndParameters *apOpt, | |
| 149 NSSItem *data, | |
| 150 NSSCallback *uhh, | |
| 151 NSSItem *rvOpt, | |
| 152 NSSArena *arenaOpt | |
| 153 ) | |
| 154 { | |
| 155 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 156 return NULL; | |
| 157 } | |
| 158 | |
| 159 NSS_IMPLEMENT NSSSymmetricKey * | |
| 160 NSSPrivateKey_UnwrapSymmetricKey ( | |
| 161 NSSPrivateKey *vk, | |
| 162 NSSAlgorithmAndParameters *apOpt, | |
| 163 NSSItem *wrappedKey, | |
| 164 NSSCallback *uhh | |
| 165 ) | |
| 166 { | |
| 167 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 168 return NULL; | |
| 169 } | |
| 170 | |
| 171 NSS_IMPLEMENT NSSSymmetricKey * | |
| 172 NSSPrivateKey_DeriveSymmetricKey ( | |
| 173 NSSPrivateKey *vk, | |
| 174 NSSPublicKey *bk, | |
| 175 NSSAlgorithmAndParameters *apOpt, | |
| 176 NSSOID *target, | |
| 177 PRUint32 keySizeOpt, /* zero for best allowed */ | |
| 178 NSSOperations operations, | |
| 179 NSSCallback *uhh | |
| 180 ) | |
| 181 { | |
| 182 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 183 return NULL; | |
| 184 } | |
| 185 | |
| 186 NSS_IMPLEMENT NSSPublicKey * | |
| 187 NSSPrivateKey_FindPublicKey ( | |
| 188 NSSPrivateKey *vk | |
| 189 /* { don't need the callback here, right? } */ | |
| 190 ) | |
| 191 { | |
| 192 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 193 return NULL; | |
| 194 } | |
| 195 | |
| 196 NSS_IMPLEMENT NSSCryptoContext * | |
| 197 NSSPrivateKey_CreateCryptoContext ( | |
| 198 NSSPrivateKey *vk, | |
| 199 NSSAlgorithmAndParameters *apOpt, | |
| 200 NSSCallback *uhh | |
| 201 ) | |
| 202 { | |
| 203 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 204 return NULL; | |
| 205 } | |
| 206 | |
| 207 NSS_IMPLEMENT NSSCertificate ** | |
| 208 NSSPrivateKey_FindCertificates ( | |
| 209 NSSPrivateKey *vk, | |
| 210 NSSCertificate *rvOpt[], | |
| 211 PRUint32 maximumOpt, /* 0 for no max */ | |
| 212 NSSArena *arenaOpt | |
| 213 ) | |
| 214 { | |
| 215 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 216 return NULL; | |
| 217 } | |
| 218 | |
| 219 NSS_IMPLEMENT NSSCertificate * | |
| 220 NSSPrivateKey_FindBestCertificate ( | |
| 221 NSSPrivateKey *vk, | |
| 222 NSSTime *timeOpt, | |
| 223 NSSUsage *usageOpt, | |
| 224 NSSPolicies *policiesOpt | |
| 225 ) | |
| 226 { | |
| 227 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 228 return NULL; | |
| 229 } | |
| 230 | |
| 231 NSS_IMPLEMENT PRStatus | |
| 232 NSSPublicKey_Destroy ( | |
| 233 NSSPublicKey *bk | |
| 234 ) | |
| 235 { | |
| 236 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 237 return PR_FAILURE; | |
| 238 } | |
| 239 | |
| 240 NSS_IMPLEMENT PRStatus | |
| 241 NSSPublicKey_DeleteStoredObject ( | |
| 242 NSSPublicKey *bk, | |
| 243 NSSCallback *uhh | |
| 244 ) | |
| 245 { | |
| 246 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 247 return PR_FAILURE; | |
| 248 } | |
| 249 | |
| 250 NSS_IMPLEMENT NSSItem * | |
| 251 NSSPublicKey_Encode ( | |
| 252 NSSPublicKey *bk, | |
| 253 NSSAlgorithmAndParameters *ap, | |
| 254 NSSCallback *uhhOpt, | |
| 255 NSSItem *rvOpt, | |
| 256 NSSArena *arenaOpt | |
| 257 ) | |
| 258 { | |
| 259 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 260 return NULL; | |
| 261 } | |
| 262 | |
| 263 NSS_IMPLEMENT NSSTrustDomain * | |
| 264 NSSPublicKey_GetTrustDomain ( | |
| 265 NSSPublicKey *bk, | |
| 266 PRStatus *statusOpt | |
| 267 ) | |
| 268 { | |
| 269 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 270 return NULL; | |
| 271 } | |
| 272 | |
| 273 NSS_IMPLEMENT NSSToken * | |
| 274 NSSPublicKey_GetToken ( | |
| 275 NSSPublicKey *bk, | |
| 276 PRStatus *statusOpt | |
| 277 ) | |
| 278 { | |
| 279 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 280 return NULL; | |
| 281 } | |
| 282 | |
| 283 NSS_IMPLEMENT NSSSlot * | |
| 284 NSSPublicKey_GetSlot ( | |
| 285 NSSPublicKey *bk, | |
| 286 PRStatus *statusOpt | |
| 287 ) | |
| 288 { | |
| 289 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 290 return NULL; | |
| 291 } | |
| 292 | |
| 293 NSS_IMPLEMENT NSSModule * | |
| 294 NSSPublicKey_GetModule ( | |
| 295 NSSPublicKey *bk, | |
| 296 PRStatus *statusOpt | |
| 297 ) | |
| 298 { | |
| 299 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 300 return NULL; | |
| 301 } | |
| 302 | |
| 303 NSS_IMPLEMENT NSSItem * | |
| 304 NSSPublicKey_Encrypt ( | |
| 305 NSSPublicKey *bk, | |
| 306 NSSAlgorithmAndParameters *apOpt, | |
| 307 NSSItem *data, | |
| 308 NSSCallback *uhh, | |
| 309 NSSItem *rvOpt, | |
| 310 NSSArena *arenaOpt | |
| 311 ) | |
| 312 { | |
| 313 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 314 return NULL; | |
| 315 } | |
| 316 | |
| 317 NSS_IMPLEMENT PRStatus | |
| 318 NSSPublicKey_Verify ( | |
| 319 NSSPublicKey *bk, | |
| 320 NSSAlgorithmAndParameters *apOpt, | |
| 321 NSSItem *data, | |
| 322 NSSItem *signature, | |
| 323 NSSCallback *uhh | |
| 324 ) | |
| 325 { | |
| 326 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 327 return PR_FAILURE; | |
| 328 } | |
| 329 | |
| 330 NSS_IMPLEMENT NSSItem * | |
| 331 NSSPublicKey_VerifyRecover ( | |
| 332 NSSPublicKey *bk, | |
| 333 NSSAlgorithmAndParameters *apOpt, | |
| 334 NSSItem *signature, | |
| 335 NSSCallback *uhh, | |
| 336 NSSItem *rvOpt, | |
| 337 NSSArena *arenaOpt | |
| 338 ) | |
| 339 { | |
| 340 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 341 return NULL; | |
| 342 } | |
| 343 | |
| 344 NSS_IMPLEMENT NSSItem * | |
| 345 NSSPublicKey_WrapSymmetricKey ( | |
| 346 NSSPublicKey *bk, | |
| 347 NSSAlgorithmAndParameters *apOpt, | |
| 348 NSSSymmetricKey *keyToWrap, | |
| 349 NSSCallback *uhh, | |
| 350 NSSItem *rvOpt, | |
| 351 NSSArena *arenaOpt | |
| 352 ) | |
| 353 { | |
| 354 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 355 return NULL; | |
| 356 } | |
| 357 | |
| 358 NSS_IMPLEMENT NSSCryptoContext * | |
| 359 NSSPublicKey_CreateCryptoContext ( | |
| 360 NSSPublicKey *bk, | |
| 361 NSSAlgorithmAndParameters *apOpt, | |
| 362 NSSCallback *uhh | |
| 363 ) | |
| 364 { | |
| 365 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 366 return NULL; | |
| 367 } | |
| 368 | |
| 369 NSS_IMPLEMENT NSSCertificate ** | |
| 370 NSSPublicKey_FindCertificates ( | |
| 371 NSSPublicKey *bk, | |
| 372 NSSCertificate *rvOpt[], | |
| 373 PRUint32 maximumOpt, /* 0 for no max */ | |
| 374 NSSArena *arenaOpt | |
| 375 ) | |
| 376 { | |
| 377 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 378 return NULL; | |
| 379 } | |
| 380 | |
| 381 NSS_IMPLEMENT NSSCertificate * | |
| 382 NSSPublicKey_FindBestCertificate ( | |
| 383 NSSPublicKey *bk, | |
| 384 NSSTime *timeOpt, | |
| 385 NSSUsage *usageOpt, | |
| 386 NSSPolicies *policiesOpt | |
| 387 ) | |
| 388 { | |
| 389 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 390 return NULL; | |
| 391 } | |
| 392 | |
| 393 NSS_IMPLEMENT NSSPrivateKey * | |
| 394 NSSPublicKey_FindPrivateKey ( | |
| 395 NSSPublicKey *bk, | |
| 396 NSSCallback *uhh | |
| 397 ) | |
| 398 { | |
| 399 nss_SetError(NSS_ERROR_NOT_FOUND); | |
| 400 return NULL; | |
| 401 } | |
| 402 | |
| OLD | NEW |