CX500DistinguishedName Class Reference

class CX500DistinguishedName : public CBase

Holds the Distinguished Name of a subject.

A collection of 'attribute type and value' objects, as defined by the X.520 standard.

The name used in X.509 certificates is the X.500 Distinguished Name, which describes a path through an X.500 Directory Information Tree.

A Distinguished Name is a series of name-value pairs that uniquely identify an entity, i.e. the certificate subject.

Inherits from

  • CX500DistinguishedName
Public Member Functions
~CX500DistinguishedName()
IMPORT_C TIntCount()
IMPORT_C HBufC *DisplayNameL()
IMPORT_C const CX520AttributeTypeAndValue &Element(TInt)
IMPORT_C CASN1EncSequence *EncodeASN1L()
IMPORT_C CASN1EncSequence *EncodeASN1LC()
IMPORT_C TBoolExactMatchL(const CX500DistinguishedName &)
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C HBufC *ExtractFieldL(const TDesC &)
IMPORT_C TBoolIsWithinSubtreeL(const CX500DistinguishedName &)
IMPORT_C TBoolMatchElementL(const CX520AttributeTypeAndValue &)
IMPORT_C CX500DistinguishedName *NewL(const TDesC8 &, TInt &)
IMPORT_C CX500DistinguishedName *NewL(const TDesC8 &)
IMPORT_C CX500DistinguishedName *NewL(RReadStream &)
IMPORT_C CX500DistinguishedName *NewL(const CArrayPtr< CX520AttributeTypeAndValue > &)
IMPORT_C CX500DistinguishedName *NewL(const CX500DistinguishedName &)
IMPORT_C CX500DistinguishedName *NewLC(const TDesC8 &, TInt &)
IMPORT_C CX500DistinguishedName *NewLC(const TDesC8 &)
IMPORT_C CX500DistinguishedName *NewLC(RReadStream &)
IMPORT_C CX500DistinguishedName *NewLC(const CArrayPtr< CX520AttributeTypeAndValue > &)
IMPORT_C CX500DistinguishedName *NewLC(const CX500DistinguishedName &)
Private Member Functions
CX500DistinguishedName()
voidConstructL(const CArrayPtr< CX520AttributeTypeAndValue > &)
voidConstructL(const TDesC8 &, TInt &)
voidConstructL(RReadStream &)
voidInternalizeL(RReadStream &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CArrayPtrFlat< CX520AttributeTypeAndValue > *iElements

Constructor & Destructor Documentation

CX500DistinguishedName()

CX500DistinguishedName()[private]

~CX500DistinguishedName()

IMPORT_C~CX500DistinguishedName()

Destructor.

Frees all resources owned by the object, prior to its destruction.

Member Functions Documentation

ConstructL(const CArrayPtr< CX520AttributeTypeAndValue > &)

voidConstructL(const CArrayPtr< CX520AttributeTypeAndValue > &aElements)[private]

Parameters

const CArrayPtr< CX520AttributeTypeAndValue > & aElements

ConstructL(const TDesC8 &, TInt &)

voidConstructL(const TDesC8 &aBinaryData,
TInt &aPos
)[private]

Parameters

const TDesC8 & aBinaryData
TInt & aPos

ConstructL(RReadStream &)

voidConstructL(RReadStream &aStream)[private]

Parameters

RReadStream & aStream

Count()

IMPORT_C TIntCount()const

Gets the number of 'attribute type and value' objects contained by this Distinguished Name object.

The number of 'attribute type and value' objects.

DisplayNameL()

IMPORT_C HBufC *DisplayNameL()const

Gets the decoded value for the common or organisation name.

A heap descriptor containing the decoded value of the common or organisation name.

Element(TInt)

IMPORT_C const CX520AttributeTypeAndValue &Element(TIntaIndex)const

Gets a reference to specific 'attribute type and value' object as identified by the specified index.

The referenced 'attribute type and value' object.

Parameters

TInt aIndexThe index number identifying the specific 'attribute type and value' object. This number is relative to zero. This value must be non-negative and less than the number of objects currently contained by this Distinguished Name object.

EncodeASN1L()

IMPORT_C CASN1EncSequence *EncodeASN1L()const

Encodes a DN into an ASN.1 object tree.

See note in the description of EncodeASN1LC for the explanation of the resulting encoding tree format.

ASN.1 sequence object containing the DN.

EncodeASN1LC()

IMPORT_C CASN1EncSequence *EncodeASN1LC()const

Encodes a DN into an ASN.1 object tree.

Note that the tree has the following format:
         SEQUENCE-OF
             SET-OF
                 SEQUENCE-OF
                     OID
                     value (usually OCTET STRING)
             ...

A SEQUENCE-OF object with a changed tag is used instead of a SET-OF object. This should be all right as long as it contains only one child, because otherwise child order in a SET-OF becomes important.

This function does not introduce an additional dependency on ASN1 library because X500 library already depends on it -- the attribute type/value class stores and manipulated ASN.1 encodings as its values.

ASN.1 sequence object containing the DN, pushed on the cleanup stack.

ExactMatchL(const CX500DistinguishedName &)

IMPORT_C TBoolExactMatchL(const CX500DistinguishedName &aName)const

Compares the specified Distinguished Name object with this Distinguished Name object.

ETrue, if the Distinguished Name objects contain exactly the same 'attribute type and value' objects; EFalse, otherwise.

CX520AttributeTypeAndValue::ExactMatchL()

Parameters

const CX500DistinguishedName & aNameThe Distinguished Name object to be compared.

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises an object of this class to a write stream.

The presence of this function means that the standard templated operator<<() can be used to externalise objects of this class.

Parameters

RWriteStream & aStreamStream to which the object should be externalised.

ExtractFieldL(const TDesC &)

IMPORT_C HBufC *ExtractFieldL(const TDesC &aFieldName)const

Gets the decoded value associated with the specified field/attribute name, from the Distinguished Name.

A heap descriptor containing the decoded value associated with the specified field name.

Parameters

const TDesC & aFieldNameThe field name.

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)[private]

Parameters

RReadStream & aStream

IsWithinSubtreeL(const CX500DistinguishedName &)

IMPORT_C TBoolIsWithinSubtreeL(const CX500DistinguishedName &aName)const

Tests whether all 'attribute type and value' objects contained in the specified Distinguished Name object are also contained within this Distinguished Name object.

This function checks if the elements of iElements are a superset of the fields in aName.

ETrue, if all 'attribute type and value' objects contained in the specified Distinguished Name object are also contained within this Distinguished Name object; EFalse, otherwise.

Parameters

const CX500DistinguishedName & aNameThe Distinguished Name object to be compared.

MatchElementL(const CX520AttributeTypeAndValue &)

IMPORT_C TBoolMatchElementL(const CX520AttributeTypeAndValue &aElement)const

Tests whether this Distinguished Name object contains the specified 'attribute type and value' object.

This function compares each of the elements in iElements with aElement. The comparison is made by the CX520AttributeTypeAndValue::ExactMatchL() function.

ETrue, if the specified 'attribute type and value' object is contained in this Distinguished Name object; EFalse otherwise.

Parameters

const CX520AttributeTypeAndValue & aElementThe 'attribute type and value' object to be checked.

NewL(const TDesC8 &, TInt &)

IMPORT_C CX500DistinguishedName *NewL(const TDesC8 &aBinaryData,
TInt &aPos
)[static]

Creates a new Distinguished Name object from the specified buffer containing the encoded binary representation, starting at the specified offset.

The new Distinguished Name object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.
TInt & aPosThe position from which to start decoding.

NewL(const TDesC8 &)

IMPORT_C CX500DistinguishedName *NewL(const TDesC8 &aBinaryData)[static]

Creates a new Distinguished Name object from the specified buffer containing the encoded binary representation.

Initialises the object from its encoded binary form into an internal representation.

The new Distinguished Name object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.

NewL(RReadStream &)

IMPORT_C CX500DistinguishedName *NewL(RReadStream &aStream)[static]

Creates a new Distinguished Name object from the specified read stream.

Construction is from a stream.

The newDistinguished Name object.

Parameters

RReadStream & aStreamStream from which the contents should be internalised.

NewL(const CArrayPtr< CX520AttributeTypeAndValue > &)

IMPORT_C CX500DistinguishedName *NewL(const CArrayPtr< CX520AttributeTypeAndValue > &aElements)[static]

Creates a new Distinguished Name object from the specified array of 'attribute type and value' objects.

The elements of the specified array are copied into this object.

The new Distinguished Name object.

Parameters

const CArrayPtr< CX520AttributeTypeAndValue > & aElementsThe array of 'attribute type and value' objects to be copied.

NewL(const CX500DistinguishedName &)

IMPORT_C CX500DistinguishedName *NewL(const CX500DistinguishedName &aName)[static]

Creates a new Distinguished Name object from an existing object.

This is equivalent to a copy constructor.

The new Distinguished Name object.

Parameters

const CX500DistinguishedName & aNameThe Distinguished Name object to be copied.

NewLC(const TDesC8 &, TInt &)

IMPORT_C CX500DistinguishedName *NewLC(const TDesC8 &aBinaryData,
TInt &aPos
)[static]

Creates a new Distinguished Name object from the specified buffer containing the encoded binary representation, starting at the specified offset, and puts a pointer to it onto the cleanup stack.

The new Distinguished Name object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.
TInt & aPosThe position from which to start decoding.

NewLC(const TDesC8 &)

IMPORT_C CX500DistinguishedName *NewLC(const TDesC8 &aBinaryData)[static]

Creates a new Distinguished Name object from the specified buffer containing the encoded binary representation, and puts a pointer to it onto the cleanup stack.

Initialises the object from its encoded binary form into an internal representation.

The new Distinguished Name object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.

NewLC(RReadStream &)

IMPORT_C CX500DistinguishedName *NewLC(RReadStream &aStream)[static]

Creates a new Distinguished Name object from the specified read stream, and puts a pointer to it onto the cleanup stack.

The new Distinguished Name object.

Parameters

RReadStream & aStreamStream from which the contents should be internalised.

NewLC(const CArrayPtr< CX520AttributeTypeAndValue > &)

IMPORT_C CX500DistinguishedName *NewLC(const CArrayPtr< CX520AttributeTypeAndValue > &aElements)[static]

Creates a new Distinguished Name object from the specified array of 'attribute type and value' objects, and puts a pointer to it onto the cleanup stack.

The elements of the specified array are copied into this object.

The new Distinguished Name object.

Parameters

const CArrayPtr< CX520AttributeTypeAndValue > & aElementsThe array of 'attribute type and value' objects to be copied.

NewLC(const CX500DistinguishedName &)

IMPORT_C CX500DistinguishedName *NewLC(const CX500DistinguishedName &aName)[static]

Creates a new Distinguished Name object from an existing object, and puts a pointer to it onto the cleanup stack.

This is equivalent to a copy constructor.

The new Distinguished Name object.

Parameters

const CX500DistinguishedName & aNameThe Distinguished Name object to be copied.

Member Data Documentation

CArrayPtrFlat< CX520AttributeTypeAndValue > * iElements

CArrayPtrFlat< CX520AttributeTypeAndValue > *iElements[private]