Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: signed.h
Link against: crypto.lib

Class CSignedObject

class CSignedObject : public CBase;

Description

Base class for certificates.

Derivation

Members

Defined in CSignedObject:
DataElementEncoding(), Encoding(), ExternalizeL(), Fingerprint(), InternalizeL(), SetParametersL(), Signature(), SignedDataL(), SigningAlgorithm(), VerifySignatureL(), VerifySignatureL(), iEncoding, iFingerprint, iKeyFactory, iParameters, iSignature, iSigningAlgorithm, ~CSignedObject()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CSignedObject()

IMPORT_C ~CSignedObject();

Description

Destructor.

Frees all resources owned by the object.

[Top]


Member functions


VerifySignatureL()

IMPORT_C TBool VerifySignatureL(const TDesC8 &aEncodedKey) const;

Description

Verifies a signature using the specified encoded key.

Parameters

const TDesC8 &aEncodedKey

The encoded key.

Return value

TBool

ETrue if the signature is valid, otherwise EFalse.


VerifySignatureL()

IMPORT_C TBool VerifySignatureL(const TDesC8 &aEncodedKey, const TDesC8 &aHash) const;

Description

Verifies a signature using the specified encoded key and hash.

Parameters

const TDesC8 &aEncodedKey

The encoded key.

const TDesC8 &aHash

The hash of the data to be validated.

Return value

TBool

ETrue if the signature is valid, otherwise EFalse.


Signature()

IMPORT_C const TPtrC8 Signature() const;

Description

Gets the digital signature.

Return value

const TPtrC8

A non-modifiable pointer descriptor representing the digital signature.


SignedDataL()

virtual IMPORT_C const TPtrC8 SignedDataL() const=0;

Description

Gets the signed data.

Return value

const TPtrC8

A non-modifiable pointer descriptor representing the signed data.


Fingerprint()

IMPORT_C const TPtrC8 Fingerprint() const;

Description

Gets the fingerprint.

The fingerprint returned is the SHA1 hash of the encoding of the entire object.

Return value

const TPtrC8

A non-modifiable pointer descriptor representing the finger print.


Encoding()

IMPORT_C const TPtrC8 Encoding() const;

Description

Gets the entire encoding.

Return value

const TPtrC8

A non-modifiable pointer descriptor representing the entire encoding.


SigningAlgorithm()

IMPORT_C const CSigningAlgorithmIdentifier &SigningAlgorithm() const;

Description

Gets the signing algorithm ID used.

Return value

const CSigningAlgorithmIdentifier &

The signing algorithm ID.


ExternalizeL()

virtual IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises the encoding of the entire object to a write stream.

The fingerprint and the signed data can be regenerated after restoration.

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

Parameters

RWriteStream &aStream

Stream to which the object should be externalised.


InternalizeL()

virtual IMPORT_C void InternalizeL(RReadStream &aStream)=0;

Description

Internalises the encoded object from a read stream.

The class makes use of a specification-specific parser class for extracting the various elements, that is provided by a subclass of CSignedObject. For this reason this function is pure virtual.

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

Parameters

RReadStream &aStream

Stream from which the contents of the field should be internalised.


SetParametersL()

IMPORT_C void SetParametersL(const CSigningKeyParameters &aParameters);

Description

Sets the signing key parameters.

Parameters

const CSigningKeyParameters &aParameters

The signing key parameters.


DataElementEncoding()

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

Description

Gets the encoded data for the specified encoded data element, in the (to be signed) tbsCertificate data structure, of the signed object.

Parameters

const TUint aIndex

The encoded data element position in the tbsCertificate data structure. See the enumeration: CX509Certificate::Anonymous.

Return value

const TPtrC8 *

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

[Top]


Member data


iKeyFactory

protected: TKeyFactory * iKeyFactory;

Description

A pointer to a key factory object.


iEncoding

protected: HBufC8 * iEncoding;

Description

A heap descriptor representing the entire encoding.


iSignature

protected: HBufC8 * iSignature;

Description

The digital signature.


iFingerprint

protected: HBufC8 * iFingerprint;

Description

The fingerprint.

The SHA1 hash of the encoding of the entire object.


iParameters

protected: CSigningKeyParameters * iParameters;

Description

The signing key parameters


iSigningAlgorithm

protected: CSigningAlgorithmIdentifier * iSigningAlgorithm;

Description

The signing algorithm ID.