1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
14 * The Original Code is the Netscape security libraries.
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.
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.
35 * ***** END LICENSE BLOCK ***** */
38 static const char CVS_ID
[] = "@(#) $RCSfile: asymmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:48 $";
49 extern const NSSError NSS_ERROR_NOT_FOUND
;
51 NSS_IMPLEMENT PRStatus
52 NSSPrivateKey_Destroy (
56 nss_SetError(NSS_ERROR_NOT_FOUND
);
60 NSS_IMPLEMENT PRStatus
61 NSSPrivateKey_DeleteStoredObject (
66 nss_SetError(NSS_ERROR_NOT_FOUND
);
70 NSS_IMPLEMENT PRUint32
71 NSSPrivateKey_GetSignatureLength (
75 nss_SetError(NSS_ERROR_NOT_FOUND
);
79 NSS_IMPLEMENT PRUint32
80 NSSPrivateKey_GetPrivateModulusLength (
84 nss_SetError(NSS_ERROR_NOT_FOUND
);
89 NSSPrivateKey_IsStillPresent (
94 nss_SetError(NSS_ERROR_NOT_FOUND
);
98 NSS_IMPLEMENT NSSItem
*
99 NSSPrivateKey_Encode (
101 NSSAlgorithmAndParameters
*ap
,
102 NSSItem
*passwordOpt
, /* NULL will cause a callback; "" for no password */
108 nss_SetError(NSS_ERROR_NOT_FOUND
);
112 NSS_IMPLEMENT NSSTrustDomain
*
113 NSSPrivateKey_GetTrustDomain (
118 nss_SetError(NSS_ERROR_NOT_FOUND
);
122 NSS_IMPLEMENT NSSToken
*
123 NSSPrivateKey_GetToken (
127 nss_SetError(NSS_ERROR_NOT_FOUND
);
131 NSS_IMPLEMENT NSSSlot
*
132 NSSPrivateKey_GetSlot (
136 nss_SetError(NSS_ERROR_NOT_FOUND
);
140 NSS_IMPLEMENT NSSModule
*
141 NSSPrivateKey_GetModule (
145 nss_SetError(NSS_ERROR_NOT_FOUND
);
149 NSS_IMPLEMENT NSSItem
*
150 NSSPrivateKey_Decrypt (
152 NSSAlgorithmAndParameters
*apOpt
,
153 NSSItem
*encryptedData
,
159 nss_SetError(NSS_ERROR_NOT_FOUND
);
163 NSS_IMPLEMENT NSSItem
*
166 NSSAlgorithmAndParameters
*apOpt
,
173 nss_SetError(NSS_ERROR_NOT_FOUND
);
177 NSS_IMPLEMENT NSSItem
*
178 NSSPrivateKey_SignRecover (
180 NSSAlgorithmAndParameters
*apOpt
,
187 nss_SetError(NSS_ERROR_NOT_FOUND
);
191 NSS_IMPLEMENT NSSSymmetricKey
*
192 NSSPrivateKey_UnwrapSymmetricKey (
194 NSSAlgorithmAndParameters
*apOpt
,
199 nss_SetError(NSS_ERROR_NOT_FOUND
);
203 NSS_IMPLEMENT NSSSymmetricKey
*
204 NSSPrivateKey_DeriveSymmetricKey (
207 NSSAlgorithmAndParameters
*apOpt
,
209 PRUint32 keySizeOpt
, /* zero for best allowed */
210 NSSOperations operations
,
214 nss_SetError(NSS_ERROR_NOT_FOUND
);
218 NSS_IMPLEMENT NSSPublicKey
*
219 NSSPrivateKey_FindPublicKey (
221 /* { don't need the callback here, right? } */
224 nss_SetError(NSS_ERROR_NOT_FOUND
);
228 NSS_IMPLEMENT NSSCryptoContext
*
229 NSSPrivateKey_CreateCryptoContext (
231 NSSAlgorithmAndParameters
*apOpt
,
235 nss_SetError(NSS_ERROR_NOT_FOUND
);
239 NSS_IMPLEMENT NSSCertificate
**
240 NSSPrivateKey_FindCertificates (
242 NSSCertificate
*rvOpt
[],
243 PRUint32 maximumOpt
, /* 0 for no max */
247 nss_SetError(NSS_ERROR_NOT_FOUND
);
251 NSS_IMPLEMENT NSSCertificate
*
252 NSSPrivateKey_FindBestCertificate (
256 NSSPolicies
*policiesOpt
259 nss_SetError(NSS_ERROR_NOT_FOUND
);
263 NSS_IMPLEMENT PRStatus
264 NSSPublicKey_Destroy (
268 nss_SetError(NSS_ERROR_NOT_FOUND
);
272 NSS_IMPLEMENT PRStatus
273 NSSPublicKey_DeleteStoredObject (
278 nss_SetError(NSS_ERROR_NOT_FOUND
);
282 NSS_IMPLEMENT NSSItem
*
283 NSSPublicKey_Encode (
285 NSSAlgorithmAndParameters
*ap
,
291 nss_SetError(NSS_ERROR_NOT_FOUND
);
295 NSS_IMPLEMENT NSSTrustDomain
*
296 NSSPublicKey_GetTrustDomain (
301 nss_SetError(NSS_ERROR_NOT_FOUND
);
305 NSS_IMPLEMENT NSSToken
*
306 NSSPublicKey_GetToken (
311 nss_SetError(NSS_ERROR_NOT_FOUND
);
315 NSS_IMPLEMENT NSSSlot
*
316 NSSPublicKey_GetSlot (
321 nss_SetError(NSS_ERROR_NOT_FOUND
);
325 NSS_IMPLEMENT NSSModule
*
326 NSSPublicKey_GetModule (
331 nss_SetError(NSS_ERROR_NOT_FOUND
);
335 NSS_IMPLEMENT NSSItem
*
336 NSSPublicKey_Encrypt (
338 NSSAlgorithmAndParameters
*apOpt
,
345 nss_SetError(NSS_ERROR_NOT_FOUND
);
349 NSS_IMPLEMENT PRStatus
350 NSSPublicKey_Verify (
352 NSSAlgorithmAndParameters
*apOpt
,
358 nss_SetError(NSS_ERROR_NOT_FOUND
);
362 NSS_IMPLEMENT NSSItem
*
363 NSSPublicKey_VerifyRecover (
365 NSSAlgorithmAndParameters
*apOpt
,
372 nss_SetError(NSS_ERROR_NOT_FOUND
);
376 NSS_IMPLEMENT NSSItem
*
377 NSSPublicKey_WrapSymmetricKey (
379 NSSAlgorithmAndParameters
*apOpt
,
380 NSSSymmetricKey
*keyToWrap
,
386 nss_SetError(NSS_ERROR_NOT_FOUND
);
390 NSS_IMPLEMENT NSSCryptoContext
*
391 NSSPublicKey_CreateCryptoContext (
393 NSSAlgorithmAndParameters
*apOpt
,
397 nss_SetError(NSS_ERROR_NOT_FOUND
);
401 NSS_IMPLEMENT NSSCertificate
**
402 NSSPublicKey_FindCertificates (
404 NSSCertificate
*rvOpt
[],
405 PRUint32 maximumOpt
, /* 0 for no max */
409 nss_SetError(NSS_ERROR_NOT_FOUND
);
413 NSS_IMPLEMENT NSSCertificate
*
414 NSSPublicKey_FindBestCertificate (
418 NSSPolicies
*policiesOpt
421 nss_SetError(NSS_ERROR_NOT_FOUND
);
425 NSS_IMPLEMENT NSSPrivateKey
*
426 NSSPublicKey_FindPrivateKey (
431 nss_SetError(NSS_ERROR_NOT_FOUND
);