Name.cpp File Reference


Detailed Description

Subsystem: X.509 ASN.1 Encoding/Decoding (PKIFX509ASN)

Module: CPKIFName

Id
Name.cpp 10552 2009-09-18 14:29:45Z cwallace

Definition in file Name.cpp.

#include "Name.h"
#include "Buffer.h"
#include "ASN1Helper.h"
#include "PKIX1Explicit88.h"
#include "ToolkitUtils.h"
#include "OID.h"
#include "DistributionPointName.h"

Include dependency graph for Name.cpp:

Go to the source code of this file.

Defines

#define _UPPER   0x1
#define _LOWER   0x2
#define _DIGIT   0x4
#define _SPACE   0x8
#define _PUNCT   0x10
#define _CONTROL   0x20
#define _BLANK   0x40
#define _HEX   0x80

Functions

CPKIFOIDPtr g_oidCN (new CPKIFOID("2.5.4.3"))
CPKIFOIDPtr g_oidC (new CPKIFOID("2.5.4.6"))
CPKIFOIDPtr g_oidO (new CPKIFOID("2.5.4.10"))
CPKIFOIDPtr g_oidOU (new CPKIFOID("2.5.4.11"))
bool FindAttributeName (const CPKIFOIDPtr &oid, char *oidBuf)
bool CharIsSpace (char c)
std::string trim_right (const std::string &source, const std::string &t=allSpaces)
std::string trim_left (const std::string &source, const std::string &t=allSpaces)
std::string trim (const std::string &source, const std::string &t=allSpaces)
bool CompareRDNStrings (const char *lhsStr, const char *rhsStr)
bool CompareASN1OIDs (ASN1OBJID *lhs, ASN1OBJID *rhs)
bool RDNsMatch (CACX509V3RelativeDistinguishedName *lhs, CACX509V3RelativeDistinguishedName *rhs)

Variables

char allSpaces [] = {0x09,0x0A,0x0B,0x0C,0x0D,0x20}
const int CharTableSize = 128


Define Documentation

#define _BLANK   0x40

Definition at line 521 of file Name.cpp.

#define _CONTROL   0x20

Definition at line 520 of file Name.cpp.

#define _DIGIT   0x4

Definition at line 517 of file Name.cpp.

#define _HEX   0x80

Definition at line 522 of file Name.cpp.

#define _LOWER   0x2

Definition at line 516 of file Name.cpp.

#define _PUNCT   0x10

Definition at line 519 of file Name.cpp.

#define _SPACE   0x8

Definition at line 518 of file Name.cpp.

Referenced by CharIsSpace().

#define _UPPER   0x1

Definition at line 515 of file Name.cpp.


Function Documentation

bool CharIsSpace ( char  c  ) 

Interface: Subsystem

This is a helper function that determines if a character is a space.

Returns:
True if the character is a space character, false otherwise
Parameters:
c  [in]Character that will be checked

Definition at line 664 of file Name.cpp.

References _SPACE.

Referenced by CompareRDNStrings().

bool CompareASN1OIDs ( ASN1OBJID *  lhs,
ASN1OBJID *  rhs 
)

Interface: Subsystem

This is a helper function that compares two oids

Returns:
True if two oids are the same, false otherwise
Parameters:
lhs  [in] A pointer to ASN1OBJID that will be compared
rhs  [in] A pointer to ASN1OBJID that will be compared

Definition at line 837 of file Name.cpp.

Referenced by RDNsMatch().

bool CompareRDNStrings ( const char *  lhsStr,
const char *  rhsStr 
)

Interface: Subsystem

This is helper function that compares two RDN strings, ignoring leading or trailing white space.

Returns:
A Boolean indicating whether the two strings match.
Parameters:
lhsStr  [in] A NULL terminated string that will be compared
rhsStr  [in] A NULL terminated string that will be compared

Definition at line 736 of file Name.cpp.

References CharIsSpace(), and strnicmp.

Referenced by RDNsMatch().

bool FindAttributeName ( const CPKIFOIDPtr &  oid,
char *  oidBuf 
)

Interface: Subsystem

This is helper fuction that looks up common RDN attribute types based on OID. The buffer passed as oidBuf is assumed to be at least MAXOID bytes in size, despite the fact that it doesn't contain an OID value.

Returns:
True if the attribute name was found, false otherwise
Parameters:
oid  [in] A reference to a pointer to CPKIFOID object that contains oids that is used to find the name
oidBuf  [out] Buffer that contains the attribute name

Definition at line 299 of file Name.cpp.

References g_oidC(), g_oidCN(), g_oidO(), and g_oidOU().

Referenced by CPKIFName::GetRDNs(), and CPKIFName::ToString().

CPKIFOIDPtr g_oidC ( new   CPKIFOID"2.5.4.6"  ) 

Referenced by FindAttributeName().

CPKIFOIDPtr g_oidCN ( new   CPKIFOID"2.5.4.3"  ) 

Referenced by FindAttributeName().

CPKIFOIDPtr g_oidO ( new   CPKIFOID"2.5.4.10"  ) 

Referenced by FindAttributeName().

CPKIFOIDPtr g_oidOU ( new   CPKIFOID"2.5.4.11"  ) 

Referenced by FindAttributeName().

bool RDNsMatch ( CACX509V3RelativeDistinguishedName *  lhs,
CACX509V3RelativeDistinguishedName *  rhs 
)

Interface: Subsystem

This is a helper function that compares two CACX509V3RelativeDistinguishedName objects

Returns:
True if CACX509V3RelativeDistinguishedName match, false otherwise
Parameters:
lhs  [in] A poiter to CACX509V3RelativeDistinguishedName that will be compared
rhs  [in] A poiter to CACX509V3RelativeDistinguishedName that will be compared

Definition at line 860 of file Name.cpp.

References CACASNWRAPPER_CREATE, CompareASN1OIDs(), and CompareRDNStrings().

Referenced by CPKIFName::DescendedFrom(), GetNumMatchingRdns(), and CPKIFName::operator==().

std::string trim ( const std::string &  source,
const std::string &  t = allSpaces 
) [inline]

Interface: Subsystem

This is a helper function that trims a string

Returns:
None
Parameters:
source  [in] String to be trimmed
t  [in] String that contains all spaces

Definition at line 720 of file Name.cpp.

References trim_left(), and trim_right().

std::string trim_left ( const std::string &  source,
const std::string &  t = allSpaces 
) [inline]

Interface: Subsystem

This is a helper function that trims a string left

Returns:
A string that contains the trimmed string
Parameters:
source  [in] String to be trimmed
t  [in] String that contains all spaces

Definition at line 702 of file Name.cpp.

Referenced by trim().

std::string trim_right ( const std::string &  source,
const std::string &  t = allSpaces 
) [inline]

Interface: Subsystem

This is a helper function that trims a string right

Returns:
A string that contains the trimmed string
Parameters:
source  [in] String to be trimmed
t  [in] String that contains all spaces

Definition at line 684 of file Name.cpp.

Referenced by trim().


Variable Documentation

char allSpaces[] = {0x09,0x0A,0x0B,0x0C,0x0D,0x20}

Definition at line 524 of file Name.cpp.

const int CharTableSize = 128

Definition at line 525 of file Name.cpp.


Generated on Mon Nov 15 11:17:42 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6