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 ***** */
41 static const char NSSPKI1_CVS_ID
[] = "@(#) $RCSfile: nsspki1.h,v $ $Revision: 1.3 $ $Date: 2005/01/20 02:25:49 $";
47 * This file contains the prototypes of the public NSS routines
48 * dealing with the PKIX part-1 definitions.
53 #endif /* NSSBASET_H */
57 #endif /* NSSPKI1T_H */
61 #endif /* OIDDATA_H */
68 * The public "methods" regarding this "object" are:
70 * NSSOID_CreateFromBER -- constructor
71 * NSSOID_CreateFromUTF8 -- constructor
72 * (there is no explicit destructor)
74 * NSSOID_GetDEREncoding
75 * NSSOID_GetUTF8Encoding
78 extern const NSSOID
*NSS_OID_UNKNOWN
;
81 * NSSOID_CreateFromBER
83 * This routine creates an NSSOID by decoding a BER- or DER-encoded
84 * OID. It may return NSS_OID_UNKNOWN upon error, in which case it
85 * will have created an error stack.
87 * The error may be one of the following values:
88 * NSS_ERROR_INVALID_BER
92 * NSS_OID_UNKNOWN upon error
93 * An NSSOID upon success
102 extern const NSSError NSS_ERROR_INVALID_BER
;
103 extern const NSSError NSS_ERROR_NO_MEMORY
;
106 * NSSOID_CreateFromUTF8
108 * This routine creates an NSSOID by decoding a UTF8 string
109 * representation of an OID in dotted-number format. The string may
110 * optionally begin with an octothorpe. It may return NSS_OID_UNKNOWN
111 * upon error, in which case it will have created an error stack.
113 * The error may be one of the following values:
114 * NSS_ERROR_INVALID_STRING
115 * NSS_ERROR_NO_MEMORY
118 * NSS_OID_UNKNOWN upon error
119 * An NSSOID upon success
123 NSSOID_CreateFromUTF8
128 extern const NSSError NSS_ERROR_INVALID_STRING
;
129 extern const NSSError NSS_ERROR_NO_MEMORY
;
132 * NSSOID_GetDEREncoding
134 * This routine returns the DER encoding of the specified NSSOID.
135 * If the optional arena argument is non-null, the memory used will
136 * be obtained from that arena; otherwise, the memory will be obtained
137 * from the heap. This routine may return return null upon error, in
138 * which case it will have created an error stack.
140 * The error may be one of the following values:
141 * NSS_ERROR_INVALID_NSSOID
142 * NSS_ERROR_NO_MEMORY
146 * The DER encoding of this NSSOID
150 NSSOID_GetDEREncoding
157 extern const NSSError NSS_ERROR_INVALID_NSSOID
;
158 extern const NSSError NSS_ERROR_NO_MEMORY
;
161 * NSSOID_GetUTF8Encoding
163 * This routine returns a UTF8 string containing the dotted-number
164 * encoding of the specified NSSOID. If the optional arena argument
165 * is non-null, the memory used will be obtained from that arena;
166 * otherwise, the memory will be obtained from the heap. This routine
167 * may return null upon error, in which case it will have created an
170 * The error may be one of the following values:
171 * NSS_ERROR_INVALID_NSSOID
172 * NSS_ERROR_NO_MEMORY
176 * A pointer to a UTF8 string containing the dotted-digit encoding of
181 NSSOID_GetUTF8Encoding
187 extern const NSSError NSS_ERROR_INVALID_NSSOID
;
188 extern const NSSError NSS_ERROR_NO_MEMORY
;
193 * The public "methods" regarding this "object" are:
195 * NSSATAV_CreateFromBER -- constructor
196 * NSSATAV_CreateFromUTF8 -- constructor
197 * NSSATAV_Create -- constructor
200 * NSSATAV_GetDEREncoding
201 * NSSATAV_GetUTF8Encoding
209 * NSSATAV_CreateFromBER
211 * This routine creates an NSSATAV by decoding a BER- or DER-encoded
212 * ATAV. If the optional arena argument is non-null, the memory used
213 * will be obtained from that arena; otherwise, the memory will be
214 * obtained from the heap. This routine may return NULL upon error,
215 * in which case it will have created an error stack.
217 * The error may be one of the following values:
218 * NSS_ERROR_INVALID_BER
219 * NSS_ERROR_NO_MEMORY
223 * A pointer to an NSSATAV upon success
227 NSSATAV_CreateFromBER
233 extern const NSSError NSS_ERROR_INVALID_BER
;
234 extern const NSSError NSS_ERROR_NO_MEMORY
;
237 * NSSATAV_CreateFromUTF8
239 * This routine creates an NSSATAV by decoding a UTF8 string in the
240 * "equals" format, e.g., "c=US." If the optional arena argument is
241 * non-null, the memory used will be obtained from that arena;
242 * otherwise, the memory will be obtained from the heap. This routine
243 * may return NULL upon error, in which case it will have created an
246 * The error may be one of the following values:
247 * NSS_ERROR_UNKNOWN_ATTRIBUTE
248 * NSS_ERROR_INVALID_STRING
249 * NSS_ERROR_NO_MEMORY
253 * A pointer to an NSSATAV upon success
257 NSSATAV_CreateFromUTF8
263 extern const NSSError NSS_ERROR_UNKNOWN_ATTRIBUTE
;
264 extern const NSSError NSS_ERROR_INVALID_STRING
;
265 extern const NSSError NSS_ERROR_NO_MEMORY
;
270 * This routine creates an NSSATAV from the specified NSSOID and the
271 * specified data. If the optional arena argument is non-null, the
272 * memory used will be obtained from that arena; otherwise, the memory
273 * will be obtained from the heap.If the specified data length is zero,
274 * the data is assumed to be terminated by first zero byte; this allows
275 * UTF8 strings to be easily specified. This routine may return NULL
276 * upon error, in which case it will have created an error stack.
278 * The error may be one of the following values:
279 * NSS_ERROR_INVALID_ARENA
280 * NSS_ERROR_INVALID_NSSOID
281 * NSS_ERROR_INVALID_POINTER
282 * NSS_ERROR_NO_MEMORY
286 * A pointer to an NSSATAV upon success
298 extern const NSSError NSS_ERROR_INVALID_ARENA
;
299 extern const NSSError NSS_ERROR_INVALID_NSSOID
;
300 extern const NSSError NSS_ERROR_INVALID_POINTER
;
301 extern const NSSError NSS_ERROR_NO_MEMORY
;
306 * This routine will destroy an ATAV object. It should eventually be
307 * called on all ATAVs created without an arena. While it is not
308 * necessary to call it on ATAVs created within an arena, it is not an
309 * error to do so. This routine returns a PRStatus value; if
310 * successful, it will return PR_SUCCESS. If unsuccessful, it will
311 * create an error stack and return PR_FAILURE.
313 * The error may be one of the following values:
314 * NSS_ERROR_INVALID_ATAV
317 * PR_FAILURE upon error
318 * PR_SUCCESS upon success
327 extern const NSSError NSS_ERROR_INVALID_ATAV
;
330 * NSSATAV_GetDEREncoding
332 * This routine will DER-encode an ATAV object. If the optional arena
333 * argument is non-null, the memory used will be obtained from that
334 * arena; otherwise, the memory will be obtained from the heap. This
335 * routine may return null upon error, in which case it will have
336 * created an error stack.
338 * The error may be one of the following values:
339 * NSS_ERROR_INVALID_ATAV
340 * NSS_ERROR_NO_MEMORY
344 * The DER encoding of this NSSATAV
348 NSSATAV_GetDEREncoding
354 extern const NSSError NSS_ERROR_INVALID_ATAV
;
355 extern const NSSError NSS_ERROR_NO_MEMORY
;
358 * NSSATAV_GetUTF8Encoding
360 * This routine returns a UTF8 string containing a string
361 * representation of the ATAV in "equals" notation (e.g., "o=Acme").
362 * If the optional arena argument is non-null, the memory used will be
363 * obtained from that arena; otherwise, the memory will be obtained
364 * from the heap. This routine may return null upon error, in which
365 * case it will have created an error stack.
367 * The error may be one of the following values:
368 * NSS_ERROR_INVALID_ATAV
369 * NSS_ERROR_NO_MEMORY
373 * A pointer to a UTF8 string containing the "equals" encoding of the
378 NSSATAV_GetUTF8Encoding
384 extern const NSSError NSS_ERROR_INVALID_ATAV
;
385 extern const NSSError NSS_ERROR_NO_MEMORY
;
390 * This routine returns the NSSOID corresponding to the attribute type
391 * in the specified ATAV. This routine may return NSS_OID_UNKNOWN
392 * upon error, in which case it will have created an error stack.
394 * The error may be one of the following values:
395 * NSS_ERROR_INVALID_ATAV
398 * NSS_OID_UNKNOWN upon error
399 * An element of enum NSSOIDenum upon success
402 NSS_EXTERN
const NSSOID
*
408 extern const NSSError NSS_ERROR_INVALID_ATAV
;
413 * This routine returns an NSSItem containing the attribute value
414 * in the specified ATAV. If the optional arena argument is non-null,
415 * the memory used will be obtained from that arena; otherwise, the
416 * memory will be obtained from the heap. This routine may return
417 * NULL upon error, in which case it will have created an error stack.
419 * The error may be one of the following values:
420 * NSS_ERROR_INVALID_ATAV
421 * NSS_ERROR_NO_MEMORY
425 * A pointer to an NSSItem containing the attribute value.
435 extern const NSSError NSS_ERROR_INVALID_ATAV
;
436 extern const NSSError NSS_ERROR_NO_MEMORY
;
441 * This routine compares two ATAVs for equality. For two ATAVs to be
442 * equal, the attribute types must be the same, and the attribute
443 * values must have equal length and contents. The result of the
444 * comparison will be stored at the location pointed to by the "equalp"
445 * variable, which must point to a valid PRBool. This routine may
446 * return PR_FAILURE upon error, in which case it will have created an
449 * The error may be one of the following values:
450 * NSS_ERROR_INVALID_ATAV
451 * NSS_ERROR_INVALID_ARGUMENT
454 * PR_FAILURE on error
455 * PR_SUCCESS upon a successful comparison (equal or not)
466 extern const NSSError NSS_ERROR_INVALID_ATAV
;
467 extern const NSSError NSS_ERROR_INVALID_ARGUMENT
;
472 * This routine duplicates the specified ATAV. If the optional arena
473 * argument is non-null, the memory required will be obtained from
474 * that arena; otherwise, the memory will be obtained from the heap.
475 * This routine may return NULL upon error, in which case it will have
476 * created an error stack.
478 * The error may be one of the following values:
479 * NSS_ERROR_INVALID_ATAV
480 * NSS_ERROR_NO_MEMORY
484 * A pointer to a new ATAV
494 extern const NSSError NSS_ERROR_INVALID_ATAV
;
495 extern const NSSError NSS_ERROR_NO_MEMORY
;
500 * The public "methods" regarding this "object" are:
502 * NSSRDN_CreateFromBER -- constructor
503 * NSSRDN_CreateFromUTF8 -- constructor
504 * NSSRDN_Create -- constructor
505 * NSSRDN_CreateSimple -- constructor
508 * NSSRDN_GetDEREncoding
509 * NSSRDN_GetUTF8Encoding
511 * NSSRDN_GetATAVCount
513 * NSSRDN_GetSimpleATAV
519 * NSSRDN_CreateFromBER
521 * This routine creates an NSSRDN by decoding a BER- or DER-encoded
522 * RDN. If the optional arena argument is non-null, the memory used
523 * will be obtained from that arena; otherwise, the memory will be
524 * obtained from the heap. This routine may return NULL upon error,
525 * in which case it will have created an error stack.
527 * The error may be one of the following values:
528 * NSS_ERROR_INVALID_BER
529 * NSS_ERROR_NO_MEMORY
533 * A pointer to an NSSRDN upon success
544 * NSSRDN_CreateFromUTF8
546 * This routine creates an NSSRDN by decoding an UTF8 string
547 * consisting of either a single ATAV in the "equals" format, e.g.,
548 * "uid=smith," or one or more such ATAVs in parentheses, e.g.,
549 * "(sn=Smith,ou=Sales)." If the optional arena argument is non-null,
550 * the memory used will be obtained from that arena; otherwise, the
551 * memory will be obtained from the heap. This routine may return
552 * NULL upon error, in which case it will have created an error stack.
554 * The error may be one of the following values:
555 * NSS_ERROR_UNKNOWN_ATTRIBUTE
556 * NSS_ERROR_INVALID_STRING
557 * NSS_ERROR_NO_MEMORY
561 * A pointer to an NSSRDN upon success
565 NSSRDN_CreateFromUTF8
574 * This routine creates an NSSRDN from one or more NSSATAVs. The
575 * final argument to this routine must be NULL. If the optional arena
576 * argument is non-null, the memory used will be obtained from that
577 * arena; otherwise, the memory will be obtained from the heap. This
578 * routine may return NULL upon error, in which case it will have
579 * created an error stack.
581 * The error may be one of the following values:
582 * NSS_ERROR_NO_MEMORY
583 * NSS_ERROR_INVALID_ATAV
587 * A pointer to an NSSRDN upon success
599 * NSSRDN_CreateSimple
601 * This routine creates a simple NSSRDN from a single NSSATAV. If the
602 * optional arena argument is non-null, the memory used will be
603 * obtained from that arena; otherwise, the memory will be obtained
604 * from the heap. This routine may return NULL upon error, in which
605 * case it will have created an error stack.
607 * The error may be one of the following values:
608 * NSS_ERROR_NO_MEMORY
609 * NSS_ERROR_INVALID_ATAV
613 * A pointer to an NSSRDN upon success
626 * This routine will destroy an RDN object. It should eventually be
627 * called on all RDNs created without an arena. While it is not
628 * necessary to call it on RDNs created within an arena, it is not an
629 * error to do so. This routine returns a PRStatus value; if
630 * successful, it will return PR_SUCCESS. If unsuccessful, it will
631 * create an error stack and return PR_FAILURE.
633 * The error may be one of the following values:
634 * NSS_ERROR_INVALID_RDN
637 * PR_FAILURE upon failure
638 * PR_SUCCESS upon success
648 * NSSRDN_GetDEREncoding
650 * This routine will DER-encode an RDN object. If the optional arena
651 * argument is non-null, the memory used will be obtained from that
652 * arena; otherwise, the memory will be obtained from the heap. This
653 * routine may return null upon error, in which case it will have
654 * created an error stack.
656 * The error may be one of the following values:
657 * NSS_ERROR_INVALID_RDN
658 * NSS_ERROR_NO_MEMORY
662 * The DER encoding of this NSSRDN
666 NSSRDN_GetDEREncoding
673 * NSSRDN_GetUTF8Encoding
675 * This routine returns a UTF8 string containing a string
676 * representation of the RDN. A simple (one-ATAV) RDN will be simply
677 * the string representation of that ATAV; a non-simple RDN will be in
678 * parenthesised form. If the optional arena argument is non-null,
679 * the memory used will be obtained from that arena; otherwise, the
680 * memory will be obtained from the heap. This routine may return
681 * null upon error, in which case it will have created an error stack.
683 * The error may be one of the following values:
684 * NSS_ERROR_INVALID_RDN
685 * NSS_ERROR_NO_MEMORY
689 * A pointer to a UTF8 string
693 NSSRDN_GetUTF8Encoding
702 * This routine adds an ATAV to the set of ATAVs in the specified RDN.
703 * Remember that RDNs consist of an unordered set of ATAVs. If the
704 * RDN was created with a non-null arena argument, that same arena
705 * will be used for any additional required memory. If the RDN was
706 * created with a NULL arena argument, any additional memory will
707 * be obtained from the heap. This routine returns a PRStatus value;
708 * it will return PR_SUCCESS upon success, and upon failure it will
709 * create an error stack and return PR_FAILURE.
711 * The error may be one of the following values:
712 * NSS_ERROR_INVALID_RDN
713 * NSS_ERROR_INVALID_ATAV
714 * NSS_ERROR_NO_MEMORY
717 * PR_SUCCESS upon success
718 * PR_FAILURE upon failure
729 * NSSRDN_GetATAVCount
731 * This routine returns the cardinality of the set of ATAVs within
732 * the specified RDN. This routine may return 0 upon error, in which
733 * case it will have created an error stack.
735 * The error may be one of the following values:
736 * NSS_ERROR_INVALID_RDN
740 * A positive number upon success
752 * This routine returns a pointer to an ATAV that is a member of
753 * the set of ATAVs within the specified RDN. While the set of
754 * ATAVs within an RDN is unordered, this routine will return
755 * distinct values for distinct values of 'i' as long as the RDN
756 * is not changed in any way. The RDN may be changed by calling
757 * NSSRDN_AddATAV. The value of the variable 'i' is on the range
758 * [0,c) where c is the cardinality returned from NSSRDN_GetATAVCount.
759 * The caller owns the ATAV the pointer to which is returned. If the
760 * optional arena argument is non-null, the memory used will be
761 * obtained from that arena; otherwise, the memory will be obtained
762 * from the heap. This routine may return NULL upon error, in which
763 * case it will have created an error stack.
765 * The error may be one of the following values:
766 * NSS_ERROR_INVALID_RDN
767 * NSS_ERROR_VALUE_OUT_OF_RANGE
768 * NSS_ERROR_NO_MEMORY
772 * A caller-owned pointer to an NSSATAV
784 * NSSRDN_GetSimpleATAV
786 * Most RDNs are actually very simple, with a single ATAV. This
787 * routine will return the single ATAV from such an RDN. The caller
788 * owns the ATAV the pointer to which is returned. If the optional
789 * arena argument is non-null, the memory used will be obtained from
790 * that arena; otherwise, the memory will be obtained from the heap.
791 * This routine may return NULL upon error, including the case where
792 * the set of ATAVs in the RDN is nonsingular. Upon error, this
793 * routine will have created an error stack.
795 * The error may be one of the following values:
796 * NSS_ERROR_INVALID_RDN
797 * NSS_ERROR_RDN_NOT_SIMPLE
798 * NSS_ERROR_NO_MEMORY
802 * A caller-owned pointer to an NSSATAV
815 * This routine compares two RDNs for equality. For two RDNs to be
816 * equal, they must have the same number of ATAVs, and every ATAV in
817 * one must be equal to an ATAV in the other. (Note that the sets
818 * of ATAVs are unordered.) The result of the comparison will be
819 * stored at the location pointed to by the "equalp" variable, which
820 * must point to a valid PRBool. This routine may return PR_FAILURE
821 * upon error, in which case it will have created an error stack.
823 * The error may be one of the following values:
824 * NSS_ERROR_INVALID_RDN
825 * NSS_ERROR_INVALID_ARGUMENT
828 * PR_FAILURE on error
829 * PR_SUCCESS upon a successful comparison (equal or not)
843 * This routine duplicates the specified RDN. If the optional arena
844 * argument is non-null, the memory required will be obtained from
845 * that arena; otherwise, the memory will be obtained from the heap.
846 * This routine may return NULL upon error, in which case it will have
847 * created an error stack.
849 * The error may be one of the following values:
850 * NSS_ERROR_INVALID_RDN
851 * NSS_ERROR_NO_MEMORY
855 * A pointer to a new RDN
868 * The public "methods" regarding this "object" are:
870 * NSSRDNSeq_CreateFromBER -- constructor
871 * NSSRDNSeq_CreateFromUTF8 -- constructor
872 * NSSRDNSeq_Create -- constructor
875 * NSSRDNSeq_GetDEREncoding
876 * NSSRDNSeq_GetUTF8Encoding
877 * NSSRDNSeq_AppendRDN
878 * NSSRDNSeq_GetRDNCount
881 * NSSRDNSeq_Duplicate
885 * NSSRDNSeq_CreateFromBER
887 * This routine creates an NSSRDNSeq by decoding a BER- or DER-encoded
888 * sequence of RDNs. If the optional arena argument is non-null,
889 * the memory used will be obtained from that arena; otherwise, the
890 * memory will be obtained from the heap. This routine may return
891 * NULL upon error, in which case it will have created an error stack.
893 * The error may be one of the following values:
894 * NSS_ERROR_INVALID_BER
895 * NSS_ERROR_NO_MEMORY
899 * A pointer to an NSSRDNSeq upon success
902 NSS_EXTERN NSSRDNSeq
*
903 NSSRDNSeq_CreateFromBER
910 * NSSRDNSeq_CreateFromUTF8
912 * This routine creates an NSSRDNSeq by decoding a UTF8 string
913 * consisting of a comma-separated sequence of RDNs, such as
914 * "(sn=Smith,ou=Sales),o=Acme,c=US." If the optional arena argument
915 * is non-null, the memory used will be obtained from that arena;
916 * otherwise, the memory will be obtained from the heap. This routine
917 * may return NULL upon error, in which case it will have created an
920 * The error may be one of the following values:
921 * NSS_ERROR_UNKNOWN_ATTRIBUTE
922 * NSS_ERROR_INVALID_STRING
923 * NSS_ERROR_NO_MEMORY
927 * A pointer to an NSSRDNSeq upon success
930 NSS_EXTERN NSSRDNSeq
*
931 NSSRDNSeq_CreateFromUTF8
934 NSSUTF8
*stringRDNSeq
940 * This routine creates an NSSRDNSeq from one or more NSSRDNs. The
941 * final argument to this routine must be NULL. If the optional arena
942 * argument is non-null, the memory used will be obtained from that
943 * arena; otherwise, the memory will be obtained from the heap. This
944 * routine may return NULL upon error, in which case it will have
945 * created an error stack.
947 * The error may be one of the following values:
948 * NSS_ERROR_NO_MEMORY
949 * NSS_ERROR_INVALID_RDN
953 * A pointero to an NSSRDNSeq upon success
956 NSS_EXTERN NSSRDNSeq
*
967 * This routine will destroy an RDNSeq object. It should eventually
968 * be called on all RDNSeqs created without an arena. While it is not
969 * necessary to call it on RDNSeqs created within an arena, it is not
970 * an error to do so. This routine returns a PRStatus value; if
971 * successful, it will return PR_SUCCESS. If unsuccessful, it will
972 * create an error stack and return PR_FAILURE.
974 * The error may be one of the following values:
975 * NSS_ERROR_INVALID_RDNSEQ
978 * PR_FAILURE upon error
979 * PR_SUCCESS upon success
989 * NSSRDNSeq_GetDEREncoding
991 * This routine will DER-encode an RDNSeq object. If the optional
992 * arena argument is non-null, the memory used will be obtained from
993 * that arena; otherwise, the memory will be obtained from the heap.
994 * This routine may return null upon error, in which case it will have
995 * created an error stack.
997 * The error may be one of the following values:
998 * NSS_ERROR_INVALID_RDNSEQ
999 * NSS_ERROR_NO_MEMORY
1003 * The DER encoding of this NSSRDNSeq
1007 NSSRDNSeq_GetDEREncoding
1014 * NSSRDNSeq_GetUTF8Encoding
1016 * This routine returns a UTF8 string containing a string
1017 * representation of the RDNSeq as a comma-separated sequence of RDNs.
1018 * If the optional arena argument is non-null, the memory used will be
1019 * obtained from that arena; otherwise, the memory will be obtained
1020 * from the heap. This routine may return null upon error, in which
1021 * case it will have created an error stack.
1023 * The error may be one of the following values:
1024 * NSS_ERROR_INVALID_RDNSEQ
1025 * NSS_ERROR_NO_MEMORY
1029 * A pointer to the UTF8 string
1032 NSS_EXTERN NSSUTF8
*
1033 NSSRDNSeq_GetUTF8Encoding
1040 * NSSRDNSeq_AppendRDN
1042 * This routine appends an RDN to the end of the existing RDN
1043 * sequence. If the RDNSeq was created with a non-null arena
1044 * argument, that same arena will be used for any additional required
1045 * memory. If the RDNSeq was created with a NULL arena argument, any
1046 * additional memory will be obtained from the heap. This routine
1047 * returns a PRStatus value; it will return PR_SUCCESS upon success,
1048 * and upon failure it will create an error stack and return PR_FAILURE.
1050 * The error may be one of the following values:
1051 * NSS_ERROR_INVALID_RDNSEQ
1052 * NSS_ERROR_INVALID_RDN
1053 * NSS_ERROR_NO_MEMORY
1056 * PR_SUCCESS upon success
1057 * PR_FAILURE upon failure
1068 * NSSRDNSeq_GetRDNCount
1070 * This routine returns the cardinality of the sequence of RDNs within
1071 * the specified RDNSeq. This routine may return 0 upon error, in
1072 * which case it will have created an error stack.
1074 * The error may be one of the following values:
1075 * NSS_ERROR_INVALID_RDNSEQ
1079 * A positive number upon success
1083 NSSRDNSeq_GetRDNCount
1091 * This routine returns a pointer to the i'th RDN in the sequence of
1092 * RDNs that make up the specified RDNSeq. The sequence begins with
1093 * the top-level (e.g., "c=US") RDN. The value of the variable 'i'
1094 * is on the range [0,c) where c is the cardinality returned from
1095 * NSSRDNSeq_GetRDNCount. The caller owns the RDN the pointer to which
1096 * is returned. If the optional arena argument is non-null, the memory
1097 * used will be obtained from that areana; otherwise, the memory will
1098 * be obtained from the heap. This routine may return NULL upon error,
1099 * in which case it will have created an error stack. Note that the
1100 * usual string representation of RDN Sequences is from last to first.
1102 * The error may be one of the following values:
1103 * NSS_ERROR_INVALID_RDNSEQ
1104 * NSS_ERROR_VALUE_OUT_OF_RANGE
1105 * NSS_ERROR_NO_MEMORY
1109 * A caller-owned pointer to an NSSRDN
1123 * This routine compares two RDNSeqs for equality. For two RDNSeqs to
1124 * be equal, they must have the same number of RDNs, and each RDN in
1125 * one sequence must be equal to the corresponding RDN in the other
1126 * sequence. The result of the comparison will be stored at the
1127 * location pointed to by the "equalp" variable, which must point to a
1128 * valid PRBool. This routine may return PR_FAILURE upon error, in
1129 * which case it will have created an error stack.
1131 * The error may be one of the following values:
1132 * NSS_ERROR_INVALID_RDNSEQ
1133 * NSS_ERROR_INVALID_ARGUMENT
1136 * PR_FAILURE on error
1137 * PR_SUCCESS upon a successful comparison (equal or not)
1149 * NSSRDNSeq_Duplicate
1151 * This routine duplicates the specified RDNSeq. If the optional arena
1152 * argument is non-null, the memory required will be obtained from that
1153 * arena; otherwise, the memory will be obtained from the heap. This
1154 * routine may return NULL upon error, in which case it will have
1155 * created an error stack.
1157 * The error may be one of the following values:
1158 * NSS_ERROR_INVALID_RDNSEQ
1159 * NSS_ERROR_NO_MEMORY
1163 * A pointer to a new RDNSeq
1166 NSS_EXTERN NSSRDNSeq
*
1176 * The public "methods" regarding this "object" are:
1178 * NSSName_CreateFromBER -- constructor
1179 * NSSName_CreateFromUTF8 -- constructor
1180 * NSSName_Create -- constructor
1183 * NSSName_GetDEREncoding
1184 * NSSName_GetUTF8Encoding
1186 * NSSName_GetRDNSequence
1187 * NSSName_GetSpecifiedChoice
1193 * NSSName_GetCommonName
1194 * NSSName_GetOrganization
1195 * NSSName_GetOrganizationalUnits
1196 * NSSName_GetStateOrProvince
1197 * NSSName_GetLocality
1198 * NSSName_GetCountry
1199 * NSSName_GetAttribute
1203 * NSSName_CreateFromBER
1205 * This routine creates an NSSName by decoding a BER- or DER-encoded
1206 * (directory) Name. If the optional arena argument is non-null,
1207 * the memory used will be obtained from that arena; otherwise,
1208 * the memory will be obtained from the heap. This routine may
1209 * return NULL upon error, in which case it will have created an error
1212 * The error may be one of the following values:
1213 * NSS_ERROR_INVALID_BER
1214 * NSS_ERROR_NO_MEMORY
1218 * A pointer to an NSSName upon success
1221 NSS_EXTERN NSSName
*
1222 NSSName_CreateFromBER
1229 * NSSName_CreateFromUTF8
1231 * This routine creates an NSSName by decoding a UTF8 string
1232 * consisting of the string representation of one of the choices of
1233 * (directory) names. Currently the only choice is an RDNSeq. If the
1234 * optional arena argument is non-null, the memory used will be
1235 * obtained from that arena; otherwise, the memory will be obtained
1236 * from the heap. The routine may return NULL upon error, in which
1237 * case it will have created an error stack.
1239 * The error may be one of the following values:
1240 * NSS_ERROR_INVALID_STRING
1241 * NSS_ERROR_NO_MEMORY
1245 * A pointer to an NSSName upon success
1248 NSS_EXTERN NSSName
*
1249 NSSName_CreateFromUTF8
1258 * This routine creates an NSSName with the specified choice of
1259 * underlying name types. The value of the choice variable must be
1260 * one of the values of the NSSNameChoice enumeration, and the type
1261 * of the arg variable must be as specified in the following table:
1264 * ======================== ===========
1265 * NSSNameChoiceRdnSequence NSSRDNSeq *
1267 * If the optional arena argument is non-null, the memory used will
1268 * be obtained from that arena; otherwise, the memory will be
1269 * obtained from the heap. This routine may return NULL upon error,
1270 * in which case it will have created an error stack.
1272 * The error may be one of the following values:
1273 * NSS_ERROR_INVALID_CHOICE
1274 * NSS_ERROR_INVALID_ARGUMENT
1275 * NSS_ERROR_NO_MEMORY
1279 * A pointer to an NSSName upon success
1282 NSS_EXTERN NSSName
*
1286 NSSNameChoice choice
,
1293 * This routine will destroy a Name object. It should eventually be
1294 * called on all Names created without an arena. While it is not
1295 * necessary to call it on Names created within an arena, it is not
1296 * an error to do so. This routine returns a PRStatus value; if
1297 * successful, it will return PR_SUCCESS. If unsuccessful, it will
1298 * create an error stack and return PR_FAILURE.
1300 * The error may be one of the following values:
1301 * NSS_ERROR_INVALID_NAME
1304 * PR_FAILURE upon error
1305 * PR_SUCCESS upon success
1315 * NSSName_GetDEREncoding
1317 * This routine will DER-encode a name object. If the optional arena
1318 * argument is non-null, the memory used will be obtained from that
1319 * arena; otherwise, the memory will be obtained from the heap. This
1320 * routine may return null upon error, in which case it will have
1321 * created an error stack.
1323 * The error may be one of the following values:
1324 * NSS_ERROR_INVALID_NAME
1325 * NSS_ERROR_NO_MEMORY
1329 * The DER encoding of this NSSName
1333 NSSName_GetDEREncoding
1340 * NSSName_GetUTF8Encoding
1342 * This routine returns a UTF8 string containing a string
1343 * representation of the Name in the format specified by the
1344 * underlying name choice. If the optional arena argument is non-null,
1345 * the memory used will be obtained from that arena; otherwise, the
1346 * memory will be obtained from the heap. This routine may return
1347 * NULL upon error, in which case it will have created an error stack.
1349 * The error may be one of the following values:
1350 * NSS_ERROR_INVALID_NAME
1351 * NSS_ERROR_NO_MEMORY
1355 * A pointer to the UTF8 string
1358 NSS_EXTERN NSSUTF8
*
1359 NSSName_GetUTF8Encoding
1368 * This routine returns the type of the choice underlying the specified
1369 * name. The return value will be a member of the NSSNameChoice
1370 * enumeration. This routine may return NSSNameChoiceInvalid upon
1371 * error, in which case it will have created an error stack.
1373 * The error may be one of the following values:
1374 * NSS_ERROR_INVALID_NAME
1377 * NSSNameChoiceInvalid upon error
1378 * An other member of the NSSNameChoice enumeration upon success
1381 NSS_EXTERN NSSNameChoice
1388 * NSSName_GetRDNSequence
1390 * If the choice underlying the specified NSSName is that of an
1391 * RDNSequence, this routine will return a pointer to that RDN
1392 * sequence. Otherwise, this routine will place an error on the
1393 * error stack, and return NULL. If the optional arena argument is
1394 * non-null, the memory required will be obtained from that arena;
1395 * otherwise, the memory will be obtained from the heap. The
1396 * caller owns the returned pointer. This routine may return NULL
1397 * upon error, in which case it will have created an error stack.
1399 * The error may be one of the following values:
1400 * NSS_ERROR_INVALID_NAME
1401 * NSS_ERROR_WRONG_CHOICE
1402 * NSS_ERROR_NO_MEMORY
1406 * A caller-owned pointer to an NSSRDNSeq
1409 NSS_EXTERN NSSRDNSeq
*
1410 NSSName_GetRDNSequence
1417 * NSSName_GetSpecifiedChoice
1419 * If the choice underlying the specified NSSName matches the specified
1420 * choice, a caller-owned pointer to that underlying object will be
1421 * returned. Otherwise, an error will be placed on the error stack and
1422 * NULL will be returned. If the optional arena argument is non-null,
1423 * the memory required will be obtained from that arena; otherwise, the
1424 * memory will be obtained from the heap. The caller owns the returned
1425 * pointer. This routine may return NULL upon error, in which case it
1426 * will have created an error stack.
1428 * The error may be one of the following values:
1429 * NSS_ERROR_INVALID_NAME
1430 * NSS_ERROR_WRONG_CHOICE
1431 * NSS_ERROR_NO_MEMORY
1435 * A caller-owned pointer, which must be typecast
1439 NSSName_GetSpecifiedChoice
1442 NSSNameChoice choice
,
1449 * This routine compares two Names for equality. For two Names to be
1450 * equal, they must have the same choice of underlying types, and the
1451 * underlying values must be equal. The result of the comparison will
1452 * be stored at the location pointed to by the "equalp" variable, which
1453 * must point to a valid PRBool. This routine may return PR_FAILURE
1454 * upon error, in which case it will have created an error stack.
1456 * The error may be one of the following values:
1457 * NSS_ERROR_INVALID_NAME
1458 * NSS_ERROR_INVALID_ARGUMENT
1461 * PR_FAILURE on error
1462 * PR_SUCCESS upon a successful comparison (equal or not)
1476 * This routine duplicates the specified nssname. If the optional
1477 * arena argument is non-null, the memory required will be obtained
1478 * from that arena; otherwise, the memory will be obtained from the
1479 * heap. This routine may return NULL upon error, in which case it
1480 * will have created an error stack.
1482 * The error may be one of the following values:
1483 * NSS_ERROR_INVALID_NAME
1484 * NSS_ERROR_NO_MEMORY
1488 * A pointer to a new NSSName
1491 NSS_EXTERN NSSName
*
1501 * This routine will attempt to derive a user identifier from the
1502 * specified name, if the choices and content of the name permit.
1503 * If the Name consists of a Sequence of Relative Distinguished
1504 * Names containing a UID attribute, the UID will be the value of
1505 * that attribute. Note that no UID attribute is defined in either
1506 * PKIX or PKCS#9; rather, this seems to derive from RFC 1274, which
1507 * defines the type as a caseIgnoreString. We'll return a Directory
1508 * String. If the optional arena argument is non-null, the memory
1509 * used will be obtained from that arena; otherwise, the memory will
1510 * be obtained from the heap. This routine may return NULL upon error,
1511 * in which case it will have created an error stack.
1513 * The error may be one of the following values:
1514 * NSS_ERROR_INVALID_NAME
1516 * NSS_ERROR_NO_MEMORY
1520 * A pointer to a UTF8 String.
1523 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1533 * This routine will attempt to derive an email address from the
1534 * specified name, if the choices and content of the name permit.
1535 * If the Name consists of a Sequence of Relative Distinguished
1536 * Names containing either a PKIX email address or a PKCS#9 email
1537 * address, the result will be the value of that attribute. If the
1538 * optional arena argument is non-null, the memory used will be
1539 * obtained from that arena; otherwise, the memory will be obtained
1540 * from the heap. This routine may return NULL upon error, in which
1541 * case it will have created an error stack.
1543 * The error may be one of the following values:
1544 * NSS_ERROR_INVALID_NAME
1545 * NSS_ERROR_NO_EMAIL
1546 * NSS_ERROR_NO_MEMORY
1550 * A pointer to a UTF8 String
1553 NSS_EXTERN NSSUTF8
* /* XXX fgmr IA5 String */
1561 * NSSName_GetCommonName
1563 * This routine will attempt to derive a common name from the
1564 * specified name, if the choices and content of the name permit.
1565 * If the Name consists of a Sequence of Relative Distinguished Names
1566 * containing a PKIX Common Name, the result will be that name. If
1567 * the optional arena argument is non-null, the memory used will be
1568 * obtained from that arena; otherwise, the memory will be obtained
1569 * from the heap. This routine may return NULL upon error, in which
1570 * case it will have created an error stack.
1572 * The error may be one of the following values:
1573 * NSS_ERROR_INVALID_NAME
1574 * NSS_ERROR_NO_COMMON_NAME
1575 * NSS_ERROR_NO_MEMORY
1579 * A pointer to a UTF8 String
1582 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1583 NSSName_GetCommonName
1590 * NSSName_GetOrganization
1592 * This routine will attempt to derive an organisation name from the
1593 * specified name, if the choices and content of the name permit.
1594 * If Name consists of a Sequence of Relative Distinguished names
1595 * containing a PKIX Organization, the result will be the value of
1596 * that attribute. If the optional arena argument is non-null, the
1597 * memory used will be obtained from that arena; otherwise, the memory
1598 * will be obtained from the heap. This routine may return NULL upon
1599 * error, in which case it will have created an error stack.
1601 * The error may be one of the following values:
1602 * NSS_ERROR_INVALID_NAME
1603 * NSS_ERROR_NO_ORGANIZATION
1604 * NSS_ERROR_NO_MEMORY
1608 * A pointer to a UTF8 String
1611 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1612 NSSName_GetOrganization
1619 * NSSName_GetOrganizationalUnits
1621 * This routine will attempt to derive a sequence of organisational
1622 * unit names from the specified name, if the choices and content of
1623 * the name permit. If the Name consists of a Sequence of Relative
1624 * Distinguished Names containing one or more organisational units,
1625 * the result will be the values of those attributes. If the optional
1626 * arena argument is non-null, the memory used will be obtained from
1627 * that arena; otherwise, the memory will be obtained from the heap.
1628 * This routine may return NULL upon error, in which case it will have
1629 * created an error stack.
1631 * The error may be one of the following values:
1632 * NSS_ERROR_INVALID_NAME
1633 * NSS_ERROR_NO_ORGANIZATIONAL_UNITS
1634 * NSS_ERROR_NO_MEMORY
1638 * A pointer to a null-terminated array of UTF8 Strings
1641 NSS_EXTERN NSSUTF8
** /* XXX fgmr DirectoryString */
1642 NSSName_GetOrganizationalUnits
1649 * NSSName_GetStateOrProvince
1651 * This routine will attempt to derive a state or province name from
1652 * the specified name, if the choices and content of the name permit.
1653 * If the Name consists of a Sequence of Relative Distinguished Names
1654 * containing a state or province, the result will be the value of
1655 * that attribute. If the optional arena argument is non-null, the
1656 * memory used will be obtained from that arena; otherwise, the memory
1657 * will be obtained from the heap. This routine may return NULL upon
1658 * error, in which case it will have created an error stack.
1660 * The error may be one of the following values:
1661 * NSS_ERROR_INVALID_NAME
1662 * NSS_ERROR_NO_STATE_OR_PROVINCE
1663 * NSS_ERROR_NO_MEMORY
1667 * A pointer to a UTF8 String
1670 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1671 NSSName_GetStateOrProvince
1678 * NSSName_GetLocality
1680 * This routine will attempt to derive a locality name from the
1681 * specified name, if the choices and content of the name permit. If
1682 * the Name consists of a Sequence of Relative Distinguished names
1683 * containing a Locality, the result will be the value of that
1684 * attribute. If the optional arena argument is non-null, the memory
1685 * used will be obtained from that arena; otherwise, the memory will
1686 * be obtained from the heap. This routine may return NULL upon error,
1687 * in which case it will have created an error stack.
1689 * The error may be one of the following values:
1690 * NSS_ERROR_INVALID_NAME
1691 * NSS_ERROR_NO_LOCALITY
1692 * NSS_ERROR_NO_MEMORY
1696 * A pointer to a UTF8 String
1699 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1707 * NSSName_GetCountry
1709 * This routine will attempt to derive a country name from the
1710 * specified name, if the choices and content of the name permit.
1711 * If the Name consists of a Sequence of Relative Distinguished
1712 * Names containing a Country, the result will be the value of
1713 * that attribute.. If the optional arena argument is non-null,
1714 * the memory used will be obtained from that arena; otherwise,
1715 * the memory will be obtained from the heap. This routine may
1716 * return NULL upon error, in which case it will have created an
1719 * The error may be one of the following values:
1720 * NSS_ERROR_INVALID_NAME
1721 * NSS_ERROR_NO_COUNTRY
1722 * NSS_ERROR_NO_MEMORY
1726 * A pointer to a UTF8 String
1729 NSS_EXTERN NSSUTF8
* /* XXX fgmr PrintableString */
1737 * NSSName_GetAttribute
1739 * If the specified name consists of a Sequence of Relative
1740 * Distinguished Names containing an attribute with the specified
1741 * type, and the actual value of that attribute may be expressed
1742 * with a Directory String, then the value of that attribute will
1743 * be returned as a Directory String. If the optional arena argument
1744 * is non-null, the memory used will be obtained from that arena;
1745 * otherwise, the memory will be obtained from the heap. This routine
1746 * may return NULL upon error, in which case it will have created an
1749 * The error may be one of the following values:
1750 * NSS_ERROR_INVALID_NAME
1751 * NSS_ERROR_NO_ATTRIBUTE
1752 * NSS_ERROR_ATTRIBUTE_VALUE_NOT_STRING
1756 * A pointer to a UTF8 String
1759 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
1760 NSSName_GetAttribute
1770 * The public "methods" regarding this "object" are:
1772 * NSSGeneralName_CreateFromBER -- constructor
1773 * NSSGeneralName_CreateFromUTF8 -- constructor
1774 * NSSGeneralName_Create -- constructor
1776 * NSSGeneralName_Destroy
1777 * NSSGeneralName_GetDEREncoding
1778 * NSSGeneralName_GetUTF8Encoding
1779 * NSSGeneralName_GetChoice
1780 * NSSGeneralName_GetOtherName
1781 * NSSGeneralName_GetRfc822Name
1782 * NSSGeneralName_GetDNSName
1783 * NSSGeneralName_GetX400Address
1784 * NSSGeneralName_GetDirectoryName
1785 * NSSGeneralName_GetEdiPartyName
1786 * NSSGeneralName_GetUniformResourceIdentifier
1787 * NSSGeneralName_GetIPAddress
1788 * NSSGeneralName_GetRegisteredID
1789 * NSSGeneralName_GetSpecifiedChoice
1790 * NSSGeneralName_Compare
1791 * NSSGeneralName_Duplicate
1793 * NSSGeneralName_GetUID
1794 * NSSGeneralName_GetEmail
1795 * NSSGeneralName_GetCommonName
1796 * NSSGeneralName_GetOrganization
1797 * NSSGeneralName_GetOrganizationalUnits
1798 * NSSGeneralName_GetStateOrProvince
1799 * NSSGeneralName_GetLocality
1800 * NSSGeneralName_GetCountry
1801 * NSSGeneralName_GetAttribute
1805 * NSSGeneralName_CreateFromBER
1807 * This routine creates an NSSGeneralName by decoding a BER- or DER-
1808 * encoded general name. If the optional arena argument is non-null,
1809 * the memory used will be obtained from that arena; otherwise, the
1810 * memory will be obtained from the heap. This routine may return
1811 * NULL upon error, in which case it will have created an error stack.
1813 * The error may be one of the following values:
1814 * NSS_ERROR_INVALID_BER
1815 * NSS_ERROR_NO_MEMORY
1819 * A pointer to an NSSGeneralName upon success
1822 NSS_EXTERN NSSGeneralName
*
1823 NSSGeneralName_CreateFromBER
1826 NSSBER
*berGeneralName
1830 * NSSGeneralName_CreateFromUTF8
1832 * This routine creates an NSSGeneralName by decoding a UTF8 string
1833 * consisting of the string representation of one of the choices of
1834 * general names. If the optional arena argument is non-null, the
1835 * memory used will be obtained from that arena; otherwise, the memory
1836 * will be obtained from the heap. The routine may return NULL upon
1837 * error, in which case it will have created an error stack.
1839 * The error may be one of the following values:
1840 * NSS_ERROR_INVALID_STRING
1841 * NSS_ERROR_NO_MEMORY
1845 * A pointer to an NSSGeneralName upon success
1848 NSS_EXTERN NSSGeneralName
*
1849 NSSGeneralName_CreateFromUTF8
1852 NSSUTF8
*stringGeneralName
1856 * NSSGeneralName_Create
1858 * This routine creates an NSSGeneralName with the specified choice of
1859 * underlying name types. The value of the choice variable must be one
1860 * of the values of the NSSGeneralNameChoice enumeration, and the type
1861 * of the arg variable must be as specified in the following table:
1864 * ============================================ =========
1865 * NSSGeneralNameChoiceOtherName
1866 * NSSGeneralNameChoiceRfc822Name
1867 * NSSGeneralNameChoiceDNSName
1868 * NSSGeneralNameChoiceX400Address
1869 * NSSGeneralNameChoiceDirectoryName NSSName *
1870 * NSSGeneralNameChoiceEdiPartyName
1871 * NSSGeneralNameChoiceUniformResourceIdentifier
1872 * NSSGeneralNameChoiceIPAddress
1873 * NSSGeneralNameChoiceRegisteredID
1875 * If the optional arena argument is non-null, the memory used will
1876 * be obtained from that arena; otherwise, the memory will be
1877 * obtained from the heap. This routine may return NULL upon error,
1878 * in which case it will have created an error stack.
1880 * The error may be one fo the following values:
1881 * NSS_ERROR_INVALID_CHOICE
1882 * NSS_ERROR_INVALID_ARGUMENT
1883 * NSS_ERROR_NO_MEMORY
1887 * A pointer to an NSSGeneralName upon success
1890 NSS_EXTERN NSSGeneralName
*
1891 NSSGeneralName_Create
1893 NSSGeneralNameChoice choice
,
1898 * NSSGeneralName_Destroy
1900 * This routine will destroy a General Name object. It should
1901 * eventually be called on all General Names created without an arena.
1902 * While it is not necessary to call it on General Names created within
1903 * an arena, it is not an error to do so. This routine returns a
1904 * PRStatus value; if successful, it will return PR_SUCCESS. If
1905 * usuccessful, it will create an error stack and return PR_FAILURE.
1907 * The error may be one of the following values:
1908 * NSS_ERROR_INVALID_GENERAL_NAME
1911 * PR_FAILURE upon failure
1912 * PR_SUCCESS upon success
1916 NSSGeneralName_Destroy
1918 NSSGeneralName
*generalName
1922 * NSSGeneralName_GetDEREncoding
1924 * This routine will DER-encode a name object. If the optional arena
1925 * argument is non-null, the memory used will be obtained from that
1926 * arena; otherwise, the memory will be obtained from the heap. This
1927 * routine may return null upon error, in which case it will have
1928 * created an error stack.
1930 * The error may be one of the following values:
1931 * NSS_ERROR_INVALID_GENERAL_NAME
1932 * NSS_ERROR_NO_MEMORY
1936 * The DER encoding of this NSSGeneralName
1940 NSSGeneralName_GetDEREncoding
1942 NSSGeneralName
*generalName
,
1947 * NSSGeneralName_GetUTF8Encoding
1949 * This routine returns a UTF8 string containing a string
1950 * representation of the General Name in the format specified by the
1951 * underlying name choice. If the optional arena argument is
1952 * non-null, the memory used will be obtained from that arena;
1953 * otherwise, the memory will be obtained from the heap. This routine
1954 * may return NULL upon error, in which case it will have created an
1957 * The error may be one of the following values:
1958 * NSS_ERROR_INVALID_GENERAL_NAME
1959 * NSS_ERROR_NO_MEMORY
1963 * A pointer to a UTF8 string
1966 NSS_EXTERN NSSUTF8
*
1967 NSSGeneralName_GetUTF8Encoding
1969 NSSGeneralName
*generalName
,
1974 * NSSGeneralName_GetChoice
1976 * This routine returns the type of choice underlying the specified
1977 * general name. The return value will be a member of the
1978 * NSSGeneralNameChoice enumeration. This routine may return
1979 * NSSGeneralNameChoiceInvalid upon error, in which case it will have
1980 * created an error stack.
1982 * The error may be one of the following values:
1983 * NSS_ERROR_INVALID_GENERAL_NAME
1986 * NSSGeneralNameChoiceInvalid upon error
1987 * An other member of the NSSGeneralNameChoice enumeration
1990 NSS_EXTERN NSSGeneralNameChoice
1991 NSSGeneralName_GetChoice
1993 NSSGeneralName
*generalName
1997 * NSSGeneralName_GetOtherName
1999 * If the choice underlying the specified NSSGeneralName is that of an
2000 * Other Name, this routine will return a pointer to that Other name.
2001 * Otherwise, this routine will place an error on the error stack, and
2002 * return NULL. If the optional arena argument is non-null, the memory
2003 * required will be obtained from that arena; otherwise, the memory
2004 * will be obtained from the heap. The caller owns the returned
2005 * pointer. This routine may return NULL upon error, in which case it
2006 * will have created an error stack.
2008 * The error may be one of the following values:
2009 * NSS_ERROR_INVALID_GENERAL_NAME
2010 * NSS_ERROR_WRONG_CHOICE
2011 * NSS_ERROR_NO_MEMORY
2015 * A caller-owned pointer to an NSSOtherName
2018 NSS_EXTERN NSSOtherName
*
2019 NSSGeneralName_GetOtherName
2021 NSSGeneralName
*generalName
,
2026 * NSSGeneralName_GetRfc822Name
2028 * If the choice underlying the specified NSSGeneralName is that of an
2029 * RFC 822 Name, this routine will return a pointer to that name.
2030 * Otherwise, this routine will place an error on the error stack, and
2031 * return NULL. If the optional arena argument is non-null, the memory
2032 * required will be obtained from that arena; otherwise, the memory
2033 * will be obtained from the heap. The caller owns the returned
2034 * pointer. This routine may return NULL upon error, in which case it
2035 * will have created an error stack.
2037 * The error may be one of the following values:
2038 * NSS_ERROR_INVALID_GENERAL_NAME
2039 * NSS_ERROR_WRONG_CHOICE
2040 * NSS_ERROR_NO_MEMORY
2044 * A caller-owned pointer to an NSSRFC822Name
2047 NSS_EXTERN NSSRFC822Name
*
2048 NSSGeneralName_GetRfc822Name
2050 NSSGeneralName
*generalName
,
2055 * NSSGeneralName_GetDNSName
2057 * If the choice underlying the specified NSSGeneralName is that of a
2058 * DNS Name, this routine will return a pointer to that DNS name.
2059 * Otherwise, this routine will place an error on the error stack, and
2060 * return NULL. If the optional arena argument is non-null, the memory
2061 * required will be obtained from that arena; otherwise, the memory
2062 * will be obtained from the heap. The caller owns the returned
2063 * pointer. This routine may return NULL upon error, in which case it
2064 * will have created an error stack.
2066 * The error may be one of the following values:
2067 * NSS_ERROR_INVALID_GENERAL_NAME
2068 * NSS_ERROR_WRONG_CHOICE
2069 * NSS_ERROR_NO_MEMORY
2073 * A caller-owned pointer to an NSSDNSName
2076 NSS_EXTERN NSSDNSName
*
2077 NSSGeneralName_GetDNSName
2079 NSSGeneralName
*generalName
,
2084 * NSSGeneralName_GetX400Address
2086 * If the choice underlying the specified NSSGeneralName is that of an
2087 * X.400 Address, this routine will return a pointer to that Address.
2088 * Otherwise, this routine will place an error on the error stack, and
2089 * return NULL. If the optional arena argument is non-null, the memory
2090 * required will be obtained from that arena; otherwise, the memory
2091 * will be obtained from the heap. The caller owns the returned
2092 * pointer. This routine may return NULL upon error, in which case it
2093 * will have created an error stack.
2095 * The error may be one of the following values:
2096 * NSS_ERROR_INVALID_GENERAL_NAME
2097 * NSS_ERROR_WRONG_CHOICE
2098 * NSS_ERROR_NO_MEMORY
2102 * A caller-owned pointer to an NSSX400Address
2105 NSS_EXTERN NSSX400Address
*
2106 NSSGeneralName_GetX400Address
2108 NSSGeneralName
*generalName
,
2113 * NSSGeneralName_GetDirectoryName
2115 * If the choice underlying the specified NSSGeneralName is that of a
2116 * (directory) Name, this routine will return a pointer to that name.
2117 * Otherwise, this routine will place an error on the error stack, and
2118 * return NULL. If the optional arena argument is non-null, the memory
2119 * required will be obtained from that arena; otherwise, the memory
2120 * will be obtained from the heap. The caller owns the returned
2121 * pointer. This routine may return NULL upon error, in which case it
2122 * will have created an error stack.
2124 * The error may be one of the following values:
2125 * NSS_ERROR_INVALID_GENERAL_NAME
2126 * NSS_ERROR_WRONG_CHOICE
2127 * NSS_ERROR_NO_MEMORY
2131 * A caller-owned pointer to an NSSName
2134 NSS_EXTERN NSSName
*
2135 NSSGeneralName_GetName
2137 NSSGeneralName
*generalName
,
2142 * NSSGeneralName_GetEdiPartyName
2144 * If the choice underlying the specified NSSGeneralName is that of an
2145 * EDI Party Name, this routine will return a pointer to that name.
2146 * Otherwise, this routine will place an error on the error stack, and
2147 * return NULL. If the optional arena argument is non-null, the memory
2148 * required will be obtained from that arena; otherwise, the memory
2149 * will be obtained from the heap. The caller owns the returned
2150 * pointer. This routine may return NULL upon error, in which case it
2151 * will have created an error stack.
2153 * The error may be one of the following values:
2154 * NSS_ERROR_INVALID_GENERAL_NAME
2155 * NSS_ERROR_WRONG_CHOICE
2156 * NSS_ERROR_NO_MEMORY
2160 * A caller-owned pointer to an NSSEdiPartyName
2163 NSS_EXTERN NSSEdiPartyName
*
2164 NSSGeneralName_GetEdiPartyName
2166 NSSGeneralName
*generalName
,
2171 * NSSGeneralName_GetUniformResourceIdentifier
2173 * If the choice underlying the specified NSSGeneralName is that of a
2174 * URI, this routine will return a pointer to that URI.
2175 * Otherwise, this routine will place an error on the error stack, and
2176 * return NULL. If the optional arena argument is non-null, the memory
2177 * required will be obtained from that arena; otherwise, the memory
2178 * will be obtained from the heap. The caller owns the returned
2179 * pointer. This routine may return NULL upon error, in which case it
2180 * will have created an error stack.
2182 * The error may be one of the following values:
2183 * NSS_ERROR_INVALID_GENERAL_NAME
2184 * NSS_ERROR_WRONG_CHOICE
2185 * NSS_ERROR_NO_MEMORY
2189 * A caller-owned pointer to an NSSURI
2193 NSSGeneralName_GetUniformResourceIdentifier
2195 NSSGeneralName
*generalName
,
2200 * NSSGeneralName_GetIPAddress
2202 * If the choice underlying the specified NSSGeneralName is that of an
2203 * IP Address , this routine will return a pointer to that address.
2204 * Otherwise, this routine will place an error on the error stack, and
2205 * return NULL. If the optional arena argument is non-null, the memory
2206 * required will be obtained from that arena; otherwise, the memory
2207 * will be obtained from the heap. The caller owns the returned
2208 * pointer. This routine may return NULL upon error, in which case it
2209 * will have created an error stack.
2211 * The error may be one of the following values:
2212 * NSS_ERROR_INVALID_GENERAL_NAME
2213 * NSS_ERROR_WRONG_CHOICE
2214 * NSS_ERROR_NO_MEMORY
2218 * A caller-owned pointer to an NSSIPAddress
2221 NSS_EXTERN NSSIPAddress
*
2222 NSSGeneralName_GetIPAddress
2224 NSSGeneralName
*generalName
,
2229 * NSSGeneralName_GetRegisteredID
2231 * If the choice underlying the specified NSSGeneralName is that of a
2232 * Registered ID, this routine will return a pointer to that ID.
2233 * Otherwise, this routine will place an error on the error stack, and
2234 * return NULL. If the optional arena argument is non-null, the memory
2235 * required will be obtained from that arena; otherwise, the memory
2236 * will be obtained from the heap. The caller owns the returned
2237 * pointer. This routine may return NULL upon error, in which case it
2238 * will have created an error stack.
2240 * The error may be one of the following values:
2241 * NSS_ERROR_INVALID_GENERAL_NAME
2242 * NSS_ERROR_WRONG_CHOICE
2243 * NSS_ERROR_NO_MEMORY
2247 * A caller-owned pointer to an NSSRegisteredID
2250 NSS_EXTERN NSSRegisteredID
*
2251 NSSGeneralName_GetRegisteredID
2253 NSSGeneralName
*generalName
,
2258 * NSSGeneralName_GetSpecifiedChoice
2260 * If the choice underlying the specified NSSGeneralName matches the
2261 * specified choice, a caller-owned pointer to that underlying object
2262 * will be returned. Otherwise, an error will be placed on the error
2263 * stack and NULL will be returned. If the optional arena argument
2264 * is non-null, the memory required will be obtained from that arena;
2265 * otherwise, the memory will be obtained from the heap. The caller
2266 * owns the returned pointer. This routine may return NULL upon
2267 * error, in which caes it will have created an error stack.
2269 * The error may be one of the following values:
2270 * NSS_ERROR_INVALID_GENERAL_NAME
2271 * NSS_ERROR_WRONG_CHOICE
2272 * NSS_ERROR_NO_MEMORY
2276 * A caller-owned pointer, which must be typecast
2280 NSSGeneralName_GetSpecifiedChoice
2282 NSSGeneralName
*generalName
,
2283 NSSGeneralNameChoice choice
,
2288 * NSSGeneralName_Compare
2290 * This routine compares two General Names for equality. For two
2291 * General Names to be equal, they must have the same choice of
2292 * underlying types, and the underlying values must be equal. The
2293 * result of the comparison will be stored at the location pointed
2294 * to by the "equalp" variable, which must point to a valid PRBool.
2295 * This routine may return PR_FAILURE upon error, in which case it
2296 * will have created an error stack.
2298 * The error may be one of the following value:
2299 * NSS_ERROR_INVALID_GENERAL_NAME
2300 * NSS_ERROR_INVALID_ARGUMENT
2303 * PR_FAILURE upon error
2304 * PR_SUCCESS upon a successful comparison (equal or not)
2308 NSSGeneralName_Compare
2310 NSSGeneralName
*generalName1
,
2311 NSSGeneralName
*generalName2
,
2316 * NSSGeneralName_Duplicate
2318 * This routine duplicates the specified General Name. If the optional
2319 * arena argument is non-null, the memory required will be obtained
2320 * from that arena; otherwise, the memory will be obtained from the
2321 * heap. This routine may return NULL upon error, in which case it
2322 * will have created an error stack.
2324 * The error may be one of the following values:
2325 * NSS_ERROR_INVALID_GENERAL_NAME
2326 * NSS_ERROR_NO_MEMORY
2330 * A pointer to a new NSSGeneralName
2333 NSS_EXTERN NSSGeneralName
*
2334 NSSGeneralName_Duplicate
2336 NSSGeneralName
*generalName
,
2341 * NSSGeneralName_GetUID
2343 * This routine will attempt to derive a user identifier from the
2344 * specified general name, if the choices and content of the name
2345 * permit. If the General Name is a (directory) Name consisting
2346 * of a Sequence of Relative Distinguished Names containing a UID
2347 * attribute, the UID will be the value of that attribute. Note
2348 * that no UID attribute is defined in either PKIX or PKCS#9;
2349 * rather, this seems to derive from RFC 1274, which defines the
2350 * type as a caseIgnoreString. We'll return a Directory String.
2351 * If the optional arena argument is non-null, the memory used
2352 * will be obtained from that arena; otherwise, the memory will be
2353 * obtained from the heap. This routine may return NULL upon error,
2354 * in which case it will have created an error stack.
2356 * The error may be one of the following values:
2357 * NSS_ERROR_INVALID_GENERAL_NAME
2359 * NSS_ERROR_NO_MEMORY
2363 * A pointer to a UTF8 String.
2366 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2367 NSSGeneralName_GetUID
2369 NSSGeneralName
*generalName
,
2374 * NSSGeneralName_GetEmail
2376 * This routine will attempt to derive an email address from the
2377 * specified general name, if the choices and content of the name
2378 * permit. If the General Name is a (directory) Name consisting
2379 * of a Sequence of Relative Distinguished names containing either
2380 * a PKIX email address or a PKCS#9 email address, the result will
2381 * be the value of that attribute. If the General Name is an RFC 822
2382 * Name, the result will be the string form of that name. If the
2383 * optional arena argument is non-null, the memory used will be
2384 * obtained from that arena; otherwise, the memory will be obtained
2385 * from the heap. This routine may return NULL upon error, in which
2386 * case it will have created an error stack.
2388 * The error may be one of the following values:
2389 * NSS_ERROR_INVALID_GENERAL_NAME
2390 * NSS_ERROR_NO_EMAIL
2391 * NSS_ERROR_NO_MEMORY
2395 * A pointer to a UTF8 String
2398 NSS_EXTERN NSSUTF8
* /* XXX fgmr IA5String */
2399 NSSGeneralName_GetEmail
2401 NSSGeneralName
*generalName
,
2406 * NSSGeneralName_GetCommonName
2408 * This routine will attempt to derive a common name from the
2409 * specified general name, if the choices and content of the name
2410 * permit. If the General Name is a (directory) Name consisting
2411 * of a Sequence of Relative Distinguished names containing a PKIX
2412 * Common Name, the result will be that name. If the optional arena
2413 * argument is non-null, the memory used will be obtained from that
2414 * arena; otherwise, the memory will be obtained from the heap. This
2415 * routine may return NULL upon error, in which case it will have
2416 * created an error stack.
2418 * The error may be one of the following values:
2419 * NSS_ERROR_INVALID_GENERAL_NAME
2420 * NSS_ERROR_NO_COMMON_NAME
2421 * NSS_ERROR_NO_MEMORY
2425 * A pointer to a UTF8 String
2428 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2429 NSSGeneralName_GetCommonName
2431 NSSGeneralName
*generalName
,
2436 * NSSGeneralName_GetOrganization
2438 * This routine will attempt to derive an organisation name from the
2439 * specified general name, if the choices and content of the name
2440 * permit. If the General Name is a (directory) Name consisting
2441 * of a Sequence of Relative Distinguished names containing an
2442 * Organization, the result will be the value of that attribute.
2443 * If the optional arena argument is non-null, the memory used will
2444 * be obtained from that arena; otherwise, the memory will be obtained
2445 * from the heap. This routine may return NULL upon error, in which
2446 * case it will have created an error stack.
2448 * The error may be one of the following values:
2449 * NSS_ERROR_INVALID_GENERAL_NAME
2450 * NSS_ERROR_NO_ORGANIZATION
2451 * NSS_ERROR_NO_MEMORY
2455 * A pointer to a UTF8 String
2458 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2459 NSSGeneralName_GetOrganization
2461 NSSGeneralName
*generalName
,
2466 * NSSGeneralName_GetOrganizationalUnits
2468 * This routine will attempt to derive a sequence of organisational
2469 * unit names from the specified general name, if the choices and
2470 * content of the name permit. If the General Name is a (directory)
2471 * Name consisting of a Sequence of Relative Distinguished names
2472 * containing one or more organisational units, the result will
2473 * consist of those units. If the optional arena argument is non-
2474 * null, the memory used will be obtained from that arena; otherwise,
2475 * the memory will be obtained from the heap. This routine may return
2476 * NULL upon error, in which case it will have created an error stack.
2478 * The error may be one of the following values:
2479 * NSS_ERROR_INVALID_GENERAL_NAME
2480 * NSS_ERROR_NO_ORGANIZATIONAL_UNITS
2481 * NSS_ERROR_NO_MEMORY
2485 * A pointer to a null-terminated array of UTF8 Strings
2488 NSS_EXTERN NSSUTF8
** /* XXX fgmr DirectoryString */
2489 NSSGeneralName_GetOrganizationalUnits
2491 NSSGeneralName
*generalName
,
2496 * NSSGeneralName_GetStateOrProvince
2498 * This routine will attempt to derive a state or province name from
2499 * the specified general name, if the choices and content of the name
2500 * permit. If the General Name is a (directory) Name consisting
2501 * of a Sequence of Relative Distinguished names containing a state or
2502 * province, the result will be the value of that attribute. If the
2503 * optional arena argument is non-null, the memory used will be
2504 * obtained from that arena; otherwise, the memory will be obtained
2505 * from the heap. This routine may return NULL upon error, in which
2506 * case it will have created an error stack.
2508 * The error may be one of the following values:
2509 * NSS_ERROR_INVALID_GENERAL_NAME
2510 * NSS_ERROR_NO_STATE_OR_PROVINCE
2511 * NSS_ERROR_NO_MEMORY
2515 * A pointer to a UTF8 String
2518 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2519 NSSGeneralName_GetStateOrProvince
2521 NSSGeneralName
*generalName
,
2526 * NSSGeneralName_GetLocality
2528 * This routine will attempt to derive a locality name from
2529 * the specified general name, if the choices and content of the name
2530 * permit. If the General Name is a (directory) Name consisting
2531 * of a Sequence of Relative Distinguished names containing a Locality,
2532 * the result will be the value of that attribute. If the optional
2533 * arena argument is non-null, the memory used will be obtained from
2534 * that arena; otherwise, the memory will be obtained from the heap.
2535 * This routine may return NULL upon error, in which case it will have
2536 * created an error stack.
2538 * The error may be one of the following values:
2539 * NSS_ERROR_INVALID_GENERAL_NAME
2540 * NSS_ERROR_NO_LOCALITY
2541 * NSS_ERROR_NO_MEMORY
2545 * A pointer to a UTF8 String
2548 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2549 NSSGeneralName_GetLocality
2551 NSSGeneralName
*generalName
,
2556 * NSSGeneralName_GetCountry
2558 * This routine will attempt to derive a country name from the
2559 * specified general name, if the choices and content of the name
2560 * permit. If the General Name is a (directory) Name consisting of a
2561 * Sequence of Relative Distinguished names containing a Country, the
2562 * result will be the value of that attribute. If the optional
2563 * arena argument is non-null, the memory used will be obtained from
2564 * that arena; otherwise, the memory will be obtained from the heap.
2565 * This routine may return NULL upon error, in which case it will have
2566 * created an error stack.
2568 * The error may be one of the following values:
2569 * NSS_ERROR_INVALID_GENERAL_NAME
2570 * NSS_ERROR_NO_COUNTRY
2571 * NSS_ERROR_NO_MEMORY
2575 * A pointer to a UTF8 String
2578 NSS_EXTERN NSSUTF8
* /* XXX fgmr PrintableString */
2579 NSSGeneralName_GetCountry
2581 NSSGeneralName
*generalName
,
2586 * NSSGeneralName_GetAttribute
2588 * If the specified general name is a (directory) name consisting
2589 * of a Sequence of Relative Distinguished Names containing an
2590 * attribute with the specified type, and the actual value of that
2591 * attribute may be expressed with a Directory String, then the
2592 * value of that attribute will be returned as a Directory String.
2593 * If the optional arena argument is non-null, the memory used will
2594 * be obtained from that arena; otherwise, the memory will be obtained
2595 * from the heap. This routine may return NULL upon error, in which
2596 * case it will have created an error stack.
2598 * The error may be one of the following values:
2599 * NSS_ERROR_INVALID_GENERAL_NAME
2600 * NSS_ERROR_NO_ATTRIBUTE
2601 * NSS_ERROR_ATTRIBUTE_VALUE_NOT_STRING
2605 * A pointer to a UTF8 String
2608 NSS_EXTERN NSSUTF8
* /* XXX fgmr DirectoryString */
2609 NSSGeneralName_GetAttribute
2611 NSSGeneralName
*generalName
,
2619 * The public "methods" regarding this "object" are:
2621 * NSSGeneralNameSeq_CreateFromBER -- constructor
2622 * NSSGeneralNameSeq_Create -- constructor
2624 * NSSGeneralNameSeq_Destroy
2625 * NSSGeneralNameSeq_GetDEREncoding
2626 * NSSGeneralNameSeq_AppendGeneralName
2627 * NSSGeneralNameSeq_GetGeneralNameCount
2628 * NSSGeneralNameSeq_GetGeneralName
2629 * NSSGeneralNameSeq_Compare
2630 * NSSGeneralnameSeq_Duplicate
2634 * NSSGeneralNameSeq_CreateFromBER
2636 * This routine creates a general name sequence by decoding a BER-
2637 * or DER-encoded GeneralNames. If the optional arena argument is
2638 * non-null, the memory used will be obtained from that arena;
2639 * otherwise, the memory will be obtained from the heap. This routine
2640 * may return NULL upon error, in which case it will have created an
2643 * The error may be one of the following values:
2644 * NSS_ERROR_INVALID_BER
2645 * NSS_ERROR_NO_MEMORY
2649 * A pointer to an NSSGeneralNameSeq upon success
2652 NSS_EXTERN NSSGeneralNameSeq
*
2653 NSSGeneralNameSeq_CreateFromBER
2656 NSSBER
*berGeneralNameSeq
2660 * NSSGeneralNameSeq_Create
2662 * This routine creates an NSSGeneralNameSeq from one or more General
2663 * Names. The final argument to this routine must be NULL. If the
2664 * optional arena argument is non-null, the memory used will be
2665 * obtained from that arena; otherwise, the memory will be obtained
2666 * from the heap. This routine may return NULL upon error, in which
2667 * case it will have created an error stack.
2669 * The error may be one of the following values:
2670 * NSS_ERROR_NO_MEMORY
2671 * NSS_ERROR_INVALID_GENERAL_NAME
2675 * A pointer to an NSSGeneralNameSeq upon success
2678 NSS_EXTERN NSSGeneralNameSeq
*
2679 NSSGeneralNameSeq_Create
2682 NSSGeneralName
*generalName1
,
2687 * NSSGeneralNameSeq_Destroy
2689 * This routine will destroy an NSSGeneralNameSeq object. It should
2690 * eventually be called on all NSSGeneralNameSeqs created without an
2691 * arena. While it is not necessary to call it on NSSGeneralNameSeq's
2692 * created within an arena, it is not an error to do so. This routine
2693 * returns a PRStatus value; if successful, it will return PR_SUCCESS.
2694 * If unsuccessful, it will create an error stack and return PR_FAILURE.
2696 * The error may be one of the following values:
2697 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2700 * PR_FAILURE upon error
2701 * PR_SUCCESS upon success
2705 NSSGeneralNameSeq_Destroy
2707 NSSGeneralNameSeq
*generalNameSeq
2711 * NSSGeneralNameSeq_GetDEREncoding
2713 * This routine will DER-encode an NSSGeneralNameSeq object. If the
2714 * optional arena argument is non-null, the memory used will be
2715 * obtained from that arena; otherwise, the memory will be obtained
2716 * from the heap. This routine may return null upon error, in which
2717 * case it will have created an error stack.
2719 * The error may be one of the following values:
2720 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2721 * NSS_ERROR_NO_MEMORY
2725 * The DER encoding of this NSSGeneralNameSeq
2729 NSSGeneralNameSeq_GetDEREncoding
2731 NSSGeneralNameSeq
*generalNameSeq
,
2736 * NSSGeneralNameSeq_AppendGeneralName
2738 * This routine appends a General Name to the end of the existing
2739 * General Name Sequence. If the sequence was created with a non-null
2740 * arena argument, that same arena will be used for any additional
2741 * required memory. If the sequence was created with a NULL arena
2742 * argument, any additional memory will be obtained from the heap.
2743 * This routine returns a PRStatus value; it will return PR_SUCCESS
2744 * upon success, and upon failure it will create an error stack and
2745 * return PR_FAILURE.
2747 * The error may be one of the following values:
2748 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2749 * NSS_ERROR_INVALID_GENERAL_NAME
2750 * NSS_ERROR_NO_MEMORY
2753 * PR_SUCCESS upon success
2754 * PR_FAILURE upon failure.
2758 NSSGeneralNameSeq_AppendGeneralName
2760 NSSGeneralNameSeq
*generalNameSeq
,
2761 NSSGeneralName
*generalName
2765 * NSSGeneralNameSeq_GetGeneralNameCount
2767 * This routine returns the cardinality of the specified General name
2768 * Sequence. This routine may return 0 upon error, in which case it
2769 * will have created an error stack.
2771 * The error may be one of the following values:
2772 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2776 * A positive number upon success
2780 NSSGeneralNameSeq_GetGeneralNameCount
2782 NSSGeneralNameSeq
*generalNameSeq
2786 * NSSGeneralNameSeq_GetGeneralName
2788 * This routine returns a pointer to the i'th General Name in the
2789 * specified General Name Sequence. The value of the variable 'i' is
2790 * on the range [0,c) where c is the cardinality returned from
2791 * NSSGeneralNameSeq_GetGeneralNameCount. The caller owns the General
2792 * Name the pointer to which is returned. If the optional arena
2793 * argument is non-null, the memory used will be obtained from that
2794 * arena; otherwise, the memory will be obtained from the heap. This
2795 * routine may return NULL upon error, in which case it will have
2796 * created an error stack.
2798 * The error may be one of the following values:
2799 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2800 * NSS_ERROR_VALUE_OUT_OF_RANGE
2801 * NSS_ERROR_NO_MEMORY
2805 * A caller-owned pointer to a General Name.
2808 NSS_EXTERN NSSGeneralName
*
2809 NSSGeneralNameSeq_GetGeneralName
2811 NSSGeneralNameSeq
*generalNameSeq
,
2817 * NSSGeneralNameSeq_Compare
2819 * This routine compares two General Name Sequences for equality. For
2820 * two General Name Sequences to be equal, they must have the same
2821 * cardinality, and each General Name in one sequence must be equal to
2822 * the corresponding General Name in the other. The result of the
2823 * comparison will be stored at the location pointed to by the "equalp"
2824 * variable, which must point to a valid PRBool. This routine may
2825 * return PR_FAILURE upon error, in which case it will have created an
2828 * The error may be one of the following values:
2829 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2830 * NSS_ERROR_INVALID_ARGUMENT
2833 * PR_FAILURE upon error
2834 * PR_SUCCESS upon a successful comparison (equal or not)
2838 NSSGeneralNameSeq_Compare
2840 NSSGeneralNameSeq
*generalNameSeq1
,
2841 NSSGeneralNameSeq
*generalNameSeq2
,
2846 * NSSGeneralNameSeq_Duplicate
2848 * This routine duplicates the specified sequence of general names. If
2849 * the optional arena argument is non-null, the memory required will be
2850 * obtained from that arena; otherwise, the memory will be obtained
2851 * from the heap. This routine may return NULL upon error, in which
2852 * case it will have created an error stack.
2854 * The error may be one of the following values:
2855 * NSS_ERROR_INVALID_GENERAL_NAME_SEQ
2856 * NSS_ERROR_NO_MEMORY
2860 * A pointer to a new General Name Sequence.
2863 NSS_EXTERN NSSGeneralNameSeq
*
2864 NSSGeneralNameSeq_Duplicate
2866 NSSGeneralNameSeq
*generalNameSeq
,
2872 #endif /* NSSPT1M_H */