📄 pki1.h
字号:
* This routine returns the NSSOID corresponding to the attribute type * in the specified ATAV. This routine may return NSS_OID_UNKNOWN * upon error, in which case it will have set an error on the error * stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_ATAV * * Return value: * NSS_OID_UNKNOWN upon error * An element of enum NSSOIDenum upon success */NSS_EXTERN const NSSOID *nssATAV_GetType( NSSATAV *atav);/* * nssATAV_GetValue * * This routine returns a string containing the attribute value * in the specified ATAV. 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 set an error upon the * error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_ATAV * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to an NSSItem containing the attribute value. */NSS_EXTERN NSSUTF8 *nssATAV_GetValue( NSSATAV *atav, NSSArena *arenaOpt);/* * nssATAV_Compare * * This routine compares two ATAVs for equality. For two ATAVs to be * equal, the attribute types must be the same, and the attribute * values must have equal length and contents. 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 set an * error on the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_ATAV * NSS_ERROR_INVALID_ARGUMENT * * Return value: * PR_FAILURE on error * PR_SUCCESS upon a successful comparison (equal or not) */NSS_EXTERN PRStatusnssATAV_Compare( NSSATAV *atav1, NSSATAV *atav2, PRBool *equalp);/* * nssATAV_Duplicate * * This routine duplicates the specified ATAV. 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 * placed an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_ATAV * NSS_ERROR_NO_MEMORY * * Return value: * NULL on error * A pointer to a new ATAV */NSS_EXTERN NSSATAV *nssATAV_Duplicate( NSSATAV *atav, NSSArena *arenaOpt);/* * nssATAV_verifyPointer * * This method is only present in debug builds. * * If the specified pointer is a valid pointer to an NSSATAV object, * this routine will return PR_SUCCESS. Otherwise, it will put an * error on the error stack and return PR_FAILRUE. * * The error may be one of the following values: * NSS_ERROR_INVALID_NSSATAV * NSS_ERROR_NO_MEMORY * * Return value: * PR_SUCCESS if the pointer is valid * PR_FAILURE if it isn't */#ifdef DEBUGNSS_EXTERN PRStatusnssATAV_verifyPointer( NSSATAV *atav);#endif /* DEBUG *//* * NSSRDN * * The non-public "methods" regarding this "object" are: * * nssRDN_CreateFromBER -- constructor * nssRDN_CreateFromUTF8 -- constructor * nssRDN_Create -- constructor * nssRDN_CreateSimple -- constructor * * nssRDN_Destroy * nssRDN_GetDEREncoding * nssRDN_GetUTF8Encoding * nssRDN_AddATAV * nssRDN_GetATAVCount * nssRDN_GetATAV * nssRDN_GetSimpleATAV * nssRDN_Compare * nssRDN_Duplicate *//* * nssRDN_CreateFromBER * * This routine creates an NSSRDN by decoding a BER- or DER-encoded * RDN. 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 set an error on the 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 NSSRDN upon success */NSS_EXTERN NSSRDN *nssRDN_CreateFromBER( NSSArena *arenaOpt, NSSBER *berRDN);/* * nssRDN_CreateFromUTF8 * * This routine creates an NSSRDN by decoding an UTF8 string * consisting of either a single ATAV in the "equals" format, e.g., * "uid=smith," or one or more such ATAVs in parentheses, e.g., * "(sn=Smith,ou=Sales)." 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 set an error on the * error stack. * * The error may be one of the following values: * NSS_ERROR_UNKNOWN_ATTRIBUTE * NSS_ERROR_INVALID_UTF8 * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to an NSSRDN upon success */NSS_EXTERN NSSRDN *nssRDN_CreateFromUTF8( NSSArena *arenaOpt, NSSUTF8 *stringRDN);/* * nssRDN_Create * * This routine creates an NSSRDN from one or more NSSATAVs. The * final argument to this routine must be NULL. 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 set * an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_NO_MEMORY * NSS_ERROR_INVALID_ATAV * * Return value: * NULL upon error * A pointer to an NSSRDN upon success */NSS_EXTERN NSSRDN *nssRDN_Create( NSSArena *arenaOpt, NSSATAV *atav1, ...);/* * nssRDN_CreateSimple * * This routine creates a simple NSSRDN from a single NSSATAV. 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 set an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_NO_MEMORY * NSS_ERROR_INVALID_ATAV * * Return value: * NULL upon error * A pointer to an NSSRDN upon success */NSS_EXTERN NSSRDN *nssRDN_CreateSimple( NSSArena *arenaOpt, NSSATAV *atav);/* * nssRDN_Destroy * * This routine will destroy an RDN object. It should eventually be * called on all RDNs created without an arena. While it is not * necessary to call it on RDNs 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 * set an error on the error stack and return PR_FAILURE. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * * Return value: * PR_FAILURE upon failure * PR_SUCCESS upon success */NSS_EXTERN PRStatusnssRDN_Destroy( NSSRDN *rdn);/* * nssRDN_GetDEREncoding * * This routine will DER-encode an RDN 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 set * an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * The DER encoding of this NSSRDN */NSS_EXTERN NSSDER *nssRDN_GetDEREncoding( NSSRDN *rdn, NSSArena *arenaOpt);/* * nssRDN_GetUTF8Encoding * * This routine returns a UTF8 string containing a string * representation of the RDN. A simple (one-ATAV) RDN will be simply * the string representation of that ATAV; a non-simple RDN will be in * parenthesised form. 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 set an error on the * error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A pointer to a UTF8 string */NSS_EXTERN NSSUTF8 *nssRDN_GetUTF8Encoding( NSSRDN *rdn, NSSArena *arenaOpt);/* * nssRDN_AddATAV * * This routine adds an ATAV to the set of ATAVs in the specified RDN. * Remember that RDNs consist of an unordered set of ATAVs. If the * RDN was created with a non-null arena argument, that same arena * will be used for any additional required memory. If the RDN 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 * set an error on the error stack and return PR_FAILURE. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_INVALID_ATAV * NSS_ERROR_NO_MEMORY * * Return value: * PR_SUCCESS upon success * PR_FAILURE upon failure */NSS_EXTERN PRStatusnssRDN_AddATAV( NSSRDN *rdn, NSSATAV *atav);/* * nssRDN_GetATAVCount * * This routine returns the cardinality of the set of ATAVs within * the specified RDN. This routine may return 0 upon error, in which * case it will have set an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * * Return value: * 0 upon error * A positive number upon success */NSS_EXTERN PRUint32nssRDN_GetATAVCount( NSSRDN *rdn);/* * nssRDN_GetATAV * * This routine returns a pointer to an ATAV that is a member of * the set of ATAVs within the specified RDN. While the set of * ATAVs within an RDN is unordered, this routine will return * distinct values for distinct values of 'i' as long as the RDN * is not changed in any way. The RDN may be changed by calling * NSSRDN_AddATAV. The value of the variable 'i' is on the range * [0,c) where c is the cardinality returned from NSSRDN_GetATAVCount. * The caller owns the ATAV the pointer to which is returned. 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 set an error upon the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_VALUE_OUT_OF_RANGE * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A caller-owned pointer to an NSSATAV */NSS_EXTERN NSSATAV *nssRDN_GetATAV( NSSRDN *rdn, NSSArena *arenaOpt, PRUint32 i);/* * nssRDN_GetSimpleATAV * * Most RDNs are actually very simple, with a single ATAV. This * routine will return the single ATAV from such an RDN. The caller * owns the ATAV the pointer to which is returned. 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, including the case where * the set of ATAVs in the RDN is nonsingular. Upon error, this * routine will have set an error on the error stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_RDN_NOT_SIMPLE * NSS_ERROR_NO_MEMORY * * Return value: * NULL upon error * A caller-owned pointer to an NSSATAV */NSS_EXTERN NSSATAV *nssRDN_GetSimpleATAV( NSSRDN *rdn, NSSArena *arenaOpt);/* * nssRDN_Compare * * This routine compares two RDNs for equality. For two RDNs to be * equal, they must have the same number of ATAVs, and every ATAV in * one must be equal to an ATAV in the other. (Note that the sets * of ATAVs are unordered.) 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 set an error on the error * stack. * * The error may be one of the following values: * NSS_ERROR_INVALID_RDN * NSS_ERROR_INVALID_ARGUMENT * * Return value: * PR_FAILURE on error * PR_SUCCESS upon a successful comparison (equal or not) */NSS_EXTERN PRStatusnssRDN_Compare( NSSRDN *rdn1, NSSRDN *rdn2, PRBool *equalp);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -