CWTLSCertificate Class Reference

class CWTLSCertificate : public CCertificate

Inherits from

Public Member Functions
~CWTLSCertificate()
IMPORT_C const TPtrC8 *DataElementEncoding(const TUint)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsEqualL(const CWTLSCertificate &)
IMPORT_C TBoolIsSelfSignedL()
IMPORT_C TBoolIsTCAL()
IMPORT_C HBufC *IssuerL()
IMPORT_C const CWTLSName &IssuerName()
IMPORT_C CWTLSCertificate *NewL(const TDesC8 &)
IMPORT_C CWTLSCertificate *NewL(const TDesC8 &, TInt &)
IMPORT_C CWTLSCertificate *NewL(RReadStream &)
IMPORT_C CWTLSCertificate *NewL(const CWTLSCertificate &)
IMPORT_C CWTLSCertificate *NewLC(const TDesC8 &)
IMPORT_C CWTLSCertificate *NewLC(const TDesC8 &, TInt &)
IMPORT_C CWTLSCertificate *NewLC(RReadStream &)
IMPORT_C CWTLSCertificate *NewLC(const CWTLSCertificate &)
IMPORT_C const TPtrC8SignedDataL()
IMPORT_C HBufC *SubjectL()
IMPORT_C const CWTLSName &SubjectName()
IMPORT_C TIntVersion()
Private Member Functions
CWTLSCertificate()
voidConstructCertL(const TDesC8 &, TInt &)
voidConstructL(const TDesC8 &, TInt &)
voidConstructL(const CWTLSCertificate &)
voidInitEncodedDataElementsL()
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()
CCertificate::KeyIdentifierL()const
CCertificate::PublicKey()const
CCertificate::SerialNumber()const
CCertificate::ValidityPeriod()const
CCertificate::~CCertificate()
CSignedObject::Encoding()const
CSignedObject::ExternalizeL(RWriteStream &)const
CSignedObject::Fingerprint()const
CSignedObject::SetParametersL(const CSigningKeyParameters &)
CSignedObject::Signature()const
CSignedObject::SigningAlgorithm()const
CSignedObject::VerifyRSASignatureL(const TDesC8 &)const
CSignedObject::VerifyRSASignatureL(const TDesC8 &,const TDesC8 &)const
CSignedObject::VerifySignatureL(const TDesC8 &)const
CSignedObject::VerifySignatureL(const TDesC8 &,const TDesC8 &)const
CSignedObject::~CSignedObject()
Public Member Enumerations
enumanonymous {
EVersionNumber = 0, EAlgorithmId = 1, EIssuerName = 2, EValidityPeriod = 3, ESubjectName = 4, ESubjectPublicKeyInfo = 5
}
Private Attributes
TFixedArray< TPtrC8 *, KWTLSCertMaxDataElements > *iDataElements
CWTLSName *iIssuerName
CWTLSName *iSubjectName
TInt iVersion
Inherited Attributes
CCertificate::iSerialNumber
CCertificate::iSubjectPublicKeyInfo
CCertificate::iValidityPeriod
CSignedObject::iEncoding
CSignedObject::iFingerprint
CSignedObject::iKeyFactory
CSignedObject::iParameters
CSignedObject::iSignature
CSignedObject::iSigningAlgorithm

Constructor & Destructor Documentation

CWTLSCertificate()

CWTLSCertificate()[private]

~CWTLSCertificate()

IMPORT_C~CWTLSCertificate()

Destructor.

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

Member Functions Documentation

ConstructCertL(const TDesC8 &, TInt &)

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

Parameters

const TDesC8 & aBinaryData
TInt & aPos

ConstructL(const TDesC8 &, TInt &)

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

Parameters

const TDesC8 & aBinaryData
TInt & aPos

ConstructL(const CWTLSCertificate &)

voidConstructL(const CWTLSCertificate &aCertificate)[private]

Parameters

const CWTLSCertificate & aCertificate

DataElementEncoding(const TUint)

IMPORT_C const TPtrC8 *DataElementEncoding(const TUintaIndex)const [virtual]

Gets the encoding for a data element at the specified index.

Parameters

const TUint aIndexThe position of the encoded data element.

InitEncodedDataElementsL()

voidInitEncodedDataElementsL()[private]

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)[virtual]

Initialises the certificate from a stream.

This should not be called by client code; instead the static factory function above should be used. If a client is using the certstore component for storage then it should use CCertStore::AddL() for externalizing and CWTLSCert::NewL(CCertStore& aStore, const CCertStoreEntry& aEntry); for restoring.

Parameters

RReadStream & aStream

IsEqualL(const CWTLSCertificate &)

IMPORT_C TBoolIsEqualL(const CWTLSCertificate &aCert)const

Tests whether this WTLS certificate is the same as the specified WTLS certificate.

This is not a simple as it sounds. For X.509 certificates equality means that the issuer name and serial number fields are the same. This guarantees equality since a CA must ensure that every certificate it issues has a unique serial number. But WTLS certificates do not include serial numbers, so there seems to be no definition of equality. This function uses a byte-for-byte comparison of the signatures on the certificates: this should not result in any false positives, but may give false negatives if CAs do naughty things like recertifying the same key (which they have been known to do).

ETrue, if the parameter is the same certificate; EFalse, otherwise.

Parameters

const CWTLSCertificate & aCertA WTLS certificate

IsSelfSignedL()

IMPORT_C TBoolIsSelfSignedL()const [virtual]

Tests whether a certificate is self-signed.

ETrue, if it is self-signed; EFalse, otherwise.

IsTCAL()

IMPORT_C TBoolIsTCAL()const

Tests whether a non-selfsigned certificate can be used to sign others.

Currently this only supports structured text variety of WTLS certificates. Other certificate types will return EFalse.

ETrue, if the certificate is capable of signing other certificates; otherwise, EFalse.

IssuerL()

IMPORT_C HBufC *IssuerL()const [virtual]

Gets the issuer.

A heap descriptor representing the issuer.

IssuerName()

IMPORT_C const CWTLSName &IssuerName()const

Gets the name of the WTLS certificate's issuing authority.

A WTLS name:
  • If the name is an X.500 DN, then if the name contains a Common name, that will be returned. Otherwise, if the name contains an Organization name, that will be returned. Otherwise an empty string will be returned.

  • If the name is of type text, then if the name is not a 'structured' name the entire string will be returned, otherwise the same procedure will be followed as for X.509 certificates.

  • If the name is null an empty string will be returned.

NewL(const TDesC8 &)

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

Creates a new CWTLSCertificate object from the specified buffer containing the binary coded representation.

The new CWTLSCertificate object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.

NewL(const TDesC8 &, TInt &)

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

Creates a new CWTLSCertificate object from the specified buffer containing the binary coded representation.

The new CWTLSCertificate object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.
TInt & aPosAn offset into the descriptor, and is updated to the position at the end of the object.

NewL(RReadStream &)

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

Creates a new CWTLSCertificate object from a stream.

The stream must have been written using the corresponding ExternalizeL() function.

The new CWTLSCertificate object.

Parameters

RReadStream & aStreamThe stream to be used as input.

NewL(const CWTLSCertificate &)

IMPORT_C CWTLSCertificate *NewL(const CWTLSCertificate &aCert)[static]

Creates a new CWTLSCertificate object from an existing one in the certificate store.

The new CWTLSCertificate object.

Parameters

const CWTLSCertificate & aCertThe certificate to be copied.

NewLC(const TDesC8 &)

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

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

The new CWTLSCertificate object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.

NewLC(const TDesC8 &, TInt &)

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

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

The new CWTLSCertificate object.

Parameters

const TDesC8 & aBinaryDataThe encoded binary representation.
TInt & aPosAn offset into the descriptor, and is updated to the position at the end of the object.

NewLC(RReadStream &)

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

Creates a new CWTLSCertificate object from a stream, and puts a pointer to it onto the cleanup stack.

The stream must have been written using the corresponding ExternalizeL() function.

The new CWTLSCertificate object.

Parameters

RReadStream & aStreamThe stream to be used as input.

NewLC(const CWTLSCertificate &)

IMPORT_C CWTLSCertificate *NewLC(const CWTLSCertificate &aCert)[static]

Creates a new CWTLSCertificate object from an existing one in the certificate store, and puts a pointer to it onto the cleanup stack.

The new CWTLSCertificate object.

Parameters

const CWTLSCertificate & aCertThe certificate to be copied.

SignedDataL()

IMPORT_C const TPtrC8SignedDataL()const [virtual]

Gets the certificate's signed data.

A non-modifiable pointer descriptor representing the certificate's signed data.

SubjectL()

IMPORT_C HBufC *SubjectL()const [virtual]

Gets the subject.

A heap descriptor representing the subject.

SubjectName()

IMPORT_C const CWTLSName &SubjectName()const

Gets the name of the owner of the public key the WTLS certificate contains.

A WTLS name.

Version()

IMPORT_C TIntVersion()const

Gets the version number of the WTLS certificate.

The version number of the certificate. Always returns 1.

Member Enumerations Documentation

Enum anonymous

Enumerators

EVersionNumber = 0
EAlgorithmId = 1
EIssuerName = 2
EValidityPeriod = 3
ESubjectName = 4
ESubjectPublicKeyInfo = 5

Member Data Documentation

TFixedArray< TPtrC8 *, KWTLSCertMaxDataElements > * iDataElements

TFixedArray< TPtrC8 *, KWTLSCertMaxDataElements > *iDataElements[private]

CWTLSName * iIssuerName

CWTLSName *iIssuerName[private]

CWTLSName * iSubjectName

CWTLSName *iSubjectName[private]

TInt iVersion

TInt iVersion[private]