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 PKIX-C library.
16 * The Initial Developer of the Original Code is
17 * Sun Microsystems, Inc.
18 * Portions created by the Initial Developer are
19 * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
22 * Sun Microsystems, Inc.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 * These functions provide support for a number of other functions
39 * by creating and manipulating data structures used by those functions.
54 * Please refer to the libpkix Programmer's Guide for detailed information
55 * about how to use the libpkix library. Certain key warnings and notices from
56 * that document are repeated here for emphasis.
58 * All identifiers in this file (and all public identifiers defined in
59 * libpkix) begin with "PKIX_". Private identifiers only intended for use
60 * within the library begin with "pkix_".
62 * A function returns NULL upon success, and a PKIX_Error pointer upon failure.
64 * Unless otherwise noted, for all accessor (gettor) functions that return a
65 * PKIX_PL_Object pointer, callers should assume that this pointer refers to a
66 * shared object. Therefore, the caller should treat this shared object as
67 * read-only and should not modify this shared object. When done using the
68 * shared object, the caller should release the reference to the object by
69 * using the PKIX_PL_Object_DecRef function.
71 * While a function is executing, if its arguments (or anything referred to by
72 * its arguments) are modified, free'd, or destroyed, the function's behavior
79 * PKIX_Loggers provide a standard way for the caller to insert custom logging
80 * facilities. These are used by libpkix to log errors, debug information,
81 * status, etc. The LogCallback allows custom logging to take place.
82 * Additionally, a Logger can be initialized with a loggerContext, which is
83 * where the caller can specify configuration data such as the name of a
84 * logfile or database. Note that this loggerContext must be a PKIX_PL_Object,
85 * allowing it to be reference-counted and allowing it to provide the standard
86 * PKIX_PL_Object functions (Equals, Hashcode, ToString, Compare, Duplicate).
88 * Once the caller has created the Logger object(s) (and set the loggerContext
89 * (if any) and the Log callback), the caller then registers these Loggers
90 * with the system by calling PKIX_SetLoggers or PKIX_AddLogger. All log
91 * entries will then be logged using the specified Loggers. If multiple
92 * Loggers are specified, every log entry will be logged with each of them.
94 * XXX Maybe give some guidance somewhere on how much detail each logging
95 * level should have and where component boundaries should be. Maybe in
96 * Implementor's Guide or Programmer's Guide.
99 #define PKIX_LOGGER_LEVEL_TRACE 5
100 #define PKIX_LOGGER_LEVEL_DEBUG 4
101 #define PKIX_LOGGER_LEVEL_WARNING 3
102 #define PKIX_LOGGER_LEVEL_ERROR 2
103 #define PKIX_LOGGER_LEVEL_FATALERROR 1
105 #define PKIX_LOGGER_LEVEL_MAX 5
108 * FUNCTION: PKIX_Logger_LogCallback
111 * This callback function logs a log entry containing the String pointed to
112 * by "message", the integer value of logLevel, and the String pointed to by
113 * "logComponent". A log entry can be associated with a particular log
114 * level (i.e. level 3) and a particular log component (i.e. "CertStore").
115 * For example, someone reading the log may only be interested in very general
116 * log entries so they look only for log level 1. Similarly, they may only be
117 * interested in log entries pertaining to the CertStore component so they
118 * look only for that log component. This function can be used before calling
123 * Address of logger whose LogCallback is to be used. Must be non-NULL.
125 * Address of String that is to be logged used "logger". Must be non-NULL.
127 * Integer value representing the log level for this entry. The higher the
128 * level, the more detail. Must be non-NULL.
130 * PKIXERRORNUM value (defined in pkixt.h) designating the log component
133 * Platform-specific context pointer.
137 * Multiple threads must be able to safely call this function without
138 * worrying about conflicts, even if they're operating on the same objects.
140 * Returns NULL if the function succeeds.
141 * Returns a Logger Error if the function fails in a non-fatal way.
142 * Returns a Fatal Error if the function fails in an unrecoverable way.
145 (*PKIX_Logger_LogCallback
)(
147 PKIX_PL_String
*message
,
148 PKIX_UInt32 logLevel
,
149 PKIX_ERRORCLASS logComponent
,
153 * FUNCTION: PKIX_Logger_Create
156 * Creates a new Logger using the Object pointed to by "loggerContext"
157 * (if any) and stores it at "pLogger". The new Logger uses the LogCallback
158 * pointed to by "callback". The Logger's maximum logging level is initially
159 * set to a very high level and its logging component is set to NULL (all
164 * The LogCallback function to be used. Must be non-NULL.
166 * Address of Object representing the Logger's context (if any).
168 * Address where object pointer will be stored. Must be non-NULL.
170 * Platform-specific context pointer.
172 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
174 * Returns NULL if the function succeeds.
175 * Returns a Logger Error if the function fails in a non-fatal way.
176 * Returns a Fatal Error if the function fails in an unrecoverable way.
180 PKIX_Logger_LogCallback callback
,
181 PKIX_PL_Object
*loggerContext
,
182 PKIX_Logger
**pLogger
,
186 * FUNCTION: PKIX_Logger_GetLogCallback
189 * Retrieves a pointer to "logger's" Log callback function and puts it in
194 * Address of Logger whose Log callback is desired. Must be non-NULL.
196 * Address where Log callback function pointer will be stored.
199 * Platform-specific context pointer.
201 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
203 * Returns NULL if the function succeeds.
204 * Returns a Logger Error if the function fails in a non-fatal way.
205 * Returns a Fatal Error if the function fails in an unrecoverable way.
208 PKIX_Logger_GetLogCallback(
210 PKIX_Logger_LogCallback
*pCallback
,
214 * FUNCTION: PKIX_Logger_GetLoggerContext
217 * Retrieves a pointer to a PKIX_PL_Object representing the context (if any)
218 * of the Logger pointed to by "logger" and stores it at "pLoggerContext".
222 * Address of Logger whose context is to be stored. Must be non-NULL.
224 * Address where object pointer will be stored. Must be non-NULL.
226 * Platform-specific context pointer.
228 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
230 * Returns NULL if the function succeeds.
231 * Returns a Logger Error if the function fails in a non-fatal way.
232 * Returns a Fatal Error if the function fails in an unrecoverable way.
235 PKIX_Logger_GetLoggerContext(
237 PKIX_PL_Object
**pLoggerContext
,
241 * FUNCTION: PKIX_Logger_GetMaxLoggingLevel
244 * Retrieves a pointer to a PKIX_UInt32 representing the maximum logging
245 * level of the Logger pointed to by "logger" and stores it at "pLevel". Only
246 * log entries whose log level is less than or equal to this maximum logging
247 * level will be logged.
251 * Address of Logger whose maximum logging level is to be stored.
254 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
256 * Platform-specific context pointer.
258 * Conditionally Thread Safe
259 * (see Thread Safety Definitions in Programmer's Guide)
261 * Returns NULL if the function succeeds.
262 * Returns a Logger Error if the function fails in a non-fatal way.
263 * Returns a Fatal Error if the function fails in an unrecoverable way.
266 PKIX_Logger_GetMaxLoggingLevel(
272 * FUNCTION: PKIX_Logger_SetMaxLoggingLevel
275 * Sets the maximum logging level of the Logger pointed to by "logger" with
276 * the integer value of "level".
280 * Address of Logger whose maximum logging level is to be set.
283 * Maximum logging level to be set
285 * Platform-specific context pointer.
287 * Not Thread Safe - assumes exclusive access to "logger"
288 * (see Thread Safety Definitions in Programmer's Guide)
290 * Returns NULL if the function succeeds.
291 * Returns a Logger Error if the function fails in a non-fatal way.
292 * Returns a Fatal Error if the function fails in an unrecoverable way.
295 PKIX_Logger_SetMaxLoggingLevel(
301 * FUNCTION: PKIX_Logger_GetLoggingComponent
304 * Retrieves a pointer to a String representing the logging component of the
305 * Logger pointed to by "logger" and stores it at "pComponent". Only log
306 * entries whose log component matches the specified logging component will
311 * Address of Logger whose logging component is to be stored.
314 * Address where PKIXERRORNUM will be stored. Must be non-NULL.
316 * Platform-specific context pointer.
318 * Conditionally Thread Safe
319 * (see Thread Safety Definitions in Programmer's Guide)
321 * Returns NULL if the function succeeds.
322 * Returns a Logger Error if the function fails in a non-fatal way.
323 * Returns a Fatal Error if the function fails in an unrecoverable way.
326 PKIX_Logger_GetLoggingComponent(
328 PKIX_ERRORCLASS
*pComponent
,
332 * FUNCTION: PKIX_Logger_SetLoggingComponent
335 * Sets the logging component of the Logger pointed to by "logger" with the
336 * PKIXERRORNUM pointed to by "component". To match a small set of components,
337 * create a Logger for each.
341 * Address of Logger whose logging component is to be set.
344 * PKIXERRORNUM value representing logging component to be set.
346 * Platform-specific context pointer.
348 * Not Thread Safe - assumes exclusive access to "logger"
349 * (see Thread Safety Definitions in Programmer's Guide)
351 * Returns NULL if the function succeeds.
352 * Returns a Logger Error if the function fails in a non-fatal way.
353 * Returns a Fatal Error if the function fails in an unrecoverable way.
356 PKIX_Logger_SetLoggingComponent(
358 PKIX_ERRORCLASS component
,
362 * FUNCTION: PKIX_GetLoggers
365 * Retrieves a pointer to the List of Loggers (if any) being used for logging
366 * by libpkix and stores it at "pLoggers". If no loggers are being used, this
367 * function stores an empty List at "pLoggers".
369 * Note that the List returned by this function is immutable.
373 * Address where object pointer will be stored. Must be non-NULL.
375 * Platform-specific context pointer.
377 * Conditionally Thread Safe
378 * (see Thread Safety Definitions in Programmer's Guide)
380 * Returns NULL if the function succeeds.
381 * Returns a Logger Error if the function fails in a non-fatal way.
382 * Returns a Fatal Error if the function fails in an unrecoverable way.
386 PKIX_List
**pLoggers
, /* list of PKIX_Logger */
390 * FUNCTION: PKIX_SetLoggers
393 * Sets the Loggers to be used by libpkix to the List of Loggers pointed to
394 * by "loggers". If "loggers" is NULL, no Loggers will be used.
398 * Address of List of Loggers to be set. NULL for no Loggers.
400 * Platform-specific context pointer.
403 * (see Thread Safety Definitions in Programmer's Guide)
405 * Returns NULL if the function succeeds.
406 * Returns a Logger Error if the function fails in a non-fatal way.
407 * Returns a Fatal Error if the function fails in an unrecoverable way.
411 PKIX_List
*loggers
, /* list of PKIX_Logger */
415 * FUNCTION: PKIX_AddLogger
418 * Adds the Logger pointed to by "logger" to the List of Loggers used by
423 * Address of Logger to be added. Must be non-NULL.
425 * Platform-specific context pointer.
428 * (see Thread Safety Definitions in Programmer's Guide)
430 * Returns NULL if the function succeeds.
431 * Returns a Logger Error if the function fails in a non-fatal way.
432 * Returns a Fatal Error if the function fails in an unrecoverable way.
439 /* Functions pertaining to the PKIX_Error type */
443 * An Error object is returned by a function upon encountering some error
444 * condition. Each Error is associated with an errorCode specified in pkixt.h.
445 * The remaining components of an Error are optional. An Error's description
446 * specifies a text message describing the Error. An Error's supplementary info
447 * specifies additional information that might be useful. Finally, an Error's
448 * cause specifies the underlying Error (if any) that resulted in this Error
449 * being returned, thereby allowing Errors to be chained so that an entire
450 * "error stack trace" can be represented. Once created, an Error is immutable.
452 * Note that the Error's supplementary info must be an Object (although any
453 * object type), allowing it to be reference-counted and allowing it to
454 * provide the standard Object functions (Equals, Hashcode, ToString, Compare,
457 * Errors are classified as either being fatal or non-fatal. If a function
458 * fails in an unrecoverable way, it returns an Error whose errorCode is
459 * PKIX_FATAL_ERROR. If such an error is encountered, the caller should
460 * not attempt to recover since something seriously wrong has happened
461 * (e.g. corrupted memory, memory finished, etc.). All other errorCodes
462 * are considered non-fatal errors and can be handled by the caller as they
467 * FUNCTION: PKIX_Error_Create
470 * Creates a new Error using the value of "errorCode", the Error pointed to by
471 * "cause" (if any), the Object pointed to by "info" (if any), and the String
472 * pointed to by "desc" and stores it at "pError". If any error occurs during
473 * error allocation, it will be returned without chaining, since new errors
474 * cannot be created. Once created, an Error is immutable.
478 * Value of error code.
480 * Address of Error representing error's cause.
481 * NULL if none or unspecified.
483 * Address of Object representing error's supplementary information.
486 * Address of String representing error's description. NULL if none.
488 * Address where object pointer will be stored. Must be non-NULL.
490 * Platform-specific context pointer.
492 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
494 * Returns NULL if the function succeeds.
495 * Returns an Error Error if the function fails in a non-fatal way.
496 * Returns a Fatal Error if the function fails in an unrecoverable way.
500 PKIX_ERRORCLASS errClass
,
502 PKIX_PL_Object
*info
,
503 PKIX_ERRORCODE errCode
,
508 * FUNCTION: PKIX_Error_GetErrorClass
511 * Retrieves the error class of the Error pointed to by "error" and
512 * stores it at "pClass". Supported error codes are defined in pkixt.h.
516 * Address of Error whose error code is desired. Must be non-NULL.
518 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
520 * Platform-specific context pointer.
522 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
524 * Returns NULL if the function succeeds.
525 * Returns an Error Error if the function fails in a non-fatal way.
526 * Returns a Fatal Error if the function fails in an unrecoverable way.
529 PKIX_Error_GetErrorClass(
531 PKIX_ERRORCLASS
*pClass
,
535 * FUNCTION: PKIX_Error_GetErrorCode
538 * Retrieves the error code of the Error pointed to by "error" and
539 * stores it at "pCode". Supported error codes are defined in pkixt.h.
543 * Address of Error whose error code is desired. Must be non-NULL.
545 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
547 * Platform-specific context pointer.
549 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
551 * Returns NULL if the function succeeds.
552 * Returns an Error Error if the function fails in a non-fatal way.
553 * Returns a Fatal Error if the function fails in an unrecoverable way.
556 PKIX_Error_GetErrorCode(
558 PKIX_ERRORCODE
*pCode
,
562 * FUNCTION: PKIX_Error_GetCause
565 * Retrieves the cause of the Error pointed to by "error" and stores it at
566 * "pCause". If no cause was specified, NULL will be stored at "pCause".
570 * Address of Error whose cause is desired. Must be non-NULL.
572 * Address where object pointer will be stored. Must be non-NULL.
574 * Platform-specific context pointer.
576 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
578 * Returns NULL if the function succeeds.
579 * Returns an Error Error if the function fails in a non-fatal way.
580 * Returns a Fatal Error if the function fails in an unrecoverable way.
589 * FUNCTION: PKIX_Error_GetSupplementaryInfo
592 * Retrieves the supplementary info of the Error pointed to by "error" and
593 * stores it at "pInfo".
597 * Address of Error whose info is desired. Must be non-NULL.
599 * Address where info pointer will be stored. Must be non-NULL.
601 * Platform-specific context pointer.
603 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
605 * Returns NULL if the function succeeds.
606 * Returns an Error Error if the function fails in a non-fatal way.
607 * Returns a Fatal Error if the function fails in an unrecoverable way.
610 PKIX_Error_GetSupplementaryInfo(
612 PKIX_PL_Object
**pInfo
,
616 * FUNCTION: PKIX_Error_GetDescription
619 * Retrieves the description of the Error pointed to by "error" and stores it
620 * at "pDesc". If no description was specified, NULL will be stored at
625 * Address of Error whose description is desired. Must be non-NULL.
627 * Address where object pointer will be stored. Must be non-NULL.
629 * Platform-specific context pointer.
631 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
633 * Returns NULL if the function succeeds.
634 * Returns an Error Error if the function fails in a non-fatal way.
635 * Returns a Fatal Error if the function fails in an unrecoverable way.
638 PKIX_Error_GetDescription(
640 PKIX_PL_String
**pDesc
,
645 * Represents a collection of items. NULL is considered a valid item.
649 * FUNCTION: PKIX_List_Create
652 * Creates a new List and stores it at "pList". The List is initially empty
653 * and holds no items. To initially add items to the List, use
654 * PKIX_List_AppendItem
658 * Address where object pointer will be stored. Must be non-NULL.
660 * Platform-specific context pointer.
662 * Thread Safe (see Thread Safety Definitions in Programmer's Guide)
664 * Returns NULL if the function succeeds.
665 * Returns a Fatal Error if the function fails in an unrecoverable way.
673 * FUNCTION: PKIX_List_SetImmutable
676 * Sets the List pointed to by "list" to be immutable. If a caller tries to
677 * change a List after it has been marked immutable (i.e. by calling
678 * PKIX_List_AppendItem, PKIX_List_InsertItem, PKIX_List_SetItem, or
679 * PKIX_List_DeleteItem), an Error is returned.
683 * Address of List to be marked immutable. Must be non-NULL.
685 * Platform-specific context pointer.
687 * Not Thread Safe - assumes exclusive access to "list"
688 * (see Thread Safety Definitions in Programmer's Guide)
690 * Returns NULL if the function succeeds.
691 * Returns a Fatal Error if the function fails in an unrecoverable way.
694 PKIX_List_SetImmutable(
699 * FUNCTION: PKIX_List_IsImmutable
702 * Checks whether the List pointed to by "list" is immutable and stores
703 * the Boolean result at "pImmutable". If a caller tries to change a List
704 * after it has been marked immutable (i.e. by calling PKIX_List_AppendItem,
705 * PKIX_List_InsertItem, PKIX_List_SetItem, or PKIX_List_DeleteItem), an
710 * Address of List whose immutability is to be determined.
713 * Address where PKIX_Boolean will be stored. Must be non-NULL.
715 * Platform-specific context pointer.
717 * Conditionally Thread Safe
718 * (see Thread Safety Definitions in Programmer's Guide)
720 * Returns NULL if the function succeeds.
721 * Returns a Fatal Error if the function fails in an unrecoverable way.
724 PKIX_List_IsImmutable(
726 PKIX_Boolean
*pImmutable
,
730 * FUNCTION: PKIX_List_GetLength
733 * Retrieves the length of the List pointed to by "list" and stores it at
738 * Address of List whose length is desired. Must be non-NULL.
740 * Address where PKIX_UInt32 will be stored. Must be non-NULL.
742 * Platform-specific context pointer.
744 * Conditionally Thread Safe
745 * (see Thread Safety Definitions in Programmer's Guide)
747 * Returns NULL if the function succeeds.
748 * Returns a Fatal Error if the function fails in an unrecoverable way.
753 PKIX_UInt32
*pLength
,
757 * FUNCTION: PKIX_List_IsEmpty
760 * Checks whether the List pointed to by "list" is empty and stores
761 * the Boolean result at "pEmpty".
765 * Address of List whose emptiness is to be determined. Must be non-NULL.
767 * Address where PKIX_Boolean will be stored. Must be non-NULL.
769 * Platform-specific context pointer.
771 * Conditionally Thread Safe
772 * (see Thread Safety Definitions in Programmer's Guide)
774 * Returns NULL if the function succeeds.
775 * Returns a Fatal Error if the function fails in an unrecoverable way.
780 PKIX_Boolean
*pEmpty
,
784 * FUNCTION: PKIX_List_AppendItem
787 * Appends the Object pointed to by "item" after the last non-NULL item in
788 * List pointed to by "list", if any. Note that a List may validly contain
789 * NULL items. Appending "c" into the List ("a", NULL, "b", NULL) will result
790 * in ("a", NULL, "b", "c").
794 * Address of List to append to. Must be non-NULL.
796 * Address of new item to append.
798 * Platform-specific context pointer.
800 * Not Thread Safe - assumes exclusive access to "list"
801 * (see Thread Safety Definitions in Programmer's Guide)
803 * Returns NULL if the function succeeds.
804 * Returns a Fatal Error if the function fails in an unrecoverable way.
807 PKIX_List_AppendItem(
809 PKIX_PL_Object
*item
,
813 * FUNCTION: PKIX_List_InsertItem
816 * Inserts the Object pointed to by "item" into the List pointed to by "list"
817 * at the given "index". The index counts from zero and must be less than the
818 * List's length. Existing list entries at or after this index will be moved
819 * to the next highest index.
821 * XXX why not allow equal to length which would be equivalent to AppendItem?
825 * Address of List to insert into. Must be non-NULL.
827 * Position to insert into. Must be less than List's length.
829 * Address of new item to append.
831 * Platform-specific context pointer.
833 * Not Thread Safe - assumes exclusive access to "list"
834 * (see Thread Safety Definitions in Programmer's Guide)
836 * Returns NULL if the function succeeds.
837 * Returns a Fatal Error if the function fails in an unrecoverable way.
840 PKIX_List_InsertItem(
843 PKIX_PL_Object
*item
,
847 * FUNCTION: PKIX_List_GetItem
850 * Copies the "list"'s item at "index" into "pItem". The index counts from
851 * zero and must be less than the list's length. Increments the reference
852 * count on the returned object, if non-NULL.
856 * Address of List to get item from. Must be non-NULL.
858 * Index of list to get item from. Must be less than List's length.
860 * Address where object pointer will be stored. Must be non-NULL.
862 * Platform-specific context pointer.
864 * Conditionally Thread Safe
865 * (see Thread Safety Definitions in Programmer's Guide)
867 * Returns NULL if the function succeeds.
868 * Returns a Fatal Error if the function fails in an unrecoverable way.
874 PKIX_PL_Object
**pItem
,
878 * FUNCTION: PKIX_List_SetItem
881 * Sets the item at "index" of the List pointed to by "list" with the Object
882 * pointed to by "item". The index counts from zero and must be less than the
883 * List's length. The previous entry at this index will have its reference
884 * count decremented and the new entry will have its reference count
889 * Address of List to modify. Must be non-NULL.
891 * Position in List to set. Must be less than List's length.
893 * Address of Object to set at "index".
895 * Platform-specific context pointer.
897 * Not Thread Safe - assumes exclusive access to "list"
898 * (see Thread Safety Definitions in Programmer's Guide)
900 * Returns NULL if the function succeeds.
901 * Returns a Fatal Error if the function fails in an unrecoverable way.
907 PKIX_PL_Object
*item
,
911 * FUNCTION: PKIX_List_DeleteItem
913 * Deletes the item at "index" from the List pointed to by "list". The index
914 * counts from zero and must be less than the List's length. Note that this
915 * function does not destroy the List. It simply decrements the reference
916 * count of the item at "index" in the List, deletes that item from the list
917 * and moves all subsequent entries to a lower index in the list. If there is
918 * only a single element in the List and that element is deleted, then the
919 * List will be empty.
923 * Address of List to delete from. Must be non-NULL.
925 * Position in List to delete. Must be less than List's length.
927 * Platform-specific context pointer.
929 * Not Thread Safe - assumes exclusive access to "list"
930 * (see Thread Safety Definitions in Programmer's Guide)
932 * Returns NULL if the function succeeds.
933 * Returns a Fatal Error if the function fails in an unrecoverable way.
936 PKIX_List_DeleteItem(
942 * FUNCTION: PKIX_List_ReverseList
945 * Creates a new List whose elements are in the reverse order as the elements
946 * of the Object pointed to by "list" and stores the copy at "pReversedList".
947 * If "list" is empty, the new reversed List will be a copy of "list".
948 * Changes to the new object will not affect the original and vice versa.
952 * Address of List whose elements are to be reversed. Must be non-NULL.
954 * Address where object pointer will be stored. Must be non-NULL.
956 * Platform-specific context pointer.
958 * Conditionally Thread Safe
959 * (see Thread Safety Definitions in Programmer's Guide)
961 * Returns NULL if the function succeeds.
962 * Returns a Fatal Error if the function fails in an unrecoverable way.
965 PKIX_List_ReverseList(
967 PKIX_List
**pReversedList
,
974 #endif /* _PKIX_UTIL_H */