Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <x509cert.h>
Link against: x509.lib

Class CX509Certificate

class CX509Certificate : public CCertificate;

Description

An X.509 certificate.

Derivation

Members

Defined in CX509Certificate:

Inherited from CBase:

Inherited from CCertificate:

Inherited from CSignedObject:


Construction and destruction


NewL(const TDesC8 &)

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

Description

Creates a new X.509 certificate object from the specified buffer containing the binary coded representation.

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

Return value

CX509Certificate *

The new X.509 certificate object.


NewLC(const TDesC8 &)

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

Description

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

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

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

Return value

CX509Certificate *

The new X.509 certificate object.


NewL(const TDesC8 &,TInt &)

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

Description

Creates a new X.509 certificate object from the specified buffer containing the binary coded representation, starting at the specified offset.

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

TInt &aPos

The offset position from which to start decoding.

Return value

CX509Certificate *

The new X.509 certificate object.


NewLC(const TDesC8 &,TInt &)

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

Description

Creates a new X.509 certificate object from the specified buffer containing the binary coded representation, starting at the specified offset, and puts a pointer to it onto the cleanup stack.

Parameters

const TDesC8 &aBinaryData

The encoded binary representation.

TInt &aPos

The offset position from which to start decoding.

Return value

CX509Certificate *

The new X.509 certificate object.


NewL(RReadStream &)

IMPORT_C static CX509Certificate* NewL(RReadStream &aStream);

Description

Creates a new X.509 certificate object from the specified read stream.

Parameters

RReadStream &aStream

Stream from which the contents should be internalised.

Return value

CX509Certificate *

The new X.509 certificate object.


NewLC(RReadStream &)

IMPORT_C static CX509Certificate* NewLC(RReadStream &aStream);

Description

Creates a new X.509 certificate object from the specified read stream, and puts a pointer to it onto the cleanup stack.

Construction is from the stream.

Parameters

RReadStream &aStream

Stream from which the contents should be internalised.

Return value

CX509Certificate *

The new X.509 certificate object.


NewL(const CX509Certificate &)

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

Description

Creates a new X.509 certificate object from an existing object.

This is equivalent to a copy constructor.

Parameters

const CX509Certificate &aCert

The X.509 certificate to be copied.

Return value

CX509Certificate *

The new X.509 certificate object.


NewLC(const CX509Certificate &)

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

Description

Creates a new X.509 certificate object from an existing object.

This is equivalent to a copy constructor.

Parameters

const CX509Certificate &aCert

The X.509 certificate to be copied.

Return value

CX509Certificate *

The new X.509 certificate object.


~CX509Certificate()

IMPORT_C ~CX509Certificate();

Description

Destructor.

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

[Top]


Member functions


IsEqualL(const CX509Certificate &)const

IMPORT_C TBool IsEqualL(const CX509Certificate &aCert) const;

Description

Tests whether the specified X.509 certificate is equal to this X.509 certificate.

X.509 certificates are equal if both the serial number and the issuer name are the same.

Parameters

const CX509Certificate &aCert

The X.509 certificate to be compared.

Return value

TBool

ETrue, if the certificates are equal;EFalse, otherwise.


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.


Version()const

IMPORT_C TInt Version() const;

Description

Gets the version number of the certificate.

Return value

TInt

The version number of the certificate.


IssuerName()const

IMPORT_C const CX500DistinguishedName& IssuerName() const;

Description

Gets the X.500 Distinguished Name that identifies the issuer.

Return value

const CX500DistinguishedName &

The X.500 Distinguished Name that identifies the issuer.


SubjectName()const

IMPORT_C const CX500DistinguishedName& SubjectName() const;

Description

Gets the X.500 Distinguished Name that identifies the subject.

Return value

const CX500DistinguishedName &

The X.500 Distinguished Name that identifies the subject.


Extensions()const

IMPORT_C const CArrayPtrFlat< CX509CertExtension >& Extensions() const;

Description

Gets all generic certificate extensions.

Return value

const CArrayPtrFlat< CX509CertExtension > &

The certificate extensions.


Extension(const TDesC &)const

IMPORT_C const CX509CertExtension* Extension(const TDesC &aExtensionName) const;

Description

Gets the certificate extension identified by the specified object identifier (OID).

Parameters

const TDesC16 &aExtensionName

The OID identifying the extension.

Return value

const CX509CertExtension *

The certificate extension: Note that ownership is not transferred to the caller.


InternalizeL(RReadStream &)

IMPORT_C virtual void InternalizeL(RReadStream &aStream);

Description

Internalises an object of this class from a read stream.

The presence of this function means that the standard templated operator>>(RReadStream &,T &) can be used to internalise objects of this class.

Note that the function has assignment semantics. It replaces the old value of the object with a new value read from the read stream.

Parameters

RReadStream &aStream

Stream from which the object is to be internalised.


DataElementEncoding(const TUint)const

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

Description

Gets the encoded data for the specified encoded data element (in the To Be Signed (TBS) certificate data structure) of the signed object.

Parameters

const TUint aIndex

The encoded data element position in the TBSCertificate data structure. (See the CX509Certificate enumeration.)

Return value

const TPtrC8 *

The encoded data for the specified data element of the signed object.


IssuerL()const

IMPORT_C virtual HBufC* IssuerL() const;

Description

Gets the issuer of the certificate.

Return value

HBufC16 *

A heap descriptor representing the issuer of the certificate.


SubjectL()const

IMPORT_C virtual HBufC* SubjectL() const;

Description

Gets the subject of the certificate.

Return value

HBufC16 *

A heap descriptor representing the issuer of the certificate.


IsSelfSignedL()const

IMPORT_C virtual TBool IsSelfSignedL() const;

Description

Tests whether the certificate is self-signed.

Return value

TBool

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


KeyIdentifierL()const

IMPORT_C virtual TKeyIdentifier KeyIdentifierL() const;

Description

Gets a key identifier for the certificate. This is a unique identifier, calculated according to the recommended method of computing it from RFC3280, section 4.2.1.2. Please note that this method does NOT return the value of the Subject Key Id extension, if it is present.

Return value

TBuf8

A unique key identifier for the certificate.


SubjectKeyIdentifierL()const

IMPORT_C TKeyIdentifier SubjectKeyIdentifierL() const;

Description

Gets the subject key identifier for the certificate. This identifier is extracted from the certificate (if the corresponding extension exists), or calculated (if the extension doesn't exist). If calculated, the recommendation from section 4.2.1.2, RFC3280 is used (hash of the public key). Please note, that for subject key ids extracted from the certificate there is a length limit - if the extension is longer than 160 bits, it is ignored and the value is calculated instead.

Return value

TBuf8

The subject key identifier for the certificate.

[Top]


Member enumerations


Enum anonymous

n/a

Description

Enumerates values for encoded data element positions in the TBSCertificate data structure.

These values are to be used as parameters to the CX509Certificate::DataElementEncoding(const TUint)const function.

EVersionNumber

ESerialNumber

EAlgorithmId

EIssuerName

EValidityPeriod

ESubjectName

ESubjectPublicKeyInfo

EIssuerUID

ESubjectUID

EExtensionList