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: symmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:49 $";
45 extern const NSSError NSS_ERROR_NOT_FOUND
;
47 NSS_IMPLEMENT PRStatus
48 NSSSymmetricKey_Destroy (
52 nss_SetError(NSS_ERROR_NOT_FOUND
);
56 NSS_IMPLEMENT PRStatus
57 NSSSymmetricKey_DeleteStoredObject (
62 nss_SetError(NSS_ERROR_NOT_FOUND
);
66 NSS_IMPLEMENT PRUint32
67 NSSSymmetricKey_GetKeyLength (
71 nss_SetError(NSS_ERROR_NOT_FOUND
);
75 NSS_IMPLEMENT PRUint32
76 NSSSymmetricKey_GetKeyStrength (
80 nss_SetError(NSS_ERROR_NOT_FOUND
);
84 NSS_IMPLEMENT PRStatus
85 NSSSymmetricKey_IsStillPresent (
89 nss_SetError(NSS_ERROR_NOT_FOUND
);
93 NSS_IMPLEMENT NSSTrustDomain
*
94 NSSSymmetricKey_GetTrustDomain (
99 nss_SetError(NSS_ERROR_NOT_FOUND
);
103 NSS_IMPLEMENT NSSToken
*
104 NSSSymmetricKey_GetToken (
109 nss_SetError(NSS_ERROR_NOT_FOUND
);
113 NSS_IMPLEMENT NSSSlot
*
114 NSSSymmetricKey_GetSlot (
119 nss_SetError(NSS_ERROR_NOT_FOUND
);
123 NSS_IMPLEMENT NSSModule
*
124 NSSSymmetricKey_GetModule (
129 nss_SetError(NSS_ERROR_NOT_FOUND
);
133 NSS_IMPLEMENT NSSItem
*
134 NSSSymmetricKey_Encrypt (
136 NSSAlgorithmAndParameters
*apOpt
,
143 nss_SetError(NSS_ERROR_NOT_FOUND
);
147 NSS_IMPLEMENT NSSItem
*
148 NSSSymmetricKey_Decrypt (
150 NSSAlgorithmAndParameters
*apOpt
,
151 NSSItem
*encryptedData
,
157 nss_SetError(NSS_ERROR_NOT_FOUND
);
161 NSS_IMPLEMENT NSSItem
*
162 NSSSymmetricKey_Sign (
164 NSSAlgorithmAndParameters
*apOpt
,
171 nss_SetError(NSS_ERROR_NOT_FOUND
);
175 NSS_IMPLEMENT NSSItem
*
176 NSSSymmetricKey_SignRecover (
178 NSSAlgorithmAndParameters
*apOpt
,
185 nss_SetError(NSS_ERROR_NOT_FOUND
);
189 NSS_IMPLEMENT PRStatus
190 NSSSymmetricKey_Verify (
192 NSSAlgorithmAndParameters
*apOpt
,
198 nss_SetError(NSS_ERROR_NOT_FOUND
);
202 NSS_IMPLEMENT NSSItem
*
203 NSSSymmetricKey_VerifyRecover (
205 NSSAlgorithmAndParameters
*apOpt
,
212 nss_SetError(NSS_ERROR_NOT_FOUND
);
216 NSS_IMPLEMENT NSSItem
*
217 NSSSymmetricKey_WrapSymmetricKey (
218 NSSSymmetricKey
*wrappingKey
,
219 NSSAlgorithmAndParameters
*apOpt
,
220 NSSSymmetricKey
*keyToWrap
,
226 nss_SetError(NSS_ERROR_NOT_FOUND
);
230 NSS_IMPLEMENT NSSItem
*
231 NSSSymmetricKey_WrapPrivateKey (
232 NSSSymmetricKey
*wrappingKey
,
233 NSSAlgorithmAndParameters
*apOpt
,
234 NSSPrivateKey
*keyToWrap
,
240 nss_SetError(NSS_ERROR_NOT_FOUND
);
244 NSS_IMPLEMENT NSSSymmetricKey
*
245 NSSSymmetricKey_UnwrapSymmetricKey (
246 NSSSymmetricKey
*wrappingKey
,
247 NSSAlgorithmAndParameters
*apOpt
,
251 NSSOperations operations
,
255 nss_SetError(NSS_ERROR_NOT_FOUND
);
259 NSS_IMPLEMENT NSSPrivateKey
*
260 NSSSymmetricKey_UnwrapPrivateKey (
261 NSSSymmetricKey
*wrappingKey
,
262 NSSAlgorithmAndParameters
*apOpt
,
268 NSSToken
*destinationOpt
,
272 nss_SetError(NSS_ERROR_NOT_FOUND
);
276 NSS_IMPLEMENT NSSSymmetricKey
*
277 NSSSymmetricKey_DeriveSymmetricKey (
278 NSSSymmetricKey
*originalKey
,
279 NSSAlgorithmAndParameters
*apOpt
,
282 NSSOperations operations
,
286 nss_SetError(NSS_ERROR_NOT_FOUND
);
290 NSS_IMPLEMENT NSSCryptoContext
*
291 NSSSymmetricKey_CreateCryptoContext (
293 NSSAlgorithmAndParameters
*apOpt
,
297 nss_SetError(NSS_ERROR_NOT_FOUND
);