pkix.h
上传用户:lyxiangda
上传日期:2007-01-12
资源大小:3042k
文件大小:553k
- /*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is the Netscape security libraries.
- *
- * The Initial Developer of the Original Code is Netscape
- * Communications Corporation. Portions created by Netscape are
- * Copyright (C) 1994-2000 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the
- * terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
- * version of this file only under the terms of the GPL and not to
- * allow others to use your version of this file under the MPL,
- * indicate your decision by deleting the provisions above and
- * replace them with the notice and other provisions required by
- * the GPL. If you do not delete the provisions above, a recipient
- * may use your version of this file under either the MPL or the
- * GPL.
- */
- #ifndef PKIX_H
- #define PKIX_H
- #ifdef DEBUG
- static const char PKIX_CVS_ID[] = "@(#) $Source: /cvsroot/mozilla/security/nss/lib/pkix/include/pkix.h,v $ $Revision: 1.1 $ $Date: 2000/03/31 19:02:56 $ $Name: NSS_3_1_1_RTM $";
- #endif /* DEBUG */
- /*
- * pkix.h
- *
- * This file contains the prototypes for the private methods defined
- * for the PKIX part-1 objects.
- */
- #ifndef NSSPKIX_H
- #include "nsspkix.h"
- #endif /* NSSPKIX_H */
- #ifndef PKIXT_H
- #include "pkixt.h"
- #endif /* PKIXT_H */
- #ifndef ASN1T_H
- #include "asn1t.h"
- #endif /* ASN1T_H */
- PR_BEGIN_EXTERN_C
- /*
- * Attribute
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * Attribute ::= SEQUENCE {
- * type AttributeType,
- * values SET OF AttributeValue
- * -- at least one value is required -- }
- *
- * The private calls for the type:
- *
- * nssPKIXAttribute_Decode
- * nssPKIXAttribute_Create
- * nssPKIXAttribute_CreateFromArray
- * nssPKIXAttribute_Destroy
- * nssPKIXAttribute_Encode
- * nssPKIXAttribute_GetType
- * nssPKIXAttribute_SetType
- * nssPKIXAttribute_GetValueCount
- * nssPKIXAttribute_GetValues
- * nssPKIXAttribute_SetValues
- * nssPKIXAttribute_GetValue
- * nssPKIXAttribute_SetValue
- * nssPKIXAttribute_AddValue
- * nssPKIXAttribute_RemoveValue
- * nssPKIXAttribute_FindValue
- * nssPKIXAttribute_Equal
- * nssPKIXAttribute_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXAttribute_verifyPointer
- */
- /*
- * nssPKIXAttribute_template
- *
- *
- */
- extern const nssASN1Template nssPKIXAttribute_template[];
- /*
- * nssPKIXAttribute_Decode
- *
- * This routine creates an NSSPKIXAttribute by decoding a BER-
- * or DER-encoded Attribute as defined in RFC 2459. This
- * routine may return NULL upon error, in which case it will
- * have created an error stack. If the optional arena argument
- * is non-NULL, that arena will be used for the required memory.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttribute upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttribute *
- nssPKIXAttribute_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXAttribute_Create
- *
- * This routine creates an NSSPKIXAttribute from specified components.
- * This routine may return NULL upon error, in which case it will have
- * created an error stack. If the optional arena argument is non-NULL,
- * that arena will be used for the required memory. There must be at
- * least one attribute value specified. The final argument must be
- * NULL, to indicate the end of the set of attribute values.
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_OID
- * NSS_ERROR_INVALID_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttribute upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttribute *
- nssPKIXAttribute_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXAttributeType *typeOid,
- NSSPKIXAttributeValue *value1,
- ...
- );
- /*
- * nssPKIXAttribute_CreateFromArray
- *
- * This routine creates an NSSPKIXAttribute from specified components.
- * This routine may return NULL upon error, in which case it will have
- * created an error stack. If the optional arena argument is non-NULL,
- * that arena will be used for the required memory. There must be at
- * least one attribute value specified. The final argument must be
- * NULL, to indicate the end of the set of attribute values.
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_OID
- * NSS_ERROR_INVALID_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttribute upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttribute *
- nssPKIXAttribute_CreateFromArray
- (
- NSSArena *arenaOpt,
- NSSPKIXAttributeType *typeOid,
- PRUint32 count,
- NSSPKIXAttributeValue values[]
- );
- /*
- * nssPKIXAttribute_Destroy
- *
- * This routine destroys an NSSPKIXAttribute. It should be called on
- * all such objects created without an arena. It does not need to be
- * called for objects created with an arena, but it may be. This
- * routine returns a PRStatus value. Upon error, it will create an
- * error stack and return PR_FAILURE.
- *
- * The error value may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_Destroy
- (
- NSSPKIXAttribute *attribute
- );
- /*
- * nssPKIXAttribute_Encode
- *
- * This routine returns the BER encoding of the specified
- * NSSPKIXAttribute. {usual rules about itemOpt and arenaOpt}
- * This routine indicates an error (NSS_ERROR_INVALID_DATA)
- * if there are no attribute values (i.e., the last one was removed).
- *
- * The error value may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_DATA
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXAttribute_Encode
- (
- NSSPKIXAttribute *attribute,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttribute_GetType
- *
- * This routine returns the attribute type oid of the specified
- * NSSPKIXAttribute.
- *
- * The error value may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSPKIXAttributeType pointer upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttributeType *
- nssPKIXAttribute_GetType
- (
- NSSPKIXAttribute *attribute
- );
- /*
- * nssPKIXAttribute_SetType
- *
- * This routine sets the attribute type oid of the indicated
- * NSSPKIXAttribute to the specified value. Since attributes
- * may be application-defined, no checking can be done on
- * either the correctness of the attribute type oid value nor
- * the suitability of the set of attribute values.
- *
- * The error value may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_OID
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_SetType
- (
- NSSPKIXAttribute *attribute,
- NSSPKIXAttributeType *attributeType
- );
- /*
- * nssPKIXAttribute_GetValueCount
- *
- * This routine returns the number of attribute values present in
- * the specified NSSPKIXAttribute. This routine returns a PRInt32.
- * Upon error, this routine returns -1. This routine indicates an
- * error if the number of values cannot be expressed as a PRInt32.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * Nonnegative integer upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXAttribute_GetValueCount
- (
- NSSPKIXAttribute *attribute
- );
- /*
- * nssPKIXAttribute_GetValues
- *
- * This routine returns all of the attribute values in the specified
- * NSSPKIXAttribute. If the optional pointer to an array of NSSItems
- * is non-null, then that array will be used and returned; otherwise,
- * an array will be allocated and returned. If the limit is nonzero
- * (which is must be if the specified array is nonnull), then an
- * error is indicated if it is smaller than the value count.
- * {arenaOpt}
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_ARRAY_TOO_SMALL
- *
- * Return value:
- * A valid pointer to an array of NSSItem's upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttributeValue *
- nssPKIXAttribute_GetValues
- (
- NSSPKIXAttribute *attribute,
- NSSPKIXAttributeValue rvOpt[],
- PRInt32 limit,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttribute_SetValues
- *
- * This routine sets all of the values of the specified
- * NSSPKIXAttribute to the values in the specified NSSItem array.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_POINTER
- * NSS_ERROR_ARRAY_TOO_SMALL
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_SetValues
- (
- NSSPKIXAttribute *attribute,
- NSSPKIXAttributeValue values[],
- PRInt32 count
- );
- /*
- * nssPKIXAttribute_GetValue
- *
- * This routine returns the i'th attribute value of the set of
- * values in the specified NSSPKIXAttribute. Although the set
- * is unordered, an arbitrary ordering will be maintained until
- * the data in the attribute is changed. {usual comments about
- * itemOpt and arenaOpt}
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeValue *
- nssPKIXAttribute_GetValue
- (
- NSSPKIXAttribute *attribute,
- PRInt32 i,
- NSSPKIXAttributeValue *itemOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttribute_SetValue
- *
- * This routine sets the i'th attribute value {blah blah; copies
- * memory contents over..}
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_SetValue
- (
- NSSPKIXAttribute *attribute,
- PRInt32 i,
- NSSPKIXAttributeValue *value
- );
- /*
- * nssPKIXAttribute_AddValue
- *
- * This routine adds the specified attribute value to the set in
- * the specified NSSPKIXAttribute.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_AddValue
- (
- NSSPKIXAttribute *attribute,
- NSSPKIXAttributeValue *value
- );
- /*
- * nssPKIXAttribute_RemoveValue
- *
- * This routine removes the i'th attribute value of the set in the
- * specified NSSPKIXAttribute. An attempt to remove the last value
- * will fail.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_AT_MINIMUM
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_RemoveValue
- (
- NSSPKIXAttribute *attribute,
- PRInt32 i
- );
- /*
- * nssPKIXAttribute_FindValue
- *
- * This routine searches the set of attribute values in the specified
- * NSSPKIXAttribute for the provided data. If an exact match is found,
- * then that value's index is returned. If an exact match is not
- * found, -1 is returned. If there is more than one exact match, one
- * index will be returned. {notes about unorderdness of SET, etc}
- * If the index may not be represented as an integer, an error is
- * indicated.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NOT_FOUND
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value
- * The index of the specified attribute value upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXAttribute_FindValue
- (
- NSSPKIXAttribute *attribute,
- NSSPKIXAttributeValue *attributeValue
- );
- /*
- * nssPKIXAttribute_Equal
- *
- * This routine compares two NSSPKIXAttribute's for equality.
- * It returns PR_TRUE if they are equal, PR_FALSE otherwise.
- * This routine also returns PR_FALSE upon error; if you're
- * that worried about it, check for an error stack.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXAttribute_Equal
- (
- NSSPKIXAttribute *one,
- NSSPKIXAttribute *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXAttribute_Duplicate
- *
- * This routine duplicates an NSSPKIXAttribute. {arenaOpt}
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttribute upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXAttribute *
- nssPKIXAttribute_Duplicate
- (
- NSSPKIXAttribute *attribute,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXAttribute_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXAttribute
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXAttribute_verifyPointer
- (
- NSSPKIXAttribute *p
- );
- #endif /* DEBUG */
- /*
- * AttributeTypeAndValue
- *
- * This structure contains an attribute type (indicated by an OID),
- * and the type-specific value. RelativeDistinguishedNames consist
- * of a set of these. These are distinct from Attributes (which have
- * SET of values), from AttributeDescriptions (which have qualifiers
- * on the types), and from AttributeValueAssertions (which assert a
- * a value comparison under some matching rule).
- *
- * From RFC 2459:
- *
- * AttributeTypeAndValue ::= SEQUENCE {
- * type AttributeType,
- * value AttributeValue }
- *
- * The private calls for the type:
- *
- * nssPKIXAttributeTypeAndValue_Decode
- * nssPKIXAttributeTypeAndValue_CreateFromUTF8
- * nssPKIXAttributeTypeAndValue_Create
- * nssPKIXAttributeTypeAndValue_Destroy
- * nssPKIXAttributeTypeAndValue_Encode
- * nssPKIXAttributeTypeAndValue_GetUTF8Encoding
- * nssPKIXAttributeTypeAndValue_GetType
- * nssPKIXAttributeTypeAndValue_SetType
- * nssPKIXAttributeTypeAndValue_GetValue
- * nssPKIXAttributeTypeAndValue_SetValue
- * nssPKIXAttributeTypeAndValue_Equal
- * nssPKIXAttributeTypeAndValue_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXAttributeTypeAndValue_verifyPointer
- */
- /*
- * nssPKIXAttributeTypeAndValue_Decode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue *
- nssPKIXAttributeTypeAndValue_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXAttributeTypeAndValue_CreateFromUTF8
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_STRING
- * NSS_ERROR_UNKNOWN_ATTRIBUTE
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue *
- nssPKIXAttributeTypeAndValue_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *string
- );
- /*
- * nssPKIXAttributeTypeAndValue_Create
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_OID
- * NSS_ERROR_INVALID_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue *
- nssPKIXAttributeTypeAndValue_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXAttributeType *typeOid,
- NSSPKIXAttributeValue *value
- );
- /*
- * nssPKIXAttributeTypeAndValue_Destroy
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttributeTypeAndValue_Destroy
- (
- NSSPKIXAttributeTypeAndValue *atav
- );
- /*
- * nssPKIXAttributeTypeAndValue_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXAttributeTypeAndValue_Encode
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttributeTypeAndValue_GetUTF8Encoding
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSUTF8 pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXAttributeTypeAndValue_GetUTF8Encoding
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttributeTypeAndValue_GetType
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSPKIXAttributeType pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeType *
- nssPKIXAttributeTypeAndValue_GetType
- (
- NSSPKIXAttributeTypeAndValue *atav
- );
- /*
- * nssPKIXAttributeTypeAndValue_SetType
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_INVALID_OID
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttributeTypeAndValue_SetType
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSPKIXAttributeType *attributeType
- );
- /*
- * nssPKIXAttributeTypeAndValue_GetValue
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSAttributeValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeValue *
- nssPKIXAttributeTypeAndValue_GetValue
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSPKIXAttributeValue *itemOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXAttributeTypeAndValue_SetValue
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXAttributeTypeAndValue_SetValue
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSPKIXAttributeValue *value
- );
- /*
- * nssPKIXAttributeTypeAndValue_Equal
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXAttributeTypeAndValue_Equal
- (
- NSSPKIXAttributeTypeAndValue *atav1,
- NSSPKIXAttributeTypeAndValue *atav2,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXAttributeTypeAndValue_Duplicate
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue *
- nssPKIXAttributeTypeAndValue_Duplicate
- (
- NSSPKIXAttributeTypeAndValue *atav,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXAttributeTypeAndValue_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXAttributeTypeAndValue
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_ATTRIBUTE_TYPE_AND_VALUE
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXAttributeTypeAndValue_verifyPointer
- (
- NSSPKIXAttributeTypeAndValue *p
- );
- #endif /* DEBUG */
- /*
- * X520Name
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520name ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-name)),
- * printableString PrintableString (SIZE (1..ub-name)),
- * universalString UniversalString (SIZE (1..ub-name)),
- * utf8String UTF8String (SIZE (1..ub-name)),
- * bmpString BMPString (SIZE(1..ub-name)) }
- *
- *
- * ub-name INTEGER ::= 32768
- *
- * The private calls for this type:
- *
- * nssPKIXX520Name_Decode
- * nssPKIXX520Name_CreateFromUTF8
- * nssPKIXX520Name_Create
- * nssPKIXX520Name_Destroy
- * nssPKIXX520Name_Encode
- * nssPKIXX520Name_GetUTF8Encoding
- * nssPKIXX520Name_Equal
- * nssPKIXX520Name_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXX520Name_verifyPointer
- */
- /*
- * nssPKIXX520Name_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Name upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Name *
- nssPKIXX520Name_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520Name_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Name upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Name *
- nssPKIXX520Name_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520Name_Create
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_STRING_TYPE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Name upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Name *
- nssPKIXX520Name_Create
- (
- NSSArena *arenaOpt,
- nssStringType type,
- NSSItem *data
- );
- /*
- * nssPKIXX520Name_Destroy
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520Name_Destroy
- (
- NSSPKIXX520Name *name
- );
- /*
- * nssPKIXX520Name_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520Name_Encode
- (
- NSSPKIXX520Name *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXX520Name_GetUTF8Encoding
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXX520Name_GetUTF8Encoding
- (
- NSSPKIXX520Name *name,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXX520Name_Equal
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXX520Name_Equal
- (
- NSSPKIXX520Name *name1,
- NSSPKIXX520Name *name2,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXX520Name_Duplicate
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Name upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Name *
- nssPKIXX520Name_Duplicate
- (
- NSSPKIXX520Name *name,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXX520Name_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXX520Name
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_X520_NAME
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXX520Name_verifyPointer
- (
- NSSPKIXX520Name *p
- );
- #endif /* DEBUG */
- /*
- * X520CommonName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520CommonName ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-common-name)),
- * printableString PrintableString (SIZE (1..ub-common-name)),
- * universalString UniversalString (SIZE (1..ub-common-name)),
- * utf8String UTF8String (SIZE (1..ub-common-name)),
- * bmpString BMPString (SIZE(1..ub-common-name)) }
- *
- *
- * ub-common-name INTEGER ::= 64
- *
- * The private calls for this type:
- *
- *
- * nssPKIXX520CommonName_Decode
- * nssPKIXX520CommonName_CreateFromUTF8
- * nssPKIXX520CommonName_Create
- * nssPKIXX520CommonName_Destroy
- * nssPKIXX520CommonName_Encode
- * nssPKIXX520CommonName_GetUTF8Encoding
- * nssPKIXX520CommonName_Equal
- * nssPKIXX520CommonName_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXX520CommonName_verifyPointer
- */
- /*
- * nssPKIXX520CommonName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520CommonName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520CommonName *
- nssPKIXX520CommonName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520CommonName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520CommonName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520CommonName *
- nssPKIXX520CommonName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520CommonName_Create
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_STRING_TYPE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520CommonName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520CommonName *
- nssPKIXX520CommonName_Create
- (
- NSSArena *arenaOpt,
- nssStringType type,
- NSSItem *data
- );
- /*
- * nssPKIXX520CommonName_Destroy
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520CommonName_Destroy
- (
- NSSPKIXX520CommonName *name
- );
- /*
- * nssPKIXX520CommonName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520CommonName_Encode
- (
- NSSPKIXX520CommonName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXX520CommonName_GetUTF8Encoding
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXX520CommonName_GetUTF8Encoding
- (
- NSSPKIXX520CommonName *name,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXX520CommonName_Equal
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXX520CommonName_Equal
- (
- NSSPKIXX520CommonName *name1,
- NSSPKIXX520CommonName *name2,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXX520CommonName_Duplicate
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520CommonName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520CommonName *
- nssPKIXX520CommonName_Duplicate
- (
- NSSPKIXX520CommonName *name,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXX520CommonName_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXX520CommonName
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_X520_NAME
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXX520CommonName_verifyPointer
- (
- NSSPKIXX520CommonName *p
- );
- #endif /* DEBUG */
- /*
- * X520LocalityName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520LocalityName ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-locality-name)),
- * printableString PrintableString (SIZE (1..ub-locality-name)),
- * universalString UniversalString (SIZE (1..ub-locality-name)),
- * utf8String UTF8String (SIZE (1..ub-locality-name)),
- * bmpString BMPString (SIZE(1..ub-locality-name)) }
- *
- * The private calls for this type:
- *
- * nssPKIXX520LocalityName_Decode
- * nssPKIXX520LocalityName_CreateFromUTF8
- * nssPKIXX520LocalityName_Encode
- *
- */
- /*
- * nssPKIXX520LocalityName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520LocalityName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520LocalityName *
- nssPKIXX520LocalityName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520LocalityName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520LocalityName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520LocalityName *
- nssPKIXX520LocalityName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520LocalityName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520LocalityName_Encode
- (
- NSSPKIXX520LocalityName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520StateOrProvinceName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520StateOrProvinceName ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-state-name)),
- * printableString PrintableString (SIZE (1..ub-state-name)),
- * universalString UniversalString (SIZE (1..ub-state-name)),
- * utf8String UTF8String (SIZE (1..ub-state-name)),
- * bmpString BMPString (SIZE(1..ub-state-name)) }
- *
- * The private calls for this type:
- *
- * nssPKIXX520StateOrProvinceName_Decode
- * nssPKIXX520StateOrProvinceName_CreateFromUTF8
- * nssPKIXX520StateOrProvinceName_Encode
- *
- */
- /*
- * nssPKIXX520StateOrProvinceName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520StateOrProvinceName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520StateOrProvinceName *
- nssPKIXX520StateOrProvinceName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520StateOrProvinceName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520StateOrProvinceName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520StateOrProvinceName *
- nssPKIXX520StateOrProvinceName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520StateOrProvinceName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520StateOrProvinceName_Encode
- (
- NSSPKIXX520StateOrProvinceName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520OrganizationName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520OrganizationName ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-organization-name)),
- * printableString PrintableString (SIZE (1..ub-organization-name)),
- * universalString UniversalString (SIZE (1..ub-organization-name)),
- * utf8String UTF8String (SIZE (1..ub-organization-name)),
- * bmpString BMPString (SIZE(1..ub-organization-name)) }
- *
- * The private calls for this type:
- *
- * nssPKIXX520OrganizationName_Decode
- * nssPKIXX520OrganizationName_CreateFromUTF8
- * nssPKIXX520OrganizationName_Encode
- *
- */
- /*
- * nssPKIXX520OrganizationName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520OrganizationName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520OrganizationName *
- nssPKIXX520OrganizationName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520OrganizationName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520OrganizationName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520OrganizationName *
- nssPKIXX520OrganizationName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520OrganizationName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520OrganizationName_Encode
- (
- NSSPKIXX520OrganizationName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520OrganizationalUnitName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520OrganizationalUnitName ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-organizational-unit-name)),
- * printableString PrintableString
- * (SIZE (1..ub-organizational-unit-name)),
- * universalString UniversalString
- * (SIZE (1..ub-organizational-unit-name)),
- * utf8String UTF8String (SIZE (1..ub-organizational-unit-name)),
- * bmpString BMPString (SIZE(1..ub-organizational-unit-name)) }
- *
- * The private calls for this type:
- *
- * nssPKIXX520OrganizationalUnitName_Decode
- * nssPKIXX520OrganizationalUnitName_CreateFromUTF8
- * nssPKIXX520OrganizationalUnitName_Encode
- *
- */
- /*
- * nssPKIXX520OrganizationalUnitName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520OrganizationalUnitName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520OrganizationalUnitName *
- nssPKIXX520OrganizationalUnitName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520OrganizationalUnitName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520OrganizationalUnitName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520OrganizationalUnitName *
- nssPKIXX520OrganizationalUnitName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520OrganizationalUnitName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520OrganizationalUnitName_Encode
- (
- NSSPKIXX520OrganizationalUnitName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520Title
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520Title ::= CHOICE {
- * teletexString TeletexString (SIZE (1..ub-title)),
- * printableString PrintableString (SIZE (1..ub-title)),
- * universalString UniversalString (SIZE (1..ub-title)),
- * utf8String UTF8String (SIZE (1..ub-title)),
- * bmpString BMPString (SIZE(1..ub-title)) }
- *
- * The private calls for this type:
- *
- * nssPKIXX520Title_Decode
- * nssPKIXX520Title_CreateFromUTF8
- * nssPKIXX520Title_Encode
- *
- */
- /*
- * nssPKIXX520Title_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Title upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Title *
- nssPKIXX520Title_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520Title_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520Title upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520Title *
- nssPKIXX520Title_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520Title_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520Title_Encode
- (
- NSSPKIXX520Title *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520dnQualifier
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520dnQualifier ::= PrintableString
- *
- * The private calls for this type:
- *
- * nssPKIXX520dnQualifier_Decode
- * nssPKIXX520dnQualifier_CreateFromUTF8
- * nssPKIXX520dnQualifier_Encode
- *
- */
- /*
- * nssPKIXX520dnQualifier_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520dnQualifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520dnQualifier *
- nssPKIXX520dnQualifier_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520dnQualifier_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520dnQualifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520dnQualifier *
- nssPKIXX520dnQualifier_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520dnQualifier_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520dnQualifier_Encode
- (
- NSSPKIXX520dnQualifier *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * X520countryName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * X520countryName ::= PrintableString (SIZE (2)) -- IS 3166 codes
- *
- * The private calls for this type:
- *
- * nssPKIXX520countryName_Decode
- * nssPKIXX520countryName_CreateFromUTF8
- * nssPKIXX520countryName_Encode
- *
- */
- /*
- * nssPKIXX520countryName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520countryName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520countryName *
- nssPKIXX520countryName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXX520countryName_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXX520countryName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXX520countryName *
- nssPKIXX520countryName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXX520countryName_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXX520countryName_Encode
- (
- NSSPKIXX520countryName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * Pkcs9email
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length))
- *
- * The private calls for this type:
- *
- * nssPKIXPkcs9email_Decode
- * nssPKIXPkcs9email_CreateFromUTF8
- * nssPKIXPkcs9email_Encode
- *
- */
- /*
- * nssPKIXPkcs9email_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXPkcs9email upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXPkcs9email *
- nssPKIXPkcs9email_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXPkcs9email_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXPkcs9email upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXPkcs9email *
- nssPKIXPkcs9email_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXPkcs9email_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_X520_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXPkcs9email_Encode
- (
- NSSPKIXPkcs9email *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * Name
- *
- * This structure contains a union of the possible name formats,
- * which at the moment is limited to an RDNSequence.
- *
- * From RFC 2459:
- *
- * Name ::= CHOICE { -- only one possibility for now --
- * rdnSequence RDNSequence }
- *
- * The private calls for this type:
- *
- * nssPKIXName_Decode
- * nssPKIXName_CreateFromUTF8
- * nssPKIXName_Create
- * nssPKIXName_CreateFromRDNSequence
- * nssPKIXName_Destroy
- * nssPKIXName_Encode
- * nssPKIXName_GetUTF8Encoding
- * nssPKIXName_GetChoice
- * nssPKIXName_GetRDNSequence
- * nssPKIXName_GetSpecifiedChoice {fgmr remove this}
- {fgmr} _SetRDNSequence
- {fgmr} _SetSpecifiedChoice
- * nssPKIXName_Equal
- * nssPKIXName_Duplicate
- *
- * (here is where I had specific attribute value gettors in pki1)
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXName_verifyPointer
- *
- */
- /*
- * nssPKIXName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXName_CreateFromUTF8
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_STRING
- * NSS_ERROR_UNKNOWN_ATTRIBUTE
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *string
- );
- /*
- * nssPKIXName_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_CHOICE
- * NSS_ERROR_INVALID_ARGUMENT
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXName_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXNameChoice choice,
- void *arg
- );
- /*
- * nssPKIXName_CreateFromRDNSequence
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXName_CreateFromRDNSequence
- (
- NSSArena *arenaOpt,
- NSSPKIXRDNSequence *rdnSequence
- );
- /*
- * nssPKIXName_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXName_Destroy
- (
- NSSPKIXName *name
- );
- /*
- * nssPKIXName_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXName_Encode
- (
- NSSPKIXName *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXName_GetUTF8Encoding
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSUTF8 pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXName_GetUTF8Encoding
- (
- NSSPKIXName *name,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXName_GetChoice
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- *
- * Return value:
- * A valid element of the NSSPKIXNameChoice enumeration upon success
- * The value NSSPKIXNameChoice_NSSinvalid (-1) upon error
- */
- NSS_EXTERN NSSPKIXNameChoice
- nssPKIXName_GetChoice
- (
- NSSPKIXName *name
- );
- /*
- * nssPKIXName_GetRDNSequence
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_WRONG_CHOICE
- *
- * Return value:
- * A pointer to a valid NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXName_GetRDNSequence
- (
- NSSPKIXName *name,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXName_GetSpecifiedChoice
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_WRONG_CHOICE
- *
- * Return value:
- * A valid pointer ...
- * NULL upon failure
- */
- NSS_EXTERN void *
- nssPKIXName_GetSpecifiedChoice
- (
- NSSPKIXName *name,
- NSSPKIXNameChoice choice,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXName_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXName_Equal
- (
- NSSPKIXName *name1,
- NSSPKIXName *name2,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXName_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXName_Duplicate
- (
- NSSPKIXName *name,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXName_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXName
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_NAME
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXName_verifyPointer
- (
- NSSPKIXName *p
- );
- #endif /* DEBUG */
- /*
- * RDNSequence
- *
- * This structure contains a sequence of RelativeDistinguishedName
- * objects.
- *
- * From RFC 2459:
- *
- * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
- *
- * The private calls for this type:
- *
- * nssPKIXRDNSequence_Decode
- * nssPKIXRDNSequence_CreateFromUTF8
- * nssPKIXRDNSequence_Create
- * nssPKIXRDNSequence_CreateFromArray
- * nssPKIXRDNSequence_Destroy
- * nssPKIXRDNSequence_Encode
- * nssPKIXRDNSequence_GetUTF8Encoding
- * nssPKIXRDNSequence_GetRelativeDistinguishedNameCount
- * nssPKIXRDNSequence_GetRelativeDistinguishedNames
- * nssPKIXRDNSequence_SetRelativeDistinguishedNames
- * nssPKIXRDNSequence_GetRelativeDistinguishedName
- * nssPKIXRDNSequence_SetRelativeDistinguishedName
- * nssPKIXRDNSequence_AppendRelativeDistinguishedName
- * nssPKIXRDNSequence_InsertRelativeDistinguishedName
- * nssPKIXRDNSequence_RemoveRelativeDistinguishedName
- * nssPKIXRDNSequence_FindRelativeDistinguishedName
- * nssPKIXRDNSequence_Equal
- * nssPKIXRDNSequence_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXRDNSequence_verifyPointer
- *
- */
- /*
- * nssPKIXRDNSequence_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXRDNSequence_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXRDNSequence_CreateFromUTF8
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_STRING
- * NSS_ERROR_UNKNOWN_ATTRIBUTE
- *
- * Return value:
- * A valid pointer to an NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXRDNSequence_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *string
- );
- /*
- * nssPKIXRDNSequence_CreateFromArray
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_RDN
- *
- * Return value:
- * A valid pointer to an NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXRDNSequence_CreateFromArray
- (
- NSSArena *arenaOpt,
- PRUint32 count,
- NSSPKIXRelativeDistinguishedName *rdn1
- );
- /*
- * nssPKIXRDNSequence_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_RDN
- *
- * Return value:
- * A valid pointer to an NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXRDNSequence_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXRelativeDistinguishedName *rdn1,
- ...
- );
- /*
- * nssPKIXRDNSequence_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_Destroy
- (
- NSSPKIXRDNSequence *rdnseq
- );
- /*
- * nssPKIXRDNSequence_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXRDNSequence_Encode
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRDNSequence_GetUTF8Encoding
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSUTF8 pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXRDNSequence_GetUTF8Encoding
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRDNSequence_GetRelativeDistinguishedNameCount
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * Nonnegative integer upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXRDNSequence_GetRelativeDistinguishedNameCount
- (
- NSSPKIXRDNSequence *rdnseq
- );
- /*
- * nssPKIXRDNSequence_GetRelativeDistinguishedNames
- *
- * This routine returns all of the relative distinguished names in the
- * specified RDN Sequence. {...} If the array is allocated, or if the
- * specified one has extra space, the array will be null-terminated.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_ARRAY_TOO_SMALL
- *
- * Return value:
- * A valid pointer to an array of NSSPKIXRelativeDistinguishedName
- * pointers upon success
- * NULL upon failure.
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName **
- nssPKIXRDNSequence_GetRelativeDistinguishedNames
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSPKIXRelativeDistinguishedName *rvOpt[],
- PRInt32 limit,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRDNSequence_SetRelativeDistinguishedNames
- *
- * -- fgmr comments --
- * If the array pointer itself is null, the set is considered empty.
- * If the count is zero but the pointer nonnull, the array will be
- * assumed to be null-terminated.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_PKIX_RDN
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_SetRelativeDistinguishedNames
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSPKIXRelativeDistinguishedName *rdns[],
- PRInt32 countOpt
- );
- /*
- * nssPKIXRDNSequence_GetRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRDNSequence_GetRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- PRInt32 i,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRDNSequence_SetRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_SetRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- PRInt32 i,
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRDNSequence_AppendRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_AppendRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRDNSequence_InsertRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_InsertRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- PRInt32 i,
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRDNSequence_RemoveRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_RemoveRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- PRInt32 i
- );
- /*
- * nssPKIXRDNSequence_FindRelativeDistinguishedName
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_NOT_FOUND
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * The index of the specified attribute value upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXRDNSequence_FindRelativeDistinguishedName
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRDNSequence_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXRDNSequence_Equal
- (
- NSSPKIXRDNSequence *one,
- NSSPKIXRDNSequence *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXRDNSequence_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXRDNSequence upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRDNSequence *
- nssPKIXRDNSequence_Duplicate
- (
- NSSPKIXRDNSequence *rdnseq,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXRDNSequence_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXRDNSequence
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXRDNSequence_verifyPointer
- (
- NSSPKIXRDNSequence *p
- );
- #endif /* DEBUG */
- /*
- * DistinguishedName
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * DistinguishedName ::= RDNSequence
- *
- * This is just a public typedef; no new methods are required. {fgmr-- right?}
- */
- /*
- * RelativeDistinguishedName
- *
- * This structure contains an unordered set of AttributeTypeAndValue
- * objects. RDNs are used to distinguish a set of objects underneath
- * a common object.
- *
- * Often, a single ATAV is sufficient to make a unique distinction.
- * For example, if a company assigns its people unique uid values,
- * then in the Name "uid=smith,ou=People,o=Acme,c=US" the "uid=smith"
- * ATAV by itself forms an RDN. However, sometimes a set of ATAVs is
- * needed. For example, if a company needed to distinguish between
- * two Smiths by specifying their corporate divisions, then in the
- * Name "(cn=Smith,ou=Sales),ou=People,o=Acme,c=US" the parenthesised
- * set of ATAVs forms the RDN.
- *
- * From RFC 2459:
- *
- * RelativeDistinguishedName ::=
- * SET SIZE (1 .. MAX) OF AttributeTypeAndValue
- *
- * The private calls for this type:
- *
- * nssPKIXRelativeDistinguishedName_Decode
- * nssPKIXRelativeDistinguishedName_CreateFromUTF8
- * nssPKIXRelativeDistinguishedName_Create
- * nssPKIXRelativeDistinguishedName_CreateFromArray
- * nssPKIXRelativeDistinguishedName_Destroy
- * nssPKIXRelativeDistinguishedName_Encode
- * nssPKIXRelativeDistinguishedName_GetUTF8Encoding
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues
- * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue
- * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue
- * nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue
- * nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue
- * nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue
- * nssPKIXRelativeDistinguishedName_Equal
- * nssPKIXRelativeDistinguishedName_Duplicate
- *
- * fgmr: Logical additional functions include
- *
- * NSSPKIXRelativeDistinguishedName_FindAttributeTypeAndValueByType
- * returns PRInt32
- * NSSPKIXRelativeDistinguishedName_FindAttributeTypeAndValuesByType
- * returns array of PRInt32
- * NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValueForType
- * returns NSSPKIXAttributeTypeAndValue
- * NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValuesForType
- * returns array of NSSPKIXAttributeTypeAndValue
- * NSSPKIXRelativeDistinguishedName_GetAttributeValueForType
- * returns NSSPKIXAttributeValue
- * NSSPKIXRelativeDistinguishedName_GetAttributeValuesForType
- * returns array of NSSPKIXAttributeValue
- *
- * NOTE: the "return array" versions are only meaningful if an RDN may
- * contain multiple ATAVs with the same type. Verify in the RFC if
- * this is possible or not. If not, nuke those three functions.
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXRelativeDistinguishedName_verifyPointer
- *
- */
- /*
- * nssPKIXRelativeDistinguishedName_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRelativeDistinguishedName_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXRelativeDistinguishedName_CreateFromUTF8
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_STRING
- * NSS_ERROR_UNKNOWN_ATTRIBUTE
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRelativeDistinguishedName_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *string
- );
- /*
- * nssPKIXRelativeDistinguishedName_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_ATAV
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRelativeDistinguishedName_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXAttributeTypeAndValue *atav1,
- ...
- );
- /*
- * nssPKIXRelativeDistinguishedName_CreateFromArray
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_ATAV
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRelativeDistinguishedName_CreateFromArray
- (
- NSSArena *arenaOpt,
- PRUint32 count,
- NSSPKIXAttributeTypeAndValue *atavs
- );
- /*
- * nssPKIXRelativeDistinguishedName_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_Destroy
- (
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRelativeDistinguishedName_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXRelativeDistinguishedName_Encode
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_GetUTF8Encoding
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSUTF8 pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSUTF8 *
- nssPKIXRelativeDistinguishedName_GetUTF8Encoding
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * Nonnegative integer upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount
- (
- NSSPKIXRelativeDistinguishedName *rdn
- );
- /*
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_ARRAY_TOO_SMALL
- *
- * Return value:
- * A valid pointer to an array of NSSPKIXAttributeTypeAndValue
- * pointers upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue **
- nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSPKIXAttributeTypeAndValue *rvOpt[],
- PRInt32 limit,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_ATAV
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSPKIXAttributeTypeAndValue *atavs[],
- PRInt32 countOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAttributeTypeAndValue *
- nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- PRInt32 i,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- PRInt32 i,
- NSSPKIXAttributeTypeAndValue *atav
- );
- /*
- * nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSPKIXAttributeTypeAndValue *atav
- );
- /*
- * nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- * NSS_ERROR_AT_MINIMUM
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- PRInt32 i
- );
- /*
- * nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_PKIX_ATAV
- * NSS_ERROR_NOT_FOUND
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * The index of the specified attribute value upon success
- * -1 upon failure.
- */
- NSS_EXTERN PRInt32
- nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSPKIXAttributeTypeAndValue *atav
- );
- /*
- * nssPKIXRelativeDistinguishedName_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXRelativeDistinguishedName_Equal
- (
- NSSPKIXRelativeDistinguishedName *one,
- NSSPKIXRelativeDistinguishedName *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXRelativeDistinguishedName_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RDN
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXRelativeDistinguishedName *
- nssPKIXRelativeDistinguishedName_Duplicate
- (
- NSSPKIXRelativeDistinguishedName *rdn,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXRelativeDistinguishedName_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXRelativeDistinguishedName
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_RELATIVE_DISTINGUISHED_NAME
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXRelativeDistinguishedName_verifyPointer
- (
- NSSPKIXRelativeDistinguishedName *p
- );
- #endif /* DEBUG */
- /*
- * DirectoryString
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * DirectoryString ::= CHOICE {
- * teletexString TeletexString (SIZE (1..MAX)),
- * printableString PrintableString (SIZE (1..MAX)),
- * universalString UniversalString (SIZE (1..MAX)),
- * utf8String UTF8String (SIZE (1..MAX)),
- * bmpString BMPString (SIZE(1..MAX)) }
- *
- * The private calls for this type:
- *
- * nssPKIXDirectoryString_Decode
- * nssPKIXDirectoryString_CreateFromUTF8
- * nssPKIXDirectoryString_Encode
- *
- */
- /*
- * nssPKIXDirectoryString_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXDirectoryString upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXDirectoryString *
- nssPKIXDirectoryString_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXDirectoryString_CreateFromUTF8
- *
- * { basically just enforces the length limit }
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXDirectoryString upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXDirectoryString *
- nssPKIXDirectoryString_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXDirectoryString_Encode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_DIRECTORY_STRING
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXDirectoryString_Encode
- (
- NSSPKIXDirectoryString *name,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * Certificate
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * Certificate ::= SEQUENCE {
- * tbsCertificate TBSCertificate,
- * signatureAlgorithm AlgorithmIdentifier,
- * signature BIT STRING }
- *
- * The private calls for this type:
- *
- * nssPKIXCertificate_Decode
- * nssPKIXCertificate_Create
- * nssPKIXCertificate_Destroy
- * nssPKIXCertificate_Encode
- * nssPKIXCertificate_GetTBSCertificate
- * nssPKIXCertificate_SetTBSCertificate
- * nssPKIXCertificate_GetAlgorithmIdentifier
- * nssPKIXCertificate_SetAlgorithmIdentifier
- * nssPKIXCertificate_GetSignature
- * nssPKIXCertificate_SetSignature
- * nssPKIXCertificate_Equal
- * nssPKIXCertificate_Duplicate
- *
- * { inherit TBSCertificate gettors? }
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXCertificate_verifyPointer
- *
- */
- /*
- * nssPKIXCertificate_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXCertificate *
- nssPKIXCertificate_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXCertificate_Create
- *
- * -- fgmr comments --
- * { at this level we'll have to just accept a specified signature }
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_ALGID
- * NSS_ERROR_INVALID_PKIX_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXCertificate *
- nssPKIXCertificate_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXAlgorithmIdentifier *algID,
- NSSItem *signature
- );
- /*
- * nssPKIXCertificate_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXCertificate_Destroy
- (
- NSSPKIXCertificate *cert
- );
- /*
- * nssPKIXCertificate_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXCertificate_Encode
- (
- NSSPKIXCertificate *cert,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXCertificate_GetTBSCertificate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXTBSCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXTBSCertificate *
- nssPKIXCertificate_GetTBSCertificate
- (
- NSSPKIXCertificate *cert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXCertificate_SetTBSCertificate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXCertificate_SetTBSCertificate
- (
- NSSPKIXCertificate *cert,
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * nssPKIXCertificate_GetAlgorithmIdentifier
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAlgorithmIdentifier *
- nssPKIXCertificate_GetAlgorithmIdentifier
- (
- NSSPKIXCertificate *cert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXCertificate_SetAlgorithmIdentifier
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXCertificate_SetAlgorithmIdentifier
- (
- NSSPKIXCertificate *cert,
- NSSPKIXAlgorithmIdentifier *algid,
- );
- /*
- * nssPKIXCertificate_GetSignature
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSItem upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSItem *
- nssPKIXCertificate_GetSignature
- (
- NSSPKIXCertificate *cert,
- NSSItem *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXCertificate_SetSignature
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_POINTER
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXCertificate_SetSignature
- (
- NSSPKIXCertificate *cert,
- NSSItem *signature
- );
- /*
- * nssPKIXCertificate_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXCertificate_Equal
- (
- NSSPKIXCertificate *one,
- NSSPKIXCertificate *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXCertificate_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXCertificate *
- nssPKIXCertificate_Duplicate
- (
- NSSPKIXCertificate *cert,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXCertificate_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXCertificate
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXCertificate_verifyPointer
- (
- NSSPKIXCertificate *p
- );
- #endif /* DEBUG */
- /*
- * TBSCertificate
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * TBSCertificate ::= SEQUENCE {
- * version [0] Version DEFAULT v1,
- * serialNumber CertificateSerialNumber,
- * signature AlgorithmIdentifier,
- * issuer Name,
- * validity Validity,
- * subject Name,
- * subjectPublicKeyInfo SubjectPublicKeyInfo,
- * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version shall be v2 or v3
- * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version shall be v2 or v3
- * extensions [3] Extensions OPTIONAL
- * -- If present, version shall be v3 -- }
- *
- * The private calls for this type:
- *
- * nssPKIXTBSCertificate_Decode
- * nssPKIXTBSCertificate_Create
- * nssPKIXTBSCertificate_Destroy
- * nssPKIXTBSCertificate_Encode
- * nssPKIXTBSCertificate_GetVersion
- * nssPKIXTBSCertificate_SetVersion
- * nssPKIXTBSCertificate_GetSerialNumber
- * nssPKIXTBSCertificate_SetSerialNumber
- * nssPKIXTBSCertificate_GetSignature
- * nssPKIXTBSCertificate_SetSignature
- * { inherit algid gettors? }
- * nssPKIXTBSCertificate_GetIssuer
- * nssPKIXTBSCertificate_SetIssuer
- * { inherit "helper" issuer gettors? }
- * nssPKIXTBSCertificate_GetValidity
- * nssPKIXTBSCertificate_SetValidity
- * { inherit validity accessors }
- * nssPKIXTBSCertificate_GetSubject
- * nssPKIXTBSCertificate_SetSubject
- * nssPKIXTBSCertificate_GetSubjectPublicKeyInfo
- * nssPKIXTBSCertificate_SetSubjectPublicKeyInfo
- * nssPKIXTBSCertificate_HasIssuerUniqueID
- * nssPKIXTBSCertificate_GetIssuerUniqueID
- * nssPKIXTBSCertificate_SetIssuerUniqueID
- * nssPKIXTBSCertificate_RemoveIssuerUniqueID
- * nssPKIXTBSCertificate_HasSubjectUniqueID
- * nssPKIXTBSCertificate_GetSubjectUniqueID
- * nssPKIXTBSCertificate_SetSubjectUniqueID
- * nssPKIXTBSCertificate_RemoveSubjectUniqueID
- * nssPKIXTBSCertificate_HasExtensions
- * nssPKIXTBSCertificate_GetExtensions
- * nssPKIXTBSCertificate_SetExtensions
- * nssPKIXTBSCertificate_RemoveExtensions
- * { extension accessors }
- * nssPKIXTBSCertificate_Equal
- * nssPKIXTBSCertificate_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXTBSCertificate_verifyPointer
- */
- /*
- * nssPKIXTBSCertificate_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXTBSCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXTBSCertificate *
- nssPKIXTBSCertificate_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXTBSCertificate_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_VERSION
- * NSS_ERROR_INVALID_PKIX_CERTIFICATE_SERIAL_NUMBER
- * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER
- * NSS_ERROR_INVALID_ISSUER_NAME
- * NSS_ERROR_INVALID_VALIDITY
- * NSS_ERROR_INVALID_SUBJECT_NAME
- * NSS_ERROR_INVALID_SUBJECT_PUBLIC_KEY_INFO
- * NSS_ERROR_INVALID_ISSUER_UNIQUE_IDENTIFIER
- * NSS_ERROR_INVALID_SUBJECT_UNIQUE_IDENTIFIER
- * NSS_ERROR_INVALID_EXTENSION
- *
- * Return value:
- */
- NSS_EXTERN NSSPKIXTBSCertificate *
- nssPKIXTBSCertificate_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXVersion version,
- NSSPKIXCertificateSerialNumber *serialNumber,
- NSSPKIXAlgorithmIdentifier *signature,
- NSSPKIXName *issuer,
- NSSPKIXValidity *validity,
- NSSPKIXName *subject,
- NSSPKIXSubjectPublicKeyInfo *spki,
- NSSPKIXUniqueIdentifier *issuerUniqueID,
- NSSPKIXUniqueIdentifier *subjectUniqueID,
- NSSPKIXExtensions *extensions
- );
- /*
- * nssPKIXTBSCertificate_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_Destroy
- (
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * nssPKIXTBSCertificate_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXTBSCertificate_Encode
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_GetVersion
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * A valid element of the NSSPKIXVersion enumeration upon success
- * NSSPKIXVersion_NSSinvalid (-1) upon failure
- */
- NSS_EXTERN NSSPKIXVersion
- nssPKIXTBSCertificate_GetVersion
- (
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * nssPKIXTBSCertificate_SetVersion
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_VERSION
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetVersion
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXVersion version
- );
- /*
- * nssPKIXTBSCertificate_GetSerialNumber
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXCertificateSerialNumber upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXCertificateSerialNumber *
- nssPKIXTBSCertificate_GetSerialNumber
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXCertificateSerialNumber *snOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetSerialNumber
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetSerialNumber
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXCertificateSerialNumber *sn
- );
- /*
- * nssPKIXTBSCertificate_GetSignature
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXAlgorithmIdentifier *
- nssPKIXTBSCertificate_GetSignature
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetSignature
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetSignature
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXAlgorithmIdentifier *algID
- );
- /*
- * { fgmr inherit algid gettors? }
- */
- /*
- * nssPKIXTBSCertificate_GetIssuer
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXTBSCertificate_GetIssuer
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetIssuer
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetIssuer
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXName *issuer
- );
- /*
- * { inherit "helper" issuer gettors? }
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- *
- * Return value:
- */
- /*
- * nssPKIXTBSCertificate_GetValidity
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXValidity upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXValidity *
- nssPKIXTBSCertificate_GetValidity
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetValidity
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetValidity
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXValidity *validity
- );
- /*
- * { fgmr inherit validity accessors }
- */
- /*
- * nssPKIXTBSCertificate_GetSubject
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXName upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXName *
- nssPKIXTBSCertificate_GetSubject
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetSubject
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_NAME
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetSubject
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXName *subject
- );
- /*
- * nssPKIXTBSCertificate_GetSubjectPublicKeyInfo
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXSubjectPublicKeyInfo upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXSubjectPublicKeyInfo *
- nssPKIXTBSCertificate_GetSubjectPublicKeyInfo
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetSubjectPublicKeyInfo
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_SUBJECT_PUBLIC_KEY_INFO
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetSubjectPublicKeyInfo
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXSubjectPublicKeyInfo *spki
- );
- /*
- * nssPKIXTBSCertificate_HasIssuerUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_TRUE if it has one
- * PR_FALSE if it doesn't
- * PR_FALSE upon failure
- */
- NSS_EXTERN PRBool
- nssPKIXTBSCertificate_HasIssuerUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTBSCertificate_GetIssuerUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_CERT_HAS_NO_ISSUER_UNIQUE_ID
- *
- * Return value:
- * A valid pointer to an NSSPKIXUniqueIdentifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXUniqueIdentifier *
- nssPKIXTBSCertificate_GetIssuerUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXUniqueIdentifier *uidOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetIssuerUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetIssuerUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXUniqueIdentifier *uid
- );
- /*
- * nssPKIXTBSCertificate_RemoveIssuerUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_CERT_HAS_NO_ISSUER_UNIQUE_ID
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_RemoveIssuerUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * nssPKIXTBSCertificate_HasSubjectUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_TRUE if it has one
- * PR_FALSE if it doesn't
- * PR_FALSE upon failure
- */
- NSS_EXTERN PRBool
- nssPKIXTBSCertificate_HasSubjectUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTBSCertificate_GetSubjectUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_CERT_HAS_NO_SUBJECT_UNIQUE_ID
- *
- * Return value:
- * A valid pointer to an NSSPKIXUniqueIdentifier upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXUniqueIdentifier *
- nssPKIXTBSCertificate_GetSubjectUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXUniqueIdentifier *uidOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetSubjectUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ITEM
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetSubjectUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXUniqueIdentifier *uid
- );
- /*
- * nssPKIXTBSCertificate_RemoveSubjectUniqueID
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_CERT_HAS_NO_SUBJECT_UNIQUE_ID
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_RemoveSubjectUniqueID
- (
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * nssPKIXTBSCertificate_HasExtensions
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_TRUE if it has one
- * PR_FALSE if it doesn't
- * PR_FALSE upon failure
- */
- NSS_EXTERN PRBool
- nssPKIXTBSCertificate_HasExtensions
- (
- NSSPKIXTBSCertificate *tbsCert,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTBSCertificate_GetExtensions
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_CERT_HAS_NO_EXTENSIONS
- *
- * Return value:
- * A valid pointer to an NSSPKIXExtensions upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXExtensions *
- nssPKIXTBSCertificate_GetExtensions
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTBSCertificate_SetExtensions
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_PKIX_EXTENSIONS
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_SetExtensions
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSPKIXExtensions *extensions
- );
- /*
- * nssPKIXTBSCertificate_RemoveExtensions
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_CERT_HAS_NO_EXTENSIONS
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_RemoveExtensions
- (
- NSSPKIXTBSCertificate *tbsCert
- );
- /*
- * { extension accessors }
- */
- /*
- * nssPKIXTBSCertificate_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXTBSCertificate_Equal
- (
- NSSPKIXTBSCertificate *one,
- NSSPKIXTBSCertificate *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTBSCertificate_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXTBSCertificate upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXTBSCertificate *
- nssPKIXTBSCertificate_Duplicate
- (
- NSSPKIXTBSCertificate *tbsCert,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXTBSCertificate_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXTBSCertificate
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_TBS_CERTIFICATE
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXTBSCertificate_verifyPointer
- (
- NSSPKIXTBSCertificate *p
- );
- #endif /* DEBUG */
- /*
- * CertificateSerialNumber
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * CertificateSerialNumber ::= INTEGER
- *
- * This is just a typedef'd NSSBER; no methods are required.
- * {fgmr -- the asn.1 stuff should have routines to convert
- * integers to natural types when possible and vv. we can
- * refer to them here..}
- */
- /*
- * Validity
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * Validity ::= SEQUENCE {
- * notBefore Time,
- * notAfter Time }
- *
- * The private calls for the type:
- *
- * nssPKIXValidity_Decode
- * nssPKIXValidity_Create
- * nssPKIXValidity_Encode
- * nssPKIXValidity_Destroy
- * nssPKIXValidity_GetNotBefore
- * nssPKIXValidity_SetNotBefore
- * nssPKIXValidity_GetNotAfter
- * nssPKIXValidity_SetNotAfter
- * nssPKIXValidity_Equal
- * nssPKIXValidity_Compare
- * nssPKIXValidity_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXValidity_verifyPointer
- *
- */
- /*
- * nssPKIXValidity_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXValidity upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXValidity *
- nssPKIXValidity_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXValidity_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_TIME
- *
- * Return value:
- * A valid pointer to an NSSPKIXValidity upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXValidity *
- nssPKIXValidity_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXTime notBefore,
- NSSPKIXTime notAfter
- );
- /*
- * nssPKIXValidity_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXValidity_Destroy
- (
- NSSPKIXValidity *validity
- );
- /*
- * nssPKIXValidity_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXValidity_Encode
- (
- NSSPKIXValidity *validity,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXValidity_GetNotBefore
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * A valid NSSPKIXTime upon success
- * {we need to rethink NSSPKIXTime}
- */
- NSS_EXTERN NSSPKIXTime
- nssPKIXValidity_GetNotBefore
- (
- NSSPKIXValidity *validity
- );
- /*
- * nssPKIXValidity_SetNotBefore
- *
- * -- fgmr comments --
- * {do we require that it be before the "notAfter" value?}
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_VALUE_TOO_LARGE
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXValidity_SetNotBefore
- (
- NSSPKIXValidity *validity,
- NSSPKIXTime notBefore
- );
- /*
- * nssPKIXValidity_GetNotAfter
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_VALUE_OUT_OF_RANGE
- *
- * Return value:
- * A valid NSSPKIXTime upon success
- * {we need to rethink NSSPKIXTime}
- */
- NSS_EXTERN NSSPKIXTime
- nssPKIXValidity_GetNotAfter
- (
- NSSPKIXValidity *validity
- );
- /*
- * nssPKIXValidity_SetNotAfter
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_VALUE_TOO_SMALL
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXValidity_SetNotAfter
- (
- NSSPKIXValidity *validity,
- NSSPKIXTime notAfter
- );
- /*
- * nssPKIXValidity_Equal
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- *
- * Return value:
- * PR_TRUE if the two objects have equal values
- * PR_FALSE otherwise
- * PR_FALSE upon error
- */
- NSS_EXTERN PRBool
- nssPKIXValidity_Equal
- (
- NSSPKIXValidity *one,
- NSSPKIXValidity *two,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXValidity_Compare
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- *
- * Return value:
- * 1 if the second is "greater" or later than the first
- * 0 if they are equal
- * -1 if the first is "greater" or later than the first
- * -2 upon failure
- */
- NSS_EXTERN PRIntn
- nssPKIXValidity_Compare
- (
- NSSPKIXValidity *one,
- NSSPKIXValidity *two
- );
- /*
- * nssPKIXValidity_Duplicate
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXValidity upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXValidity *
- nssPKIXValidity_Duplicate
- (
- NSSPKIXValidity *validity,
- NSSArena *arenaOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXValidity_verifyPointer
- *
- * This method is only present in debug builds.
- *
- * If the specified pointer is a valid pointer to an NSSPKIXValidity
- * object, this routine will return PR_SUCCESS. Otherwise, it will
- * put an error on the error stack and return PR_FAILURE.
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_VALIDITY
- *
- * Return value:
- * PR_SUCCESS if the pointer is valid
- * PR_FAILURE if it isn't
- */
- NSS_EXTERN PRStatus
- nssPKIXValidity_verifyPointer
- (
- NSSPKIXValidity *p
- );
- #endif /* DEBUG */
- /*
- * Time
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * Time ::= CHOICE {
- * utcTime UTCTime,
- * generalTime GeneralizedTime }
- *
- * The private calls for the type:
- *
- * nssPKIXTime_Decode
- * nssPKIXTime_CreateFromPRTime
- * nssPKIXTime_CreateFromUTF8
- * nssPKIXTime_Destroy
- * nssPKIXTime_Encode
- * nssPKIXTime_GetPRTime
- * nssPKIXTime_GetUTF8Encoding
- * nssPKIXTime_Equal
- * nssPKIXTime_Duplicate
- * nssPKIXTime_Compare
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXTime_verifyPointer
- *
- */
- /*
- * nssPKIXTime_Decode
- *
- *
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXTime upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXTime *
- nssPKIXTime_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXTime_CreateFromPRTime
- *
- */
- NSS_EXTERN NSSPKIXTime *
- nssPKIXTime_CreateFromPRTime
- (
- NSSArena *arenaOpt,
- PRTime prTime
- );
- /*
- * nssPKIXTime_CreateFromUTF8
- *
- */
- NSS_EXTERN NSSPKIXTime *
- nssPKIXTime_CreateFromUTF8
- (
- NSSArena *arenaOpt,
- NSSUTF8 *utf8
- );
- /*
- * nssPKIXTime_Destroy
- *
- */
- NSS_EXTERN PR_STATUS
- nssPKIXTime_Destroy
- (
- NSSPKIXTime *time
- );
- /*
- * nssPKIXTime_Encode
- *
- */
- NSS_EXTERN NSSBER *
- nssPKIXTime_Encode
- (
- NSSPKIXTime *time,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTime_GetPRTime
- *
- * Returns a zero on error
- */
- NSS_EXTERN PRTime
- nssPKIXTime_GetPRTime
- (
- NSSPKIXTime *time,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTime_GetUTF8Encoding
- *
- */
- NSS_EXTERN NSSUTF8 *
- nssPKXITime_GetUTF8Encoding
- (
- NSSPKIXTime *time,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTime_Equal
- *
- */
- NSS_EXTERN PRBool
- nssPKXITime_Equal
- (
- NSSPKXITime *time1,
- NSSPKXITime *time2,
- PRStatus *statusOpt
- );
- /*
- * nssPKIXTime_Duplicate
- *
- */
- NSS_EXTERN NSSPKIXTime *
- nssPKXITime_Duplicate
- (
- NSSPKIXTime *time,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXTime_Compare
- *
- * Usual result: -1, 0, 1
- * Returns 0 on error
- */
- NSS_EXTERN PRInt32
- nssPKIXTime_Compare
- (
- NSSPKIXTime *time1,
- NSSPKIXTime *tiem2,
- PRStatus *statusOpt
- );
- #ifdef DEBUG
- /*
- * nssPKIXTime_verifyPointer
- *
- */
- NSS_EXTERN PRStatus
- nssPKIXTime_verifyPointer
- (
- NSSPKIXTime *time
- );
- #endif /* DEBUG */
- /*
- * UniqueIdentifier
- *
- * From RFC 2459:
- *
- * UniqueIdentifier ::= BIT STRING
- *
- */
- /*
- * SubjectPublicKeyInfo
- *
- * -- fgmr comments --
- *
- * From RFC 2459:
- *
- * SubjectPublicKeyInfo ::= SEQUENCE {
- * algorithm AlgorithmIdentifier,
- * subjectPublicKey BIT STRING }
- *
- * The private calls for the type:
- *
- * nssPKIXSubjectPublicKeyInfo_Decode
- * nssPKIXSubjectPublicKeyInfo_Create
- * nssPKIXSubjectPublicKeyInfo_Encode
- * nssPKIXSubjectPublicKeyInfo_Destroy
- * nssPKIXSubjectPublicKeyInfo_GetAlgorithm
- * nssPKIXSubjectPublicKeyInfo_SetAlgorithm
- * nssPKIXSubjectPublicKeyInfo_GetSubjectPublicKey
- * nssPKIXSubjectPublicKeyInfo_SetSubjectPublicKey
- * nssPKIXSubjectPublicKeyInfo_Equal
- * nssPKIXSubjectPublicKeyInfo_Duplicate
- *
- * In debug builds, the following call is available:
- *
- * nssPKIXSubjectPublicKeyInfo_verifyPointer
- *
- */
- /*
- * nssPKIXSubjectPublicKeyInfo_Decode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_BER
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- *
- * Return value:
- * A valid pointer to an NSSPKIXSubjectPublicKeyInfo upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXSubjectPublicKeyInfo *
- nssPKIXSubjectPublicKeyInfo_Decode
- (
- NSSArena *arenaOpt,
- NSSBER *ber
- );
- /*
- * nssPKIXSubjectPublicKeyInfo_Create
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_NO_MEMORY
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER
- * NSS_ERROR_INVALID_ITEM
- *
- * Return value:
- * A valid pointer to an NSSPKIXSubjectPublicKeyInfo upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSPKIXSubjectPublicKeyInfo *
- nssPKIXSubjectPublicKeyInfo_Create
- (
- NSSArena *arenaOpt,
- NSSPKIXAlgorithmIdentifier *algid,
- NSSItem *subjectPublicKey
- );
- /*
- * nssPKIXSubjectPublicKeyInfo_Destroy
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_SUBJECT_PUBLIC_KEY_INFO
- *
- * Return value:
- * PR_SUCCESS upon success
- * PR_FAILURE upon failure
- */
- NSS_EXTERN PRStatus
- nssPKIXSubjectPublicKeyInfo_Destroy
- (
- NSSPKIXSubjectPublicKeyInfo *spki
- );
- /*
- * nssPKIXSubjectPublicKeyInfo_Encode
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_SUBJECT_PUBLIC_KEY_INFO
- *
- * Return value:
- * A valid NSSBER pointer upon success
- * NULL upon failure
- */
- NSS_EXTERN NSSBER *
- nssPKIXSubjectPublicKeyInfo_Encode
- (
- NSSPKIXSubjectPublicKeyInfo *spki,
- NSSASN1EncodingType encoding,
- NSSBER *rvOpt,
- NSSArena *arenaOpt
- );
- /*
- * nssPKIXSubjectPublicKeyInfo_GetAlgorithm
- *
- * -- fgmr comments --
- *
- * The error may be one of the following values:
- * NSS_ERROR_INVALID_PKIX_SUBJECT_PUBLIC_KEY_INFO
- * NSS_ERROR_INVALID_ARENA
- * NSS_ERROR_NO_MEMORY
- *
- * Return value:
- * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success