RSA Security logo

RSA BSAFE Cert-C
API Reference

cmpstr.h File Reference

This file defines the Cert-C string-comparison routines.

#include "certattr.h"
#include "certname.h"

Go to the source code of this file.

Functions

int C_ComparePrintableString (POINTER str1, unsigned int len1, POINTER str2, unsigned int len2)
 Compares two printable strings for equality. More...

int C_CompareString (int tag1, unsigned char *str1, unsigned int len1, int tag2, unsigned char *str2, unsigned int len2)
 Compares two strings for equality. More...

int C_CompareName (NAME_OBJ name1, NAME_OBJ name2)
 Compares two name objects for equality. More...

int C_CompareBaseName (NAME_OBJ name1, NAME_OBJ name2)
 Compares two name objects to see if the first is a prefix of the second. More...


Function Documentation

int C_CompareBaseName NAME_OBJ    name1,
NAME_OBJ    name2
;
 

Compares two name objects to see if the first is a prefix of the second. The name objects must have matching attribute types at corresponding positions in the name objects. In addition, corresponding AVAs must be at the same name level (for example, belong to the same RDN). Individual attribute values are compared using string comparison rules defined for C_CompareString(). The comparison is successful if all of the AVAs in the first object are equal to the corresponding AVAs in the second object.

Parameters:
name1 This input parameter is the first name object to compare.
name2 This input parameter is the second name object to compare.
Returns:
If name objects match, returns 0. If not, returns a non-zero value.

int C_CompareName NAME_OBJ    name1,
NAME_OBJ    name2
;
 

Compares two name objects for equality. The name objects must have matching attribute types at corresponding positions in the name object. In addition, corresponding AVAs must be at the same name level (for example, belong to the same RDN). Individual attribute values are compared using string comparison rules defined for C_CompareString().

Parameters:
name1 This input parameter is the first name object to compare.
name2 This input parameter is the second name object to compare.
Returns:
If name objects match, returns 0. If not, returns a non-zero value.

int C_ComparePrintableString POINTER    str1,
unsigned int    len1,
POINTER    str2,
unsigned int    len2
;
 

Compares two printable strings for equality. The comparison ignores leading and trailing spaces. Uppercase and lowercase alphabetic characters are considered to be equal. Sequences of spaces of any length occurring at places other than the beginning or end of the string are compared as though they consist of a single space. These comparison rules are consistent with those specified in the PKIX standard.

Parameters:
str1 This input parameter is the first string to compare.
len1 This input parameter is the length of the first string.
str2 This input parameter is the second string to compare.
len2 This input parameter is the length of the second string.
Returns:
If strings are equal, returns 0. If not, returns a non-zero value.

int C_CompareString int    tag1,
unsigned char *    str1,
unsigned int    len1,
int    tag2,
unsigned char *    str2,
unsigned int    len2
;
 

Compares two strings for equality. If the string tags are both VT_PRINTABLE_STRING, the strings are compared as in C_ComparePrintableString(). Otherwise, the string tags, lengths, and values must match exactly.

Parameters:
tag1 This input parameter is the first string's character type.
str1 This input parameter is the first string to compare.
len1 This input parameter is the length of the first string.
tag2 This input parameter is the second string's character type.
str2 This input parameter is the second string to compare.
len2 This input parameter is the length of the second string.
Returns:
If strings are equal, returns 0. If not, returns a non-zero value.



RSA BSAFE® Cert-C 2.7 API Reference