nsspki1.h

来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· C头文件 代码 · 共 2,342 行 · 第 1/5 页

H
2,342
字号
 * argument is non-null, the memory used will be obtained from that * arena; otherwise, the memory will be obtained from the heap.  This * routine may return NULL upon error, in which case it will have * created an error stack. * * The error may be one of the following values: *  NSS_ERROR_NO_MEMORY *  NSS_ERROR_INVALID_RDN * * Return value: *  NULL upon error *  A pointero to an NSSRDNSeq upon success */NSS_EXTERN NSSRDNSeq *NSSRDNSeq_Create(  NSSArena *arenaOpt,  NSSRDN *rdn1,  ...);/* * NSSRDNSeq_Destroy * * This routine will destroy an RDNSeq object.  It should eventually  * be called on all RDNSeqs created without an arena.  While it is not * necessary to call it on RDNSeqs created within an arena, it is not * an error to do so.  This routine returns a PRStatus value; if * successful, it will return PR_SUCCESS.  If unsuccessful, it will * create an error stack and return PR_FAILURE. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ * * Return value: *  PR_FAILURE upon error *  PR_SUCCESS upon success */NSS_EXTERN PRStatusNSSRDNSeq_Destroy(  NSSRDNSeq *rdnseq);/* * NSSRDNSeq_GetDEREncoding * * This routine will DER-encode an RDNSeq object.  If the optional  * arena argument is non-null, the memory used will be obtained from * that arena; otherwise, the memory will be obtained from the heap. * This routine may return null upon error, in which case it will have * created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  The DER encoding of this NSSRDNSeq */NSS_EXTERN NSSDER *NSSRDNSeq_GetDEREncoding(  NSSRDNSeq *rdnseq,  NSSArena *arenaOpt);/* * NSSRDNSeq_GetUTF8Encoding * * This routine returns a UTF8 string containing a string  * representation of the RDNSeq as a comma-separated sequence of RDNs.   * If the optional arena argument is non-null, the memory used will be * obtained from that arena; otherwise, the memory will be obtained  * from the heap.  This routine may return null upon error, in which  * case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to the UTF8 string */NSS_EXTERN NSSUTF8 *NSSRDNSeq_GetUTF8Encoding(  NSSRDNSeq *rdnseq,  NSSArena *arenaOpt);/* * NSSRDNSeq_AppendRDN * * This routine appends an RDN to the end of the existing RDN  * sequence.  If the RDNSeq was created with a non-null arena  * argument, that same arena will be used for any additional required * memory.  If the RDNSeq was created with a NULL arena argument, any * additional memory will be obtained from the heap.  This routine * returns a PRStatus value; it will return PR_SUCCESS upon success, * and upon failure it will create an error stack and return PR_FAILURE. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_INVALID_RDN *  NSS_ERROR_NO_MEMORY * * Return value: *  PR_SUCCESS upon success *  PR_FAILURE upon failure */NSS_EXTERN PRStatusNSSRDNSeq_AppendRDN(  NSSRDNSeq *rdnseq,  NSSRDN *rdn);/* * NSSRDNSeq_GetRDNCount * * This routine returns the cardinality of the sequence of RDNs within * the specified RDNSeq.  This routine may return 0 upon error, in  * which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ * * Return value: *  0 upon error *  A positive number upon success */NSS_EXTERN PRUint32NSSRDNSeq_GetRDNCount(  NSSRDNSeq *rdnseq);/* * NSSRDNSeq_GetRDN * * This routine returns a pointer to the i'th RDN in the sequence of * RDNs that make up the specified RDNSeq.  The sequence begins with * the top-level (e.g., "c=US") RDN.  The value of the variable 'i' * is on the range [0,c) where c is the cardinality returned from * NSSRDNSeq_GetRDNCount.  The caller owns the RDN the pointer to which * is returned.  If the optional arena argument is non-null, the memory * used will be obtained from that areana; otherwise, the memory will  * be obtained from the heap.  This routine may return NULL upon error, * in which case it will have created an error stack.  Note that the  * usual string representation of RDN Sequences is from last to first. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_VALUE_OUT_OF_RANGE *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A caller-owned pointer to an NSSRDN */NSS_EXTERN NSSRDN *NSSRDNSeq_GetRDN(  NSSRDNSeq *rdnseq,  NSSArena *arenaOpt,  PRUint32 i);/* * NSSRDNSeq_Compare * * This routine compares two RDNSeqs for equality.  For two RDNSeqs to  * be equal, they must have the same number of RDNs, and each RDN in * one sequence must be equal to the corresponding RDN in the other * sequence.  The result of the comparison will be stored at the * location pointed to by the "equalp" variable, which must point to a * valid PRBool.  This routine may return PR_FAILURE upon error, in * which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_INVALID_ARGUMENT * * Return value: *  PR_FAILURE on error *  PR_SUCCESS upon a successful comparison (equal or not) */NSS_EXTERN PRStatusNSSRDNSeq_Compare(  NSSRDNSeq *rdnseq1,  NSSRDNSeq *rdnseq2,  PRBool *equalp);/* * NSSRDNSeq_Duplicate * * This routine duplicates the specified RDNSeq.  If the optional arena * argument is non-null, the memory required will be obtained from that * arena; otherwise, the memory will be obtained from the heap.  This  * routine may return NULL upon error, in which case it will have  * created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_RDNSEQ *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to a new RDNSeq */NSS_EXTERN NSSRDNSeq *NSSRDNSeq_Duplicate(  NSSRDNSeq *rdnseq,  NSSArena *arenaOpt);/* * NSSName * * The public "methods" regarding this "object" are: * * NSSName_CreateFromBER   -- constructor * NSSName_CreateFromUTF8  -- constructor * NSSName_Create          -- constructor * * NSSName_Destroy * NSSName_GetDEREncoding * NSSName_GetUTF8Encoding * NSSName_GetChoice * NSSName_GetRDNSequence * NSSName_GetSpecifiedChoice * NSSName_Compare * NSSName_Duplicate * * NSSName_GetUID * NSSName_GetEmail * NSSName_GetCommonName * NSSName_GetOrganization * NSSName_GetOrganizationalUnits * NSSName_GetStateOrProvince * NSSName_GetLocality * NSSName_GetCountry * NSSName_GetAttribute *//* * NSSName_CreateFromBER * * This routine creates an NSSName by decoding a BER- or DER-encoded  * (directory) Name.  If the optional arena argument is non-null, * the memory used will be obtained from that arena; otherwise,  * the memory will be obtained from the heap.  This routine may * return NULL upon error, in which case it will have created an error * stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_BER *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to an NSSName upon success */NSS_EXTERN NSSName *NSSName_CreateFromBER(  NSSArena *arenaOpt,  NSSBER *berName);/* * NSSName_CreateFromUTF8 * * This routine creates an NSSName by decoding a UTF8 string  * consisting of the string representation of one of the choices of  * (directory) names.  Currently the only choice is an RDNSeq.  If the * optional arena argument is non-null, the memory used will be  * obtained from that arena; otherwise, the memory will be obtained  * from the heap.  The routine may return NULL upon error, in which * case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_STRING *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to an NSSName upon success */NSS_EXTERN NSSName *NSSName_CreateFromUTF8(  NSSArena *arenaOpt,  NSSUTF8 *stringName);/* * NSSName_Create * * This routine creates an NSSName with the specified choice of * underlying name types.  The value of the choice variable must be * one of the values of the NSSNameChoice enumeration, and the type * of the arg variable must be as specified in the following table: * *   Choice                     Type *   ========================   =========== *   NSSNameChoiceRdnSequence   NSSRDNSeq * * * If the optional arena argument is non-null, the memory used will * be obtained from that arena; otherwise, the memory will be  * obtained from the heap.  This routine may return NULL upon error, * in which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_CHOICE *  NSS_ERROR_INVALID_ARGUMENT *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to an NSSName upon success */NSS_EXTERN NSSName *NSSName_Create(  NSSArena *arenaOpt,  NSSNameChoice choice,  void *arg);/* * NSSName_Destroy * * This routine will destroy a Name object.  It should eventually be * called on all Names created without an arena.  While it is not * necessary to call it on Names created within an arena, it is not * an error to do so.  This routine returns a PRStatus value; if * successful, it will return PR_SUCCESS.  If unsuccessful, it will * create an error stack and return PR_FAILURE. * * The error may be one of the following values: *  NSS_ERROR_INVALID_NAME * * Return value: *  PR_FAILURE upon error *  PR_SUCCESS upon success */NSS_EXTERN PRStatusNSSName_Destroy(  NSSName *name);/* * NSSName_GetDEREncoding * * This routine will DER-encode a name object.  If the optional arena * argument is non-null, the memory used will be obtained from that * arena; otherwise, the memory will be obtained from the heap.  This * routine may return null upon error, in which case it will have  * created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_NAME *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  The DER encoding of this NSSName */NSS_EXTERN NSSDER *NSSName_GetDEREncoding(  NSSName *name,  NSSArena *arenaOpt);/* * NSSName_GetUTF8Encoding * * This routine returns a UTF8 string containing a string  * representation of the Name in the format specified by the  * underlying name choice.  If the optional arena argument is non-null, * the memory used will be obtained from that arena; otherwise, the  * memory will be obtained from the heap.  This routine may return * NULL upon error, in which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_NAME *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A pointer to the UTF8 string */NSS_EXTERN NSSUTF8 *NSSName_GetUTF8Encoding(  NSSName *name,  NSSArena *arenaOpt);/* * NSSName_GetChoice * * This routine returns the type of the choice underlying the specified * name.  The return value will be a member of the NSSNameChoice  * enumeration.  This routine may return NSSNameChoiceInvalid upon  * error, in which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_NAME * * Return value: *  NSSNameChoiceInvalid upon error *  An other member of the NSSNameChoice enumeration upon success */NSS_EXTERN NSSNameChoiceNSSName_GetChoice(  NSSName *name);/* * NSSName_GetRDNSequence * * If the choice underlying the specified NSSName is that of an  * RDNSequence, this routine will return a pointer to that RDN * sequence.  Otherwise, this routine will place an error on the * error stack, and return NULL.  If the optional arena argument is * non-null, the memory required will be obtained from that arena; * otherwise, the memory will be obtained from the heap.  The * caller owns the returned pointer.  This routine may return NULL * upon error, in which case it will have created an error stack. * * The error may be one of the following values: *  NSS_ERROR_INVALID_NAME *  NSS_ERROR_WRONG_CHOICE *  NSS_ERROR_NO_MEMORY * * Return value: *  NULL upon error *  A caller-owned pointer to an NSSRDNSeq */NSS_EXTERN NSSRDNSeq *NSSName_GetRDNSequence

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?