Back to index

lightning-sunbird  0.9+nobinonly
asymmkey.c
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 #ifdef DEBUG
00038 static const char CVS_ID[] = "@(#) $RCSfile: asymmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:48 $";
00039 #endif /* DEBUG */
00040 
00041 #ifndef NSSPKI_H
00042 #include "nsspki.h"
00043 #endif /* NSSPKI_H */
00044 
00045 #ifndef BASE_H
00046 #include "base.h"
00047 #endif /* BASE_H */
00048 
00049 extern const NSSError NSS_ERROR_NOT_FOUND;
00050 
00051 NSS_IMPLEMENT PRStatus
00052 NSSPrivateKey_Destroy (
00053   NSSPrivateKey *vk
00054 )
00055 {
00056     nss_SetError(NSS_ERROR_NOT_FOUND);
00057     return PR_FAILURE;
00058 }
00059 
00060 NSS_IMPLEMENT PRStatus
00061 NSSPrivateKey_DeleteStoredObject (
00062   NSSPrivateKey *vk,
00063   NSSCallback *uhh
00064 )
00065 {
00066     nss_SetError(NSS_ERROR_NOT_FOUND);
00067     return PR_FAILURE;
00068 }
00069 
00070 NSS_IMPLEMENT PRUint32
00071 NSSPrivateKey_GetSignatureLength (
00072   NSSPrivateKey *vk
00073 )
00074 {
00075     nss_SetError(NSS_ERROR_NOT_FOUND);
00076     return -1;
00077 }
00078 
00079 NSS_IMPLEMENT PRUint32
00080 NSSPrivateKey_GetPrivateModulusLength (
00081   NSSPrivateKey *vk
00082 )
00083 {
00084     nss_SetError(NSS_ERROR_NOT_FOUND);
00085     return -1;
00086 }
00087 
00088 NSS_IMPLEMENT PRBool
00089 NSSPrivateKey_IsStillPresent (
00090   NSSPrivateKey *vk,
00091   PRStatus *statusOpt
00092 )
00093 {
00094     nss_SetError(NSS_ERROR_NOT_FOUND);
00095     return PR_FALSE;
00096 }
00097 
00098 NSS_IMPLEMENT NSSItem *
00099 NSSPrivateKey_Encode (
00100   NSSPrivateKey *vk,
00101   NSSAlgorithmAndParameters *ap,
00102   NSSItem *passwordOpt, /* NULL will cause a callback; "" for no password */
00103   NSSCallback *uhhOpt,
00104   NSSItem *rvOpt,
00105   NSSArena *arenaOpt
00106 )
00107 {
00108     nss_SetError(NSS_ERROR_NOT_FOUND);
00109     return NULL;
00110 }
00111 
00112 NSS_IMPLEMENT NSSTrustDomain *
00113 NSSPrivateKey_GetTrustDomain (
00114   NSSPrivateKey *vk,
00115   PRStatus *statusOpt
00116 )
00117 {
00118     nss_SetError(NSS_ERROR_NOT_FOUND);
00119     return NULL;
00120 }
00121 
00122 NSS_IMPLEMENT NSSToken *
00123 NSSPrivateKey_GetToken (
00124   NSSPrivateKey *vk
00125 )
00126 {
00127     nss_SetError(NSS_ERROR_NOT_FOUND);
00128     return NULL;
00129 }
00130 
00131 NSS_IMPLEMENT NSSSlot *
00132 NSSPrivateKey_GetSlot (
00133   NSSPrivateKey *vk
00134 )
00135 {
00136     nss_SetError(NSS_ERROR_NOT_FOUND);
00137     return NULL;
00138 }
00139 
00140 NSS_IMPLEMENT NSSModule *
00141 NSSPrivateKey_GetModule (
00142   NSSPrivateKey *vk
00143 )
00144 {
00145     nss_SetError(NSS_ERROR_NOT_FOUND);
00146     return NULL;
00147 }
00148 
00149 NSS_IMPLEMENT NSSItem *
00150 NSSPrivateKey_Decrypt (
00151   NSSPrivateKey *vk,
00152   NSSAlgorithmAndParameters *apOpt,
00153   NSSItem *encryptedData,
00154   NSSCallback *uhh,
00155   NSSItem *rvOpt,
00156   NSSArena *arenaOpt
00157 )
00158 {
00159     nss_SetError(NSS_ERROR_NOT_FOUND);
00160     return NULL;
00161 }
00162 
00163 NSS_IMPLEMENT NSSItem *
00164 NSSPrivateKey_Sign (
00165   NSSPrivateKey *vk,
00166   NSSAlgorithmAndParameters *apOpt,
00167   NSSItem *data,
00168   NSSCallback *uhh,
00169   NSSItem *rvOpt,
00170   NSSArena *arenaOpt
00171 )
00172 {
00173     nss_SetError(NSS_ERROR_NOT_FOUND);
00174     return NULL;
00175 }
00176 
00177 NSS_IMPLEMENT NSSItem *
00178 NSSPrivateKey_SignRecover (
00179   NSSPrivateKey *vk,
00180   NSSAlgorithmAndParameters *apOpt,
00181   NSSItem *data,
00182   NSSCallback *uhh,
00183   NSSItem *rvOpt,
00184   NSSArena *arenaOpt
00185 )
00186 {
00187     nss_SetError(NSS_ERROR_NOT_FOUND);
00188     return NULL;
00189 }
00190 
00191 NSS_IMPLEMENT NSSSymmetricKey *
00192 NSSPrivateKey_UnwrapSymmetricKey (
00193   NSSPrivateKey *vk,
00194   NSSAlgorithmAndParameters *apOpt,
00195   NSSItem *wrappedKey,
00196   NSSCallback *uhh
00197 )
00198 {
00199     nss_SetError(NSS_ERROR_NOT_FOUND);
00200     return NULL;
00201 }
00202 
00203 NSS_IMPLEMENT NSSSymmetricKey *
00204 NSSPrivateKey_DeriveSymmetricKey (
00205   NSSPrivateKey *vk,
00206   NSSPublicKey *bk,
00207   NSSAlgorithmAndParameters *apOpt,
00208   NSSOID *target,
00209   PRUint32 keySizeOpt, /* zero for best allowed */
00210   NSSOperations operations,
00211   NSSCallback *uhh
00212 )
00213 {
00214     nss_SetError(NSS_ERROR_NOT_FOUND);
00215     return NULL;
00216 }
00217 
00218 NSS_IMPLEMENT NSSPublicKey *
00219 NSSPrivateKey_FindPublicKey (
00220   NSSPrivateKey *vk
00221   /* { don't need the callback here, right? } */
00222 )
00223 {
00224     nss_SetError(NSS_ERROR_NOT_FOUND);
00225     return NULL;
00226 }
00227 
00228 NSS_IMPLEMENT NSSCryptoContext *
00229 NSSPrivateKey_CreateCryptoContext (
00230   NSSPrivateKey *vk,
00231   NSSAlgorithmAndParameters *apOpt,
00232   NSSCallback *uhh
00233 )
00234 {
00235     nss_SetError(NSS_ERROR_NOT_FOUND);
00236     return NULL;
00237 }
00238 
00239 NSS_IMPLEMENT NSSCertificate **
00240 NSSPrivateKey_FindCertificates (
00241   NSSPrivateKey *vk,
00242   NSSCertificate *rvOpt[],
00243   PRUint32 maximumOpt, /* 0 for no max */
00244   NSSArena *arenaOpt
00245 )
00246 {
00247     nss_SetError(NSS_ERROR_NOT_FOUND);
00248     return NULL;
00249 }
00250 
00251 NSS_IMPLEMENT NSSCertificate *
00252 NSSPrivateKey_FindBestCertificate (
00253   NSSPrivateKey *vk,
00254   NSSTime *timeOpt,
00255   NSSUsage *usageOpt,
00256   NSSPolicies *policiesOpt
00257 )
00258 {
00259     nss_SetError(NSS_ERROR_NOT_FOUND);
00260     return NULL;
00261 }
00262 
00263 NSS_IMPLEMENT PRStatus
00264 NSSPublicKey_Destroy (
00265   NSSPublicKey *bk
00266 )
00267 {
00268     nss_SetError(NSS_ERROR_NOT_FOUND);
00269     return PR_FAILURE;
00270 }
00271 
00272 NSS_IMPLEMENT PRStatus
00273 NSSPublicKey_DeleteStoredObject (
00274   NSSPublicKey *bk,
00275   NSSCallback *uhh
00276 )
00277 {
00278     nss_SetError(NSS_ERROR_NOT_FOUND);
00279     return PR_FAILURE;
00280 }
00281 
00282 NSS_IMPLEMENT NSSItem *
00283 NSSPublicKey_Encode (
00284   NSSPublicKey *bk,
00285   NSSAlgorithmAndParameters *ap,
00286   NSSCallback *uhhOpt,
00287   NSSItem *rvOpt,
00288   NSSArena *arenaOpt
00289 )
00290 {
00291     nss_SetError(NSS_ERROR_NOT_FOUND);
00292     return NULL;
00293 }
00294 
00295 NSS_IMPLEMENT NSSTrustDomain *
00296 NSSPublicKey_GetTrustDomain (
00297   NSSPublicKey *bk,
00298   PRStatus *statusOpt
00299 )
00300 {
00301     nss_SetError(NSS_ERROR_NOT_FOUND);
00302     return NULL;
00303 }
00304 
00305 NSS_IMPLEMENT NSSToken *
00306 NSSPublicKey_GetToken (
00307   NSSPublicKey *bk,
00308   PRStatus *statusOpt
00309 )
00310 {
00311     nss_SetError(NSS_ERROR_NOT_FOUND);
00312     return NULL;
00313 }
00314 
00315 NSS_IMPLEMENT NSSSlot *
00316 NSSPublicKey_GetSlot (
00317   NSSPublicKey *bk,
00318   PRStatus *statusOpt
00319 )
00320 {
00321     nss_SetError(NSS_ERROR_NOT_FOUND);
00322     return NULL;
00323 }
00324 
00325 NSS_IMPLEMENT NSSModule *
00326 NSSPublicKey_GetModule (
00327   NSSPublicKey *bk,
00328   PRStatus *statusOpt
00329 )
00330 {
00331     nss_SetError(NSS_ERROR_NOT_FOUND);
00332     return NULL;
00333 }
00334 
00335 NSS_IMPLEMENT NSSItem *
00336 NSSPublicKey_Encrypt (
00337   NSSPublicKey *bk,
00338   NSSAlgorithmAndParameters *apOpt,
00339   NSSItem *data,
00340   NSSCallback *uhh,
00341   NSSItem *rvOpt,
00342   NSSArena *arenaOpt
00343 )
00344 {
00345     nss_SetError(NSS_ERROR_NOT_FOUND);
00346     return NULL;
00347 }
00348 
00349 NSS_IMPLEMENT PRStatus
00350 NSSPublicKey_Verify (
00351   NSSPublicKey *bk,
00352   NSSAlgorithmAndParameters *apOpt,
00353   NSSItem *data,
00354   NSSItem *signature,
00355   NSSCallback *uhh
00356 )
00357 {
00358     nss_SetError(NSS_ERROR_NOT_FOUND);
00359     return PR_FAILURE;
00360 }
00361 
00362 NSS_IMPLEMENT NSSItem *
00363 NSSPublicKey_VerifyRecover (
00364   NSSPublicKey *bk,
00365   NSSAlgorithmAndParameters *apOpt,
00366   NSSItem *signature,
00367   NSSCallback *uhh,
00368   NSSItem *rvOpt,
00369   NSSArena *arenaOpt
00370 )
00371 {
00372     nss_SetError(NSS_ERROR_NOT_FOUND);
00373     return NULL;
00374 }
00375 
00376 NSS_IMPLEMENT NSSItem *
00377 NSSPublicKey_WrapSymmetricKey (
00378   NSSPublicKey *bk,
00379   NSSAlgorithmAndParameters *apOpt,
00380   NSSSymmetricKey *keyToWrap,
00381   NSSCallback *uhh,
00382   NSSItem *rvOpt,
00383   NSSArena *arenaOpt
00384 )
00385 {
00386     nss_SetError(NSS_ERROR_NOT_FOUND);
00387     return NULL;
00388 }
00389 
00390 NSS_IMPLEMENT NSSCryptoContext *
00391 NSSPublicKey_CreateCryptoContext (
00392   NSSPublicKey *bk,
00393   NSSAlgorithmAndParameters *apOpt,
00394   NSSCallback *uhh
00395 )
00396 {
00397     nss_SetError(NSS_ERROR_NOT_FOUND);
00398     return NULL;
00399 }
00400 
00401 NSS_IMPLEMENT NSSCertificate **
00402 NSSPublicKey_FindCertificates (
00403   NSSPublicKey *bk,
00404   NSSCertificate *rvOpt[],
00405   PRUint32 maximumOpt, /* 0 for no max */
00406   NSSArena *arenaOpt
00407 )
00408 {
00409     nss_SetError(NSS_ERROR_NOT_FOUND);
00410     return NULL;
00411 }
00412 
00413 NSS_IMPLEMENT NSSCertificate *
00414 NSSPublicKey_FindBestCertificate (
00415   NSSPublicKey *bk,
00416   NSSTime *timeOpt,
00417   NSSUsage *usageOpt,
00418   NSSPolicies *policiesOpt
00419 )
00420 {
00421     nss_SetError(NSS_ERROR_NOT_FOUND);
00422     return NULL;
00423 }
00424 
00425 NSS_IMPLEMENT NSSPrivateKey *
00426 NSSPublicKey_FindPrivateKey (
00427   NSSPublicKey *bk,
00428   NSSCallback *uhh
00429 )
00430 {
00431     nss_SetError(NSS_ERROR_NOT_FOUND);
00432     return NULL;
00433 }
00434