CX509Certificate Class Reference

#include <x509cert.h>

class CX509Certificate : public CCertificate

Inherits from

Public Member Enumerations
enumanonymous { EVersionNumber, ESerialNumber, EAlgorithmId, EIssuerName, ..., EExtensionList }
Public Member Functions
~CX509Certificate()
virtual IMPORT_C const TPtrC8 *DataElementEncoding(const TUint)
IMPORT_C const CX509CertExtension *Extension(const TDesC &)
IMPORT_C const CArrayPtrFlat< CX509CertExtension > &Extensions()
virtual IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsEqualL(const CX509Certificate &)
virtual IMPORT_C TBoolIsSelfSignedL()
virtual IMPORT_C HBufC *IssuerL()
IMPORT_C const CX500DistinguishedName &IssuerName()
virtual IMPORT_C TKeyIdentifierKeyIdentifierL()
IMPORT_C CX509Certificate *NewL(const TDesC8 &)
IMPORT_C CX509Certificate *NewL(const TDesC8 &, TInt &)
IMPORT_C CX509Certificate *NewL(RReadStream &)
IMPORT_C CX509Certificate *NewL(const CX509Certificate &)
IMPORT_C CX509Certificate *NewLC(const TDesC8 &)
IMPORT_C CX509Certificate *NewLC(const TDesC8 &, TInt &)
IMPORT_C CX509Certificate *NewLC(RReadStream &)
IMPORT_C CX509Certificate *NewLC(const CX509Certificate &)
virtual IMPORT_C const TPtrC8SignedDataL()
IMPORT_C TKeyIdentifierSubjectKeyIdL()
IMPORT_C TKeyIdentifierSubjectKeyIdentifierL()
virtual IMPORT_C HBufC *SubjectL()
IMPORT_C const CX500DistinguishedName &SubjectName()
IMPORT_C TIntVersion()
Inherited Attributes
CCertificate::iSerialNumber
CCertificate::iSubjectPublicKeyInfo
CCertificate::iValidityPeriod
CSignedObject::iEncoding
CSignedObject::iFingerprint
CSignedObject::iKeyFactory
CSignedObject::iParameters
CSignedObject::iSignature
CSignedObject::iSigningAlgorithm
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::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()

Detailed Description

An X.509 certificate.

Since
v6.0

Member Enumeration Documentation

Enum anonymous

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

These values are to be used as parameters to the DataElementEncoding() function.

Constructor & Destructor Documentation

~CX509Certificate ( )

IMPORT_C~CX509Certificate()

Destructor.

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

Member Function Documentation

DataElementEncoding ( const TUint )

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

Reimplemented from CSignedObject::DataElementEncoding(const TUint)const

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

Since
v7.0
Parameters
aIndexThe encoded data element position in the TBSCertificate data structure. (See the CX509Certificate enumeration.)
Return Value
The encoded data for the specified data element of the signed object.

Extension ( const TDesC & )

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

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

Parameters
aExtensionNameThe OID identifying the extension.
Return Value
The certificate extension: Note that ownership is not transferred to the caller.

Extensions ( )

IMPORT_C const CArrayPtrFlat< CX509CertExtension > &Extensions()const

Gets all generic certificate extensions.

Return Value
The certificate extensions.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)[virtual]

Reimplemented from CSignedObject::InternalizeL(RReadStream &)

Internalises an object of this class from a read stream.

The presence of this function means that the standard templated operator>>() 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
aStreamStream from which the object is to be internalised.

IsEqualL ( const CX509Certificate & )

IMPORT_C TBoolIsEqualL(const CX509Certificate &aCert)const

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
aCertThe X.509 certificate to be compared.
Return Value
ETrue, if the certificates are equal;EFalse, otherwise.

IsSelfSignedL ( )

IMPORT_C TBoolIsSelfSignedL()const [virtual]

Reimplemented from CCertificate::IsSelfSignedL()const

Tests whether the certificate is self-signed.

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

IssuerL ( )

IMPORT_C HBufC *IssuerL()const [virtual]

Reimplemented from CCertificate::IssuerL()const

Gets the issuer of the certificate.

If the certificate has decoded the members from TeletexString then the return value may be incorrect because TeletexString type is not fully supported by this library. Instead the decode methods perform a direct conversion from 8 to 16bits by adding null characters in the second byte of each character. This will work as expected for cases where the string contains ASCII data.

Return Value
A heap descriptor representing the issuer of the certificate.

IssuerName ( )

IMPORT_C const CX500DistinguishedName &IssuerName()const

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

If the certificate has decoded the members from TeletexString then the return value may be incorrect because TeletexString type is not fully supported by this library. Instead the decode methods perform a direct conversion from 8 to 16bits by adding null characters in the second byte of each character. This will work as expected for cases where the string contains ASCII data.

Return Value
The X.500 Distinguished Name that identifies the issuer.

KeyIdentifierL ( )

IMPORT_C TKeyIdentifierKeyIdentifierL()const [virtual]

Reimplemented from CCertificate::KeyIdentifierL()const

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
A unique key identifier for the certificate.

NewL ( const TDesC8 & )

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

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

Parameters
aBinaryDataThe encoded binary representation.
Return Value
The new X.509 certificate object.

NewL ( const TDesC8 &, TInt & )

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

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

Parameters
aBinaryDataThe encoded binary representation.
aPosThe offset position from which to start decoding.
Return Value
The new X.509 certificate object.

NewL ( RReadStream & )

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

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

Parameters
aStreamStream from which the contents should be internalised.
Return Value
The new X.509 certificate object.

NewL ( const CX509Certificate & )

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

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

This is equivalent to a copy constructor.

Parameters
aCertThe X.509 certificate to be copied.
Return Value
The new X.509 certificate object.

NewLC ( const TDesC8 & )

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

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
aBinaryDataThe encoded binary representation.
Return Value
The new X.509 certificate object.

NewLC ( const TDesC8 &, TInt & )

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

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
aBinaryDataThe encoded binary representation.
aPosThe offset position from which to start decoding.
Return Value
The new X.509 certificate object.

NewLC ( RReadStream & )

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

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
aStreamStream from which the contents should be internalised.
Return Value
The new X.509 certificate object.

NewLC ( const CX509Certificate & )

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

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

This is equivalent to a copy constructor.

Parameters
aCertThe X.509 certificate to be copied.
Return Value
The new X.509 certificate object.

SignedDataL ( )

IMPORT_C const TPtrC8SignedDataL()const [virtual]

Reimplemented from CSignedObject::SignedDataL()const

Gets the certificate's signed data.

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

SubjectKeyIdL ( )

IMPORT_C TKeyIdentifierSubjectKeyIdL()const

Retrieves the subject key identifier of a certificate based on the decision whether it is a CA certificate or not. If it is a CA certificate then returns the stored subject key id as an extension in the certificate, any other certificate it returns the keyidentifier as calculated by Symbian's proprietary logic.

Return Value
The subject key identifier for the certificate.

SubjectKeyIdentifierL ( )

IMPORT_C TKeyIdentifierSubjectKeyIdentifierL()const

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
The subject key identifier for the certificate.

SubjectL ( )

IMPORT_C HBufC *SubjectL()const [virtual]

Reimplemented from CCertificate::SubjectL()const

Gets the subject of the certificate.

If the certificate has decoded the members from TeletexString then the return value may be incorrect because TeletexString type is not fully supported by this library. Instead the decode methods perform a direct conversion from 8 to 16bits by adding null characters in the second byte of each character. This will work as expected for cases where the string contains ASCII data.

Return Value
A heap descriptor representing the issuer of the certificate.

SubjectName ( )

IMPORT_C const CX500DistinguishedName &SubjectName()const

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

If the certificate has decoded the members from TeletexString then the return value may be incorrect because TeletexString type is not fully supported by this library. Instead the decode methods perform a direct conversion from 8 to 16bits by adding null characters in the second byte of each character. This will work as expected for cases where the string contains ASCII data.

Return Value
The X.500 Distinguished Name that identifies the subject.

Version ( )

IMPORT_C TIntVersion()const

Gets the version number of the certificate.

Return Value
The version number of the certificate.