OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 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 | 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/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * Support routines for CMS implementation, none of which are exported. | 6 * Support routines for CMS implementation, none of which are exported. |
7 * | 7 * |
8 * Do not export this file! If something in here is really needed outside | 8 * Do not export this file! If something in here is really needed outside |
9 * of smime code, first try to add a CMS interface which will do it for | 9 * of smime code, first try to add a CMS interface which will do it for |
10 * you. If that has a problem, then just move out what you need, changing | 10 * you. If that has a problem, then just move out what you need, changing |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 */ | 49 */ |
50 extern NSSCMSCipherContext * | 50 extern NSSCMSCipherContext * |
51 NSS_CMSCipherContext_StartDecrypt(PK11SymKey *key, SECAlgorithmID *algid); | 51 NSS_CMSCipherContext_StartDecrypt(PK11SymKey *key, SECAlgorithmID *algid); |
52 | 52 |
53 /* | 53 /* |
54 * NSS_CMSCipherContext_StartEncrypt - create a cipher object to do encryption, | 54 * NSS_CMSCipherContext_StartEncrypt - create a cipher object to do encryption, |
55 * based on the given bulk encryption key and algorithm tag. Fill in the algori
thm | 55 * based on the given bulk encryption key and algorithm tag. Fill in the algori
thm |
56 * identifier (which may include an iv) appropriately. | 56 * identifier (which may include an iv) appropriately. |
57 */ | 57 */ |
58 extern NSSCMSCipherContext * | 58 extern NSSCMSCipherContext * |
59 NSS_CMSCipherContext_StartEncrypt(PRArenaPool *poolp, PK11SymKey *key, SECAlgori
thmID *algid); | 59 NSS_CMSCipherContext_StartEncrypt(PLArenaPool *poolp, PK11SymKey *key, SECAlgori
thmID *algid); |
60 | 60 |
61 extern void | 61 extern void |
62 NSS_CMSCipherContext_Destroy(NSSCMSCipherContext *cc); | 62 NSS_CMSCipherContext_Destroy(NSSCMSCipherContext *cc); |
63 | 63 |
64 /* | 64 /* |
65 * NSS_CMSCipherContext_DecryptLength - find the output length of the next call
to decrypt. | 65 * NSS_CMSCipherContext_DecryptLength - find the output length of the next call
to decrypt. |
66 * | 66 * |
67 * cc - the cipher context | 67 * cc - the cipher context |
68 * input_len - number of bytes used as input | 68 * input_len - number of bytes used as input |
69 * final - true if this is the final chunk of data | 69 * final - true if this is the final chunk of data |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 extern void nss_cms_recipient_list_destroy(NSSCMSRecipient **recipient_list); | 181 extern void nss_cms_recipient_list_destroy(NSSCMSRecipient **recipient_list); |
182 extern NSSCMSRecipientEncryptedKey *NSS_CMSRecipientEncryptedKey_Create(PLArenaP
ool *poolp); | 182 extern NSSCMSRecipientEncryptedKey *NSS_CMSRecipientEncryptedKey_Create(PLArenaP
ool *poolp); |
183 | 183 |
184 /************************************************************************ | 184 /************************************************************************ |
185 * cmsarray.c - misc array functions | 185 * cmsarray.c - misc array functions |
186 ************************************************************************/ | 186 ************************************************************************/ |
187 /* | 187 /* |
188 * NSS_CMSArray_Alloc - allocate an array in an arena | 188 * NSS_CMSArray_Alloc - allocate an array in an arena |
189 */ | 189 */ |
190 extern void ** | 190 extern void ** |
191 NSS_CMSArray_Alloc(PRArenaPool *poolp, int n); | 191 NSS_CMSArray_Alloc(PLArenaPool *poolp, int n); |
192 | 192 |
193 /* | 193 /* |
194 * NSS_CMSArray_Add - add an element to the end of an array | 194 * NSS_CMSArray_Add - add an element to the end of an array |
195 */ | 195 */ |
196 extern SECStatus | 196 extern SECStatus |
197 NSS_CMSArray_Add(PRArenaPool *poolp, void ***array, void *obj); | 197 NSS_CMSArray_Add(PLArenaPool *poolp, void ***array, void *obj); |
198 | 198 |
199 /* | 199 /* |
200 * NSS_CMSArray_IsEmpty - check if array is empty | 200 * NSS_CMSArray_IsEmpty - check if array is empty |
201 */ | 201 */ |
202 extern PRBool | 202 extern PRBool |
203 NSS_CMSArray_IsEmpty(void **array); | 203 NSS_CMSArray_IsEmpty(void **array); |
204 | 204 |
205 /* | 205 /* |
206 * NSS_CMSArray_Count - count number of elements in array | 206 * NSS_CMSArray_Count - count number of elements in array |
207 */ | 207 */ |
(...skipping 16 matching lines...) Expand all Loading... |
224 /************************************************************************ | 224 /************************************************************************ |
225 * cmsattr.c - misc attribute functions | 225 * cmsattr.c - misc attribute functions |
226 ************************************************************************/ | 226 ************************************************************************/ |
227 /* | 227 /* |
228 * NSS_CMSAttribute_Create - create an attribute | 228 * NSS_CMSAttribute_Create - create an attribute |
229 * | 229 * |
230 * if value is NULL, the attribute won't have a value. It can be added later | 230 * if value is NULL, the attribute won't have a value. It can be added later |
231 * with NSS_CMSAttribute_AddValue. | 231 * with NSS_CMSAttribute_AddValue. |
232 */ | 232 */ |
233 extern NSSCMSAttribute * | 233 extern NSSCMSAttribute * |
234 NSS_CMSAttribute_Create(PRArenaPool *poolp, SECOidTag oidtag, SECItem *value, PR
Bool encoded); | 234 NSS_CMSAttribute_Create(PLArenaPool *poolp, SECOidTag oidtag, SECItem *value, PR
Bool encoded); |
235 | 235 |
236 /* | 236 /* |
237 * NSS_CMSAttribute_AddValue - add another value to an attribute | 237 * NSS_CMSAttribute_AddValue - add another value to an attribute |
238 */ | 238 */ |
239 extern SECStatus | 239 extern SECStatus |
240 NSS_CMSAttribute_AddValue(PLArenaPool *poolp, NSSCMSAttribute *attr, SECItem *va
lue); | 240 NSS_CMSAttribute_AddValue(PLArenaPool *poolp, NSSCMSAttribute *attr, SECItem *va
lue); |
241 | 241 |
242 /* | 242 /* |
243 * NSS_CMSAttribute_GetType - return the OID tag | 243 * NSS_CMSAttribute_GetType - return the OID tag |
244 */ | 244 */ |
(...skipping 19 matching lines...) Expand all Loading... |
264 /* | 264 /* |
265 * NSS_CMSAttributeArray_Encode - encode an Attribute array as SET OF Attributes | 265 * NSS_CMSAttributeArray_Encode - encode an Attribute array as SET OF Attributes |
266 * | 266 * |
267 * If you are wondering why this routine does not reorder the attributes | 267 * If you are wondering why this routine does not reorder the attributes |
268 * first, and might be tempted to make it do so, see the comment by the | 268 * first, and might be tempted to make it do so, see the comment by the |
269 * call to ReorderAttributes in cmsencode.c. (Or, see who else calls this | 269 * call to ReorderAttributes in cmsencode.c. (Or, see who else calls this |
270 * and think long and hard about the implications of making it always | 270 * and think long and hard about the implications of making it always |
271 * do the reordering.) | 271 * do the reordering.) |
272 */ | 272 */ |
273 extern SECItem * | 273 extern SECItem * |
274 NSS_CMSAttributeArray_Encode(PRArenaPool *poolp, NSSCMSAttribute ***attrs, SECIt
em *dest); | 274 NSS_CMSAttributeArray_Encode(PLArenaPool *poolp, NSSCMSAttribute ***attrs, SECIt
em *dest); |
275 | 275 |
276 /* | 276 /* |
277 * NSS_CMSAttributeArray_Reorder - sort attribute array by attribute's DER encod
ing | 277 * NSS_CMSAttributeArray_Reorder - sort attribute array by attribute's DER encod
ing |
278 * | 278 * |
279 * make sure that the order of the attributes guarantees valid DER (which must b
e | 279 * make sure that the order of the attributes guarantees valid DER (which must b
e |
280 * in lexigraphically ascending order for a SET OF); if reordering is necessary
it | 280 * in lexigraphically ascending order for a SET OF); if reordering is necessary
it |
281 * will be done in place (in attrs). | 281 * will be done in place (in attrs). |
282 */ | 282 */ |
283 extern SECStatus | 283 extern SECStatus |
284 NSS_CMSAttributeArray_Reorder(NSSCMSAttribute **attrs); | 284 NSS_CMSAttributeArray_Reorder(NSSCMSAttribute **attrs); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 SECStatus NSS_CMSGenericWrapperData_Encode_BeforeStart(SECOidTag type, | 344 SECStatus NSS_CMSGenericWrapperData_Encode_BeforeStart(SECOidTag type, |
345 NSSCMSGenericWrapperData *gd); | 345 NSSCMSGenericWrapperData *gd); |
346 SECStatus NSS_CMSGenericWrapperData_Encode_BeforeData(SECOidTag type, | 346 SECStatus NSS_CMSGenericWrapperData_Encode_BeforeData(SECOidTag type, |
347 NSSCMSGenericWrapperData *gd); | 347 NSSCMSGenericWrapperData *gd); |
348 SECStatus NSS_CMSGenericWrapperData_Encode_AfterData(SECOidTag type, | 348 SECStatus NSS_CMSGenericWrapperData_Encode_AfterData(SECOidTag type, |
349 NSSCMSGenericWrapperData *gd); | 349 NSSCMSGenericWrapperData *gd); |
350 | 350 |
351 SEC_END_PROTOS | 351 SEC_END_PROTOS |
352 | 352 |
353 #endif /* _CMSLOCAL_H_ */ | 353 #endif /* _CMSLOCAL_H_ */ |
OLD | NEW |