CPKIFGeneralName Class Reference

#include <GeneralName.h>

Collaboration diagram for CPKIFGeneralName:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFGeneralName class provides access to GeneralName objects. The GeneralName structure is frequently used in PKI objects to represent an entity’s name. GeneralName provides several naming options, as shown in the following ASN.1 definition:
GeneralName ::= CHOICE 
{
	otherName [0] AnotherName,
	rfc822Name [1] IA5String,
	dNSName [2] IA5String,
	x400Address [3] ORAddress,
	directoryName [4] Name,
	ediPartyName [5] EDIPartyName,
	uniformResourceIdentifier [6] IA5String,
	iPAddress [7] OCTET STRING, 
	registeredID [8] OBJECT IDENTIFIER 
}

Note: EDIPARTYNAME values are not supported. A CPKIFException indicating COMMON_NOT_IMPLEMENTED will be thrown if a GeneralName containing an EDIPARTYNAME value is encountered.

TSP-enforcing: Yes

Definition at line 52 of file GeneralName.h.


Public Types

enum  GENNAMETYPE {
  NOTSET, OTHERNAME, RFC822, DNSNAME,
  X400ADDRESS, DIRECTORYNAME, EDIPARTYNAME, URI,
  IPADDRESS, OID
}

Public Member Functions

 CPKIFGeneralName ()
 CPKIFGeneralName (const CPKIFNamePtr &name)
 CPKIFGeneralName (const CPKIFBufferPtr &name)
virtual ~CPKIFGeneralName ()
CPKIFBufferPtr otherName () const
const char * rfc822Name () const
const char * dnsName () const
CPKIFBufferPtr x400Address () const
CPKIFNamePtr directoryName () const
const char * uri () const
CPKIFBufferPtr ipAddress () const
CPKIFOIDPtr oid () const
bool operator== (const CPKIFGeneralName &rhs)
GENNAMETYPE GetType () const
void Decode (CPKIFBufferPtr &bp)
CPKIFBufferPtr Encoded ()

Member Enumeration Documentation

Enumerator:
NOTSET 
OTHERNAME 
RFC822 
DNSNAME 
X400ADDRESS 
DIRECTORYNAME 
EDIPARTYNAME 
URI 
IPADDRESS 
OID 

Definition at line 55 of file GeneralName.h.


Constructor & Destructor Documentation

CPKIFGeneralName::CPKIFGeneralName (  ) 

Interface: External

Default constructor sets the name type to NOTSET

Returns:
None

Definition at line 240 of file GeneralName.cpp.

References NOTSET.

CPKIFGeneralName::CPKIFGeneralName ( const CPKIFNamePtr &  name  ) 

Interface: External

This constructor is called to create a GeneralName populated with a distinguished name.

Returns:
None

Definition at line 313 of file GeneralName.cpp.

References DIRECTORYNAME, and EncodeCPKIFNameAsGenName().

CPKIFGeneralName::CPKIFGeneralName ( const CPKIFBufferPtr &  name  ) 

Interface: External

This constructor is internally invoked; it will throw a std::bad_alloc exception if allocation of memory fails or ASN.1 decoding errors if the extension cannot be parsed.

Returns:
None
Exceptions:
std::bad_alloc Interface: External
This constructor is internally invoked; it will throw a std::bad_alloc exception if allocation of memory fails or ASN.1 decoding errors if the extension cannot be parsed.

Returns:
None
Exceptions:
std::bad_alloc 
Parameters:
name  [in] A reference to a smart pointer to CPKIFBuffer object containing der encoded GeneralName

Definition at line 274 of file GeneralName.cpp.

References NOTSET.

CPKIFGeneralName::~CPKIFGeneralName (  )  [virtual]

Interface: External

The function destroys an instance of CPKIFGeneralName.

Returns:
None

Definition at line 298 of file GeneralName.cpp.


Member Function Documentation

CPKIFBufferPtr CPKIFGeneralName::otherName (  )  const

Interface: External

This function returns a reference counted smart pointer to a CPKIFBuffer object containing the encoded value from the other name component of a GeneralName object, if present, and NULL otherwise. The object returned by this function is a reference counted pointer to an object held by the instance of CPKIFGeneralName and should not be modified. As a reference counted object, the object may live longer than the CPKIFGeneralName instance from which it was retrieved.

Returns:
a reference counted smart pointer to a CPKIFBuffer object containing the encoded value from the other name component of a GeneralName object.

Definition at line 377 of file GeneralName.cpp.

References OTHERNAME.

Referenced by operator<<().

const char * CPKIFGeneralName::rfc822Name (  )  const

Interface: External

This function returns a pointer to a NULL-terminated string containing the value from the RFC822 name component of a GeneralName object, if present, and NULL otherwise. The pointer returned by this function points directly to a member variable of the CPKIFGeneralName instance and must not be modified. The pointer is valid for the life of the CPKIFGeneralName object or until Decode is invoked.

Returns:
A pointer to a NULL-terminated string containing the value from the RFC822 name component of a GeneralName object.

Definition at line 397 of file GeneralName.cpp.

References RFC822.

Referenced by operator<<().

const char * CPKIFGeneralName::dnsName (  )  const

Interface: External

This function returns a pointer to a NULL-terminated string containing the value from the DNS name component of a GeneralName object, if present, and NULL otherwise. The pointer returned by this function points directly to a member variable of the CPKIFGeneralName instance and must not be modified. The pointer is valid for the life of the CPKIFGeneralName object or until Decode is invoked.

Returns:
A pointer to a NULL-terminated string containing the value from the DNS name component of a GeneralName object.

Definition at line 415 of file GeneralName.cpp.

References DNSNAME.

Referenced by operator<<().

CPKIFBufferPtr CPKIFGeneralName::x400Address (  )  const

Interface: External

This function returns a smart pointer to a CPKIFBuffer object containing the encoded value from the X.400 address component of a GeneralName object, if present, and NULL otherwise. The object returned by this function is a reference counted pointer to an object held by the instance of CPKIFGeneralName and should not be modified. As a reference counted object, the object may live longer than the CPKIFGeneralName instance from which it was retrieved.

Returns:
A smart pointer to a CPKIFBuffer object containing the encoded value from the X.400 address component of a GeneralName object.

Definition at line 432 of file GeneralName.cpp.

References X400ADDRESS.

CPKIFNamePtr CPKIFGeneralName::directoryName (  )  const

Interface: External

This function returns a smart pointer to a CPKIFName object containing the directory name component of a GeneralName object, if present and NULL otherwise. The object returned by this function is a reference counted pointer to an object held by the instance of CPKIFGeneralName and should not be modified. As a reference counted object, the object may live longer than the CPKIFGeneralName instance from which it was retrieved.

Returns:
A smart pointer to a CPKIFName object containing the directory name component of a GeneralName object

Definition at line 452 of file GeneralName.cpp.

References DIRECTORYNAME.

Referenced by operator<<().

const char * CPKIFGeneralName::uri (  )  const

Interface: External

This function returns a pointer to a NULL-terminated string containing the value from the URI name component of a GeneralName object, if present, and NULL otherwise. The pointer returned by this function points directly to a member variable of the CPKIFGeneralName instance and must not be modified. The pointer is valid for the life of the CPKIFGeneralName object or until Decode is invoked.

Returns:
A pointer to a NULL-terminated string containing the value from the URI name component of a GeneralName object

Definition at line 471 of file GeneralName.cpp.

References URI.

Referenced by operator<<().

CPKIFBufferPtr CPKIFGeneralName::ipAddress (  )  const

Interface: External

This function returns a smart pointer to a CPKIFBuffer object containing the encoded value from the IP address component of a GeneralName object, if present, and NULL otherwise. The object returned by this function is a reference counted pointer to an object held by the instance of CPKIFGeneralName and should not be modified. As a reference counted object, the object may live longer than the CPKIFGeneralName instance from which it was retrieved.

Returns:
A smart pointer to a CPKIFBuffer object containing the encoded value from the IP address component of a GeneralName object

Definition at line 488 of file GeneralName.cpp.

References IPADDRESS.

Referenced by operator<<().

CPKIFOIDPtr CPKIFGeneralName::oid (  )  const

Interface: External

This function returns a smart pointer to a CPKIFOID object containing the encoded value from the object identifier component of a GeneralName object, if present, and NULL otherwise. The object returned by this function is a reference counted pointer to an object held by the instance of CPKIFGeneralName and should not be modified. As a reference counted object, the object may live longer than the CPKIFGeneralName instance from which it was retrieved.

Returns:
A smart pointer to a CPKIFOID object containing the encoded value from the object identifier component of a GeneralName object.

Definition at line 508 of file GeneralName.cpp.

References OID.

Referenced by operator<<().

bool CPKIFGeneralName::operator== ( const CPKIFGeneralName rhs  ) 

Interface: External

This function returns true if the CPKIFGeneralName object passed as rhs matches the object on which this comparison function is invoked.

Return values:
True if the CPKIFGeneralName object passed as rhs matches the object on which this comparison function is invoked.
False if the CPKIFGeneralName object passed as rhs does not matche the object on which this comparison function is invoked
Exceptions:
CPKIFException(COMMON_UNSUPPORTED_CHOICE) 
CPKIFException(COMMON_NOT_IMPLEMENTED) 
Parameters:
rhs  [in] Reference to a CPKIFGeneralName object to compare

Definition at line 529 of file GeneralName.cpp.

References COMMON_NOT_IMPLEMENTED, COMMON_UNSUPPORTED_CHOICE, DIRECTORYNAME, DNSNAME, EDIPARTYNAME, IPADDRESS, m_impl, OID, OTHERNAME, RFC822, TOOLKIT_X509_ASN, URI, and X400ADDRESS.

CPKIFGeneralName::GENNAMETYPE CPKIFGeneralName::GetType (  )  const

Interface: External

This function returns an enumerated value indicating the type of name contained by a GeneralName object.

enum GENNAMETYPE 
{

	NOTSET,
	OTHERNAME,
	RFC822,
	DNSNAME,
	X400ADDRESS,
	DIRECTORYNAME,
	EDIPARTYNAME,
	URI,
	IPADDRESS,
	OID
};
Typically, applications invoke this function to determine the type of name held by an instance of CPKIFGeneralName then call the appropriate function to retrieve that name form.

Returns:
GENNAMETYPE enumeration

Definition at line 347 of file GeneralName.cpp.

Referenced by operator<<().

void CPKIFGeneralName::Decode ( CPKIFBufferPtr &  bp  ) 

Interface: External

This function decodes an encoded GeneralName.

Returns:
None
Parameters:
bp  [in] Reference to a smart pointer to a CPKIFBuffer containing the encoded GeneralName to decode

Definition at line 359 of file GeneralName.cpp.

References CPKIFASNWrapper< T >::data(), and CPKIFASNWrapper< T >::Decode().

CPKIFBufferPtr CPKIFGeneralName::Encoded (  ) 

Interface: External

This function returns a smart pointer to CPKIFBuffer object containing encoded General Name

Returns:
A smart pointer to a CPKIFBuffer object containing the encoded value of GeneralName.

Definition at line 568 of file GeneralName.cpp.


The documentation for this class was generated from the following files:

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