Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <wtlscert.h>
Link against: wtlscert.lib

Class CWTLSCertificate

class CWTLSCertificate : public CCertificate;

Description

Derivation

Members

Defined in CWTLSCertificate:

Inherited from CBase:

Inherited from CCertificate:

Inherited from CSignedObject:


Construction and destruction


NewL(const TDesC8 &)

IMPORT_C static CWTLSCertificate* NewL(const TDesC8 &aBinaryData);

Description

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

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewLC(const TDesC8 &)

IMPORT_C static CWTLSCertificate* NewLC(const TDesC8 &aBinaryData);

Description

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

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewL(const TDesC8 &,TInt &)

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

Description

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

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

TInt &aPos

An offset into the descriptor, and is updated to the position at the end of the object.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewLC(const TDesC8 &,TInt &)

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

Description

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

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

TInt &aPos

An offset into the descriptor, and is updated to the position at the end of the object.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewL(RReadStream &)

IMPORT_C static CWTLSCertificate* NewL(RReadStream &aStream);

Description

Creates a new CWTLSCertificate object from a stream.

The stream must have been written using the corresponding CSignedObject::ExternalizeL(RWriteStream &)const function.

Parameters

RReadStream &aStream

The stream to be used as input.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewLC(RReadStream &)

IMPORT_C static CWTLSCertificate* NewLC(RReadStream &aStream);

Description

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 CSignedObject::ExternalizeL(RWriteStream &)const function.

Parameters

RReadStream &aStream

The stream to be used as input.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewL(const CWTLSCertificate &)

IMPORT_C static CWTLSCertificate* NewL(const CWTLSCertificate &aCert);

Description

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

Parameters

const CWTLSCertificate &aCert

The certificate to be copied.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


NewLC(const CWTLSCertificate &)

IMPORT_C static CWTLSCertificate* NewLC(const CWTLSCertificate &aCert);

Description

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

Parameters

const CWTLSCertificate &aCert

The certificate to be copied.

Return value

CWTLSCertificate *

The new CWTLSCertificate object.


~CWTLSCertificate()

IMPORT_C ~CWTLSCertificate();

Description

Destructor.

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

[Top]


Member functions


IsEqualL(const CWTLSCertificate &)const

IMPORT_C TBool IsEqualL(const CWTLSCertificate &aCert) const;

Description

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).

Parameters

const CWTLSCertificate &aCert

A WTLS certificate

Return value

TBool

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


Version()const

IMPORT_C TInt Version() const;

Description

Gets the version number of the WTLS certificate.

Return value

TInt

The version number of the certificate. Always returns 1.


IssuerName()const

IMPORT_C const CWTLSName& IssuerName() const;

Description

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

Return value

const CWTLSName &

A WTLS name:


SubjectName()const

IMPORT_C const CWTLSName& SubjectName() const;

Description

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

Return value

const CWTLSName &

A WTLS name.


IsSelfSignedL()const

IMPORT_C virtual TBool IsSelfSignedL() const;

Description

Tests whether a certificate is self-signed.

Return value

TBool

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


SubjectL()const

IMPORT_C virtual HBufC* SubjectL() const;

Description

Gets the subject.

Return value

HBufC16 *

A heap descriptor representing the subject.


IssuerL()const

IMPORT_C virtual HBufC* IssuerL() const;

Description

Gets the issuer.

Return value

HBufC16 *

A heap descriptor representing the issuer.


InternalizeL(RReadStream &)

IMPORT_C virtual void InternalizeL(RReadStream &aStream);

Description

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


SignedDataL()const

IMPORT_C virtual const TPtrC8 SignedDataL() const;

Description

Gets the certificate's signed data.

Return value

const TPtrC8

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


DataElementEncoding(const TUint)const

IMPORT_C virtual const TPtrC8* DataElementEncoding(const TUint aIndex) const;

Description

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

Parameters

const TUint aIndex

The position of the encoded data element.

Return value

const TPtrC8 *


IsTCAL()const

IMPORT_C TBool IsTCAL() const;

Description

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.

Return value

TBool

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

[Top]


Member enumerations


Enum anonymous

n/a

Description

EVersionNumber

EAlgorithmId

EIssuerName

EValidityPeriod

ESubjectName

ESubjectPublicKeyInfo