nsspki1.h
来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· C头文件 代码 · 共 2,342 行 · 第 1/5 页
H
2,342 行
( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetSpecifiedChoice * * If the choice underlying the specified NSSName matches the specified * choice, a caller-owned pointer to that underlying object will be * returned. Otherwise, an error will be placed on the error stack and * NULL will be returned. 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, which must be typecast */NSS_EXTERN void *NSSName_GetSpecifiedChoice( NSSName *name, NSSNameChoice choice, NSSArena *arenaOpt);/* * NSSName_Compare * * This routine compares two Names for equality. For two Names to be * equal, they must have the same choice of underlying types, and the * underlying values must be equal. 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_NAME * NSS_ERROR_INVALID_ARGUMENT * * Return value: * PR_FAILURE on error * PR_SUCCESS upon a successful comparison (equal or not) */NSS_EXTERN PRStatusNSSName_Compare( NSSName *name1, NSSName *name2, PRBool *equalp);/* * NSSName_Duplicate * * This routine duplicates the specified nssname. 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_NAME * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a new NSSName */NSS_EXTERN NSSName *NSSName_Duplicate( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetUID * * This routine will attempt to derive a user identifier from the * specified name, if the choices and content of the name permit. * If the Name consists of a Sequence of Relative Distinguished * Names containing a UID attribute, the UID will be the value of * that attribute. Note that no UID attribute is defined in either * PKIX or PKCS#9; rather, this seems to derive from RFC 1274, which * defines the type as a caseIgnoreString. We'll return a Directory * String. 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_UID * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String. */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetUID( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetEmail * * This routine will attempt to derive an email address from the * specified name, if the choices and content of the name permit. * If the Name consists of a Sequence of Relative Distinguished * Names containing either a PKIX email address or a PKCS#9 email * address, the result will be the value of that attribute. 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_EMAIL * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr IA5 String */NSSName_GetEmail( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetCommonName * * This routine will attempt to derive a common name from the * specified name, if the choices and content of the name permit. * If the Name consists of a Sequence of Relative Distinguished Names * containing a PKIX Common Name, the result will be that 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_NAME * NSS_ERROR_NO_COMMON_NAME * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetCommonName( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetOrganization * * This routine will attempt to derive an organisation name from the * specified name, if the choices and content of the name permit. * If Name consists of a Sequence of Relative Distinguished names * containing a PKIX Organization, the result will be the value of * that attribute. 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_ORGANIZATION * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetOrganization( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetOrganizationalUnits * * This routine will attempt to derive a sequence of organisational * unit names from the specified name, if the choices and content of * the name permit. If the Name consists of a Sequence of Relative * Distinguished Names containing one or more organisational units, * the result will be the values of those attributes. 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_ORGANIZATIONAL_UNITS * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a null-terminated array of UTF8 Strings */NSS_EXTERN NSSUTF8 ** /* XXX fgmr DirectoryString */NSSName_GetOrganizationalUnits( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetStateOrProvince * * This routine will attempt to derive a state or province name from * the specified name, if the choices and content of the name permit. * If the Name consists of a Sequence of Relative Distinguished Names * containing a state or province, the result will be the value of * that attribute. 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_STATE_OR_PROVINCE * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetStateOrProvince( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetLocality * * This routine will attempt to derive a locality name from the * specified name, if the choices and content of the name permit. If * the Name consists of a Sequence of Relative Distinguished names * containing a Locality, the result will be the value of that * attribute. 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_LOCALITY * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetLocality( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetCountry * * This routine will attempt to derive a country name from the * specified name, if the choices and content of the name permit. * If the Name consists of a Sequence of Relative Distinguished * Names containing a Country, the result will be the value of * that attribute.. 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_COUNTRY * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr PrintableString */NSSName_GetCountry( NSSName *name, NSSArena *arenaOpt);/* * NSSName_GetAttribute * * If the specified name consists of a Sequence of Relative * Distinguished Names containing an attribute with the specified * type, and the actual value of that attribute may be expressed * with a Directory String, then the value of that attribute will * be returned as a Directory String. 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_ATTRIBUTE * NSS_ERROR_ATTRIBUTE_VALUE_NOT_STRING * * Return value: * NULL upon error * A pointer to a UTF8 String */NSS_EXTERN NSSUTF8 * /* XXX fgmr DirectoryString */NSSName_GetAttribute( NSSName *name, NSSOID *attribute, NSSArena *arenaOpt);/* * NSSGeneralName * * The public "methods" regarding this "object" are: * * NSSGeneralName_CreateFromBER -- constructor * NSSGeneralName_CreateFromUTF8 -- constructor * NSSGeneralName_Create -- constructor * * NSSGeneralName_Destroy * NSSGeneralName_GetDEREncoding * NSSGeneralName_GetUTF8Encoding * NSSGeneralName_GetChoice * NSSGeneralName_GetOtherName * NSSGeneralName_GetRfc822Name * NSSGeneralName_GetDNSName * NSSGeneralName_GetX400Address * NSSGeneralName_GetDirectoryName * NSSGeneralName_GetEdiPartyName * NSSGeneralName_GetUniformResourceIdentifier * NSSGeneralName_GetIPAddress * NSSGeneralName_GetRegisteredID * NSSGeneralName_GetSpecifiedChoice * NSSGeneralName_Compare * NSSGeneralName_Duplicate * * NSSGeneralName_GetUID * NSSGeneralName_GetEmail * NSSGeneralName_GetCommonName * NSSGeneralName_GetOrganization * NSSGeneralName_GetOrganizationalUnits * NSSGeneralName_GetStateOrProvince * NSSGeneralName_GetLocality * NSSGeneralName_GetCountry * NSSGeneralName_GetAttribute *//* * NSSGeneralName_CreateFromBER * * This routine creates an NSSGeneralName by decoding a BER- or DER- * encoded general 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 NSSGeneralName upon success */NSS_EXTERN NSSGeneralName *NSSGeneralName_CreateFromBER( NSSArena *arenaOpt, NSSBER *berGeneralName);/* * NSSGeneralName_CreateFromUTF8 * * This routine creates an NSSGeneralName by decoding a UTF8 string * consisting of the string representation of one of the choices of * general names. 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 NSSGeneralName upon success */NSS_EXTERN NSSGeneralName *NSSGeneralName_CreateFromUTF8( NSSArena *arenaOpt, NSSUTF8 *stringGeneralName);/* * NSSGeneralName_Create * * This routine creates an NSSGeneralName with the specified choice of * underlying name types. The value of the choice variable must be one * of the values of the NSSGeneralNameChoice enumeration, and the type * of the arg variable must be as specified in the following table: * * Choice Type * ============================================ ========= * NSSGeneralNameChoiceOtherName * NSSGeneralNameChoiceRfc822Name * NSSGeneralNameChoiceDNSName * NSSGeneralNameChoiceX400Address * NSSGeneralNameChoiceDirectoryName NSSName * * NSSGeneralNameChoiceEdiPartyName * NSSGeneralNameChoiceUniformResourceIdentifier * NSSGeneralNameChoiceIPAddress * NSSGeneralNameChoiceRegisteredID * * 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. *
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?