CCmsSignedObject Class Reference

class CCmsSignedObject : public CSignedObject

A representation of a RFC2630 (signed data) entity.

Inherits from

Public Member Functions
~CCmsSignedObject ()
IMPORT_C void AddCertificateL (const CX509Certificate &)
IMPORT_C void AddCertificateL (const TDesC8 &, CCmsCertificateChoice::TCertificateType )
IMPORT_C const RPointerArray < CCmsCertificateChoice > & Certificates ()
IMPORT_C const CEncapsulatedContentInfo & ContentInfo ()
IMPORT_C const TPtrC8 * DataElementEncoding (const TUint )
IMPORT_C const RPointerArray < CX509AlgorithmIdentifier > & DigestAlgorithms ()
IMPORT_C CASN1EncSequence * EncodeASN1DERLC ()
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TBool IsCertificateRevocationListsPresent ()
IMPORT_C TBool IsCertificateSetPresent ()
IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType , TBool , const TDesC8 &)
IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CDSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CRSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C CCmsSignedObject * NewL (const CCmsContentInfo &)
IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType , TBool , const TDesC8 &)
IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CDSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CRSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C CCmsSignedObject * NewLC (const CCmsContentInfo &)
IMPORT_C void SignL (const TDesC8 &, TAlgorithmId , const CDSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C void SignL (const TDesC8 &, TAlgorithmId , const CRSAPrivateKey &, const CX509Certificate &, TBool )
IMPORT_C const TPtrC8 SignedDataL ()
IMPORT_C const RPointerArray < CCmsSignerInfo > & SignerInfo ()
IMPORT_C TBool ValidateSignerLC (const CCmsSignerInfo &, HBufC8 *&)
IMPORT_C TBool ValidateSignerLC (const CCmsSignerInfo &, const RPointerArray < CX509Certificate > &, HBufC8 *&)
IMPORT_C TBool ValidateSignerLC (const CCmsSignerInfo &, HBufC8 *&, TBool , const TDesC8 &)
IMPORT_C TBool ValidateSignerLC (const CCmsSignerInfo &, const RPointerArray < CX509Certificate > &, HBufC8 *&, TBool , const TDesC8 &)
IMPORT_C TInt Version ()
Private Member Functions
CCmsSignedObject ()
void AddDigestAlgorithmL ( TAlgorithmId )
CCmsSignerIdentifier * BuildSignerIdentifierLC (const CX509Certificate &)
void BuildSignerInfoCertListAndAlgoritmListL ( TAlgorithmId , TBool , const TDesC8 &, const CDSAPrivateKey &, const CX509Certificate &, TBool )
void BuildSignerInfoCertListAndAlgoritmListL ( TAlgorithmId , TBool , const TDesC8 &, const CRSAPrivateKey &, const CX509Certificate &, TBool )
void ConstructL (const CCmsContentInfo &)
void ConstructL ( TCmsContentInfoType , TBool , const TDesC8 &)
void ConstructL ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CDSAPrivateKey &, const CX509Certificate &, TBool )
void ConstructL ( TCmsContentInfoType , const TDesC8 &, TAlgorithmId , const CRSAPrivateKey &, const CX509Certificate &, TBool )
void DecodeCertificatesL (const TDesC8 &)
void DecodeDigestAlgorithmsL (const TDesC8 &)
void DecodeEncapsulatedContentInfoL (const TDesC8 &)
void DecodeRevocationListsL (const TDesC8 &)
void DecodeSignedDataL (const TDesC8 &)
void DecodeSignerInfoL (const TDesC8 &)
CASN1EncBase * EncodeAlgorithmsLC ()
CASN1EncBase * EncodeCertificatesLC ()
CASN1EncBase * EncodeSignerInfoLC ()
void InitSignedObjectL (const TDesC8 &)
void SetContentData (const TDesC8 &)
void SetHash (const TDesC8 &)
TBool ValidateSignatureL (const CCmsSignerInfo &, const CX509Certificate &)
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()
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
enum anonymous {
EVersionNumber  = 0, EDigestAlgorithms  = 1, EEncapsulatedContentInfo  = 2, ECertificates  = 3, ERevocationLists  = 4, ESignedInfo  = 5
}
Private Attributes
RPointerArray < CCmsCertificateChoice > iCertificates
TPtrC8 iContentData
CEncapsulatedContentInfo * iContentInfo
TFixedArray < TPtrC8 *, KCmsMaxSignedDataElements > iDataElements
RPointerArray < CX509AlgorithmIdentifier > iDigestAlgorithms
TPtrC8 iHash
TBool iIsCertificateRevocationListsPresent
TBool iIsCertificateSetPresent
RPointerArray < CCmsSignerInfo > iSignerInfo
TInt iVersion
Inherited Attributes
CSignedObject::iEncoding
CSignedObject::iFingerprint
CSignedObject::iKeyFactory
CSignedObject::iParameters
CSignedObject::iSignature
CSignedObject::iSigningAlgorithm

Constructor & Destructor Documentation

CCmsSignedObject()

CCmsSignedObject ( ) [private]

Constructor

~CCmsSignedObject()

IMPORT_C ~CCmsSignedObject ( )

Destructor

Member Functions Documentation

AddCertificateL(const CX509Certificate &)

IMPORT_C void AddCertificateL ( const CX509Certificate & aCert )

Appends the X509 certificate to the certificate list.

Parameters

const CX509Certificate & aCert The X509 certificate to be appended.

AddCertificateL(const TDesC8 &, CCmsCertificateChoice::TCertificateType)

IMPORT_C void AddCertificateL ( const TDesC8 & aCert,
CCmsCertificateChoice::TCertificateType aType
)

Appends an encoded attribute certificate to the certificate list.

Parameters

const TDesC8 & aCert The encoded certificate to be appended.
CCmsCertificateChoice::TCertificateType aType The type of the encoded certificate..

AddDigestAlgorithmL(TAlgorithmId)

void AddDigestAlgorithmL ( TAlgorithmId aDigestAlgorithm ) [private]

Append the algorithm to the algoritm list

Parameters

TAlgorithmId aDigestAlgorithm the algorithm ID.

BuildSignerIdentifierLC(const CX509Certificate &)

CCmsSignerIdentifier * BuildSignerIdentifierLC ( const CX509Certificate & aCert ) [private]

Build the signer's identifier from the signer's certificate. If the signer's certificate contains the subject identifier extension, the signer identifier is subject id extension. otherwise, the signer identifier is isuuer name and serial number.

Parameters

const CX509Certificate & aCert the signer's certificate.

BuildSignerInfoCertListAndAlgoritmListL(TAlgorithmId, TBool, const TDesC8 &, const CDSAPrivateKey &, const CX509Certificate &, TBool)

void BuildSignerInfoCertListAndAlgoritmListL ( TAlgorithmId aDigestAlgorithm,
TBool aIsHash,
const TDesC8 & aValue,
const CDSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [private]

Build the signer list, algorithm list and certificate list in the CMS signer data.

Parameters

TAlgorithmId aDigestAlgorithm the digest algorithm identifier.
TBool aIsHash A flag the represent if the next descriptor is the hash value rather that original data
const TDesC8 & aValue the data content or its hash.
const CDSAPrivateKey & aKey the DSA private used to sign.
const CX509Certificate & aCert the signer's certificate
TBool aAddCertificate the flag to represent if the certificate is added to the certificate set

BuildSignerInfoCertListAndAlgoritmListL(TAlgorithmId, TBool, const TDesC8 &, const CRSAPrivateKey &, const CX509Certificate &, TBool)

void BuildSignerInfoCertListAndAlgoritmListL ( TAlgorithmId aDigestAlgorithm,
TBool aIsHash,
const TDesC8 & aValue,
const CRSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [private]

Build the signer list, algorithm list and certificate list in the CMS signer data.

Parameters

TAlgorithmId aDigestAlgorithm the digest algorithm identifier.
TBool aIsHash A flag the represent if the next descriptor is the hash value rather that original data
const TDesC8 & aValue the data content or its hash.
const CRSAPrivateKey & aKey the RSA private used to sign.
const CX509Certificate & aCert the signer's certificate
TBool aAddCertificate the flag to represent if the certificate is added to the certificate set

Certificates()

IMPORT_C const RPointerArray < CCmsCertificateChoice > & Certificates ( ) const

Returns the certificates list.

ConstructL(const CCmsContentInfo &)

void ConstructL ( const CCmsContentInfo & aContentInfo ) [private]

Second phase constructor for decoding a CMS signed data object

Parameters

const CCmsContentInfo & aContentInfo the content info which contains the CMS signed data.

ConstructL(TCmsContentInfoType, TBool, const TDesC8 &)

void ConstructL ( TCmsContentInfoType aType,
TBool aIsDetached,
const TDesC8 & aContentData
) [private]

Second phase constructor for constructing a CMS signed data object from data content.

Parameters

TCmsContentInfoType aType the encapsulated content info type.
TBool aIsDetached if the CMS signed data does not contains the data content being signed.
const TDesC8 & aContentData the content data descriptor.

ConstructL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)

void ConstructL ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CDSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [private]

Second phase constructor for constructing a CMS signed data object from data content hash

Parameters

TCmsContentInfoType aType the encapsulated content info type.
const TDesC8 & aHashValue the hash of the data content to create the signature.
TAlgorithmId aDigestAlgorithm the digest algorithm.
const CDSAPrivateKey & aKey the DSA private to create signature.
const CX509Certificate & aCert the signer's certficate
TBool aAddCertificate a flag to represent if the signer's certificate is added to certificate set.

ConstructL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)

void ConstructL ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CRSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [private]

Second phase constructor for constructing a CMS signed data object from data content hash

Parameters

TCmsContentInfoType aType the encapsulated content info type.
const TDesC8 & aHashValue the hash of the data content to create the signature.
TAlgorithmId aDigestAlgorithm the digest algorithm.
const CRSAPrivateKey & aKey the RSA private to create signature.
const CX509Certificate & aCert the signer's certficate
TBool aAddCertificate a flag to represent if the signer's certificate is added to certificate set.

ContentInfo()

IMPORT_C const CEncapsulatedContentInfo & ContentInfo ( ) const

Returns the encapsulated content info of this signed object.

DataElementEncoding(const TUint)

IMPORT_C const TPtrC8 * DataElementEncoding ( const TUint aIndex ) const [virtual]

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.

DecodeCertificatesL(const TDesC8 &)

void DecodeCertificatesL ( const TDesC8 & aRawData ) [private]

Decode the certificate set.

Parameters

const TDesC8 & aRawData

DecodeDigestAlgorithmsL(const TDesC8 &)

void DecodeDigestAlgorithmsL ( const TDesC8 & aRawData ) [private]

Decode the digest algorithm set.

Parameters

const TDesC8 & aRawData

DecodeEncapsulatedContentInfoL(const TDesC8 &)

void DecodeEncapsulatedContentInfoL ( const TDesC8 & aRawData ) [private]

Decode the encapsulated content info

Parameters

const TDesC8 & aRawData

DecodeRevocationListsL(const TDesC8 &)

void DecodeRevocationListsL ( const TDesC8 & aRawData ) [private]

Decode the certificate revocation set. Not implemented now!

Parameters

const TDesC8 & aRawData

DecodeSignedDataL(const TDesC8 &)

void DecodeSignedDataL ( const TDesC8 & aRawData ) [private]

Decode the CMS Signer data.

Parameters

const TDesC8 & aRawData the raw data of the CMS signed data.

DecodeSignerInfoL(const TDesC8 &)

void DecodeSignerInfoL ( const TDesC8 & aRawData ) [private]

Decode the signer info set.

Parameters

const TDesC8 & aRawData

DigestAlgorithms()

IMPORT_C const RPointerArray < CX509AlgorithmIdentifier > & DigestAlgorithms ( ) const

Returns the employed algorithm list.

EncodeASN1DERLC()

IMPORT_C CASN1EncSequence * EncodeASN1DERLC ( ) const

Creates the ASN1 sequence of this CMS signed object and leaves it on the cleanup stack.

EncodeAlgorithmsLC()

CASN1EncBase * EncodeAlgorithmsLC ( ) const [private]

Encode the algorithm set

EncodeCertificatesLC()

CASN1EncBase * EncodeCertificatesLC ( ) const [private]

Encode the certificate set

EncodeSignerInfoLC()

CASN1EncBase * EncodeSignerInfoLC ( ) const [private]

Encode the signer info set

InitSignedObjectL(const TDesC8 &)

void InitSignedObjectL ( const TDesC8 & aRawData ) [private]

Initialise the signed data base class members for the validation process.

Parameters

const TDesC8 & aRawData the raw data of the CMS signed data.

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream ) [virtual]

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.

IsCertificateRevocationListsPresent()

IMPORT_C TBool IsCertificateRevocationListsPresent ( ) const

Returns whether the certificate revocation list exists.

IsCertificateSetPresent()

IMPORT_C TBool IsCertificateSetPresent ( ) const

Returns whether the certificate list exists.

NewL(TCmsContentInfoType, TBool, const TDesC8 &)

IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType aType,
TBool aIsDetached,
const TDesC8 & aContentData
) [static]

Creates a CMS signed data object as defined in RFC2630. The CMS signed data created by this API contains no signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType The type of the encapsulated content.
TBool aIsDetached A boolean indicating whether the encapsulated data is detached.
const TDesC8 & aContentData The encapsulated data. If aIsDetached is EFalse, aContentData must not be KNullDesC8. Otherwise this API leave with KErrArgument. If aIsDetached is ETrue, aContentData can be KNullDesC8. But user must provide hash value when later calling SignL(). Otherwise SignL() leaves with KErrArguement.

NewL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CDSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [static]

Creates a CMS signed data object as defined in RFC2630. This API only creates detached signed data as no data content is provided. The CMS signed data created by this API contains one signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType Encapsulated Content data type.
const TDesC8 & aHashValue The hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CDSAPrivateKey & aKey The DSA private key used to sign.
const CX509Certificate & aCert The signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

NewL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C CCmsSignedObject * NewL ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CRSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [static]

Creates a CMS signed data object as defined in RFC2630. This API only creates detached signed data as no data content is provided. The CMS signed data created by this API contains one signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType Encapsulated Content data type.
const TDesC8 & aHashValue The hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CRSAPrivateKey & aKey The RSA private key used to sign.
const CX509Certificate & aCert aCert The signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

NewL(const CCmsContentInfo &)

IMPORT_C CCmsSignedObject * NewL ( const CCmsContentInfo & aContentInfo ) [static]

Creates a CMS signed data object as defined in RFC2630.

Parameters

const CCmsContentInfo & aContentInfo The CMS content info that contains the encoded signed object.

NewLC(TCmsContentInfoType, TBool, const TDesC8 &)

IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType aType,
TBool aIsDetached,
const TDesC8 & aContentData
) [static]

Creates a CMS signed data object as defined in RFC2630, and leaves the object on the cleanup stack. this API contains no signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType The type of the encapsulated content.
TBool aIsDetached A boolean indicating whether the encapsulated data is detached.
const TDesC8 & aContentData The encapsulated data. If aIsDetached is EFalse, aContentData must not be KNullDesC8. Otherwise this API leave with KErrArgument. If aIsDetached is ETrue, aContentData can be KNullDesC8. But user must provide hash value when later calling SignL(). Otherwise SignL() leaves with KErrArguement.

NewLC(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CDSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [static]

Creates a CMS signed data object as defined in RFC2630 and leaves the object on the cleanup stack. This API only creates detached signed data as no data content is provided. The CMS signed data created by this API contains one signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType Encapsulated Content data type.
const TDesC8 & aHashValue The hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CDSAPrivateKey & aKey The DSA private key used to sign.
const CX509Certificate & aCert The signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

NewLC(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C CCmsSignedObject * NewLC ( TCmsContentInfoType aType,
const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CRSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
) [static]

Creates a CMS signed data object as defined in RFC2630 and leaves the object on the cleanup stack. This API only creates detached signed data as no data content is provided. The CMS signed data created by this API contains one signer info. SignL() method can be called to add more signer info.

Parameters

TCmsContentInfoType aType Encapsulated Content data type.
const TDesC8 & aHashValue The hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CRSAPrivateKey & aKey The RSA private key used to sign.
const CX509Certificate & aCert The signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

NewLC(const CCmsContentInfo &)

IMPORT_C CCmsSignedObject * NewLC ( const CCmsContentInfo & aContentInfo ) [static]

Creates a CMS signed data object as defined in RFC2630 and leaves it on the cleanup stack.

Parameters

const CCmsContentInfo & aContentInfo The CMS content info that contains the encoded signed object.

SetContentData(const TDesC8 &)

void SetContentData ( const TDesC8 & aContentData ) [private]

This function is called when validating a detached CMS signed object. It sets the data content being signed so that the signed data can be validated.

Parameters

const TDesC8 & aContentData The data content being signed.

SetHash(const TDesC8 &)

void SetHash ( const TDesC8 & aHash ) [private]

This function is called when validating a detached CMS signed object. It sets the hash being signed so that the signed data can be validated.

Parameters

const TDesC8 & aHash The hash being signed.

SignL(const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C void SignL ( const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CDSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
)
Creates one signature and adds it to the Signer info list. The signing certificate is added to the certificate list if the last boolean parameter aAddCertificate is true and it does not exist in the list. The digest algorithm is added to the digest algorithm list if it does not exist in the list. Calling this API multiple times will create multiple signatures.
leave
KErrArgument if no hash nor data content is provided.

Parameters

const TDesC8 & aHashValue The hash value to be signed. If this is an empty string, the content data to be signed must have been passed in via NewL method and hash value will be calculated by the implementation of this method.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CDSAPrivateKey & aKey the DSA private key used to sign.
const CX509Certificate & aCert the signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

SignL(const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)

IMPORT_C void SignL ( const TDesC8 & aHashValue,
TAlgorithmId aDigestAlgorithm,
const CRSAPrivateKey & aKey,
const CX509Certificate & aCert,
TBool aAddCertificate
)
Creates one signature and adds it to the Signer info list. The signing certificate is added to the certificate list if the last boolean parameter aAddCertificate is true and it does not exist in the list. The digest algorithm is added to the digest algorithm list if it does not exist in the list. Calling this API multiple times will create multiple signatures.
leave
KErrArgument if no hash nor data content is provided.

Parameters

const TDesC8 & aHashValue The hash value to be signed. If this is an empty string, the content data to be signed must have been passed in via NewL method and hash value will be calculated by the implementation of this method.
TAlgorithmId aDigestAlgorithm The digest algorithm used to create the hash.
const CRSAPrivateKey & aKey the RSA private key used to sign.
const CX509Certificate & aCert the signer's certificate.
TBool aAddCertificate A boolean indicating whether the signer's certificate is added to the signed data object.

SignedDataL()

IMPORT_C const TPtrC8 SignedDataL ( ) const [virtual]

Gets the signed data.

SignerInfo()

IMPORT_C const RPointerArray < CCmsSignerInfo > & SignerInfo ( ) const

Retrieves the list of SignerInfo objects.

ValidateSignatureL(const CCmsSignerInfo &, const CX509Certificate &)

TBool ValidateSignatureL ( const CCmsSignerInfo & aSignerInfo,
const CX509Certificate & aEndEntityCert
) [private]

Validate the signature by the given certificate.

Parameters

const CCmsSignerInfo & aSignerInfo the signer info reference contains the signature
const CX509Certificate & aEndEntityCert the certificate used to create the signature.

ValidateSignerLC(const CCmsSignerInfo &, HBufC8 *&)

IMPORT_C TBool ValidateSignerLC ( const CCmsSignerInfo & aSignerInfo,
HBufC8 *& aCertChainEncoding
)
Validates the signer and creates the certificate chain for that signer. This API is used to validate attached signature.
leave
KErrNotFound There is no matching certificate.

Parameters

const CCmsSignerInfo & aSignerInfo The signer to be validated.
HBufC8 *& aCertChainEncoding The certificate chain. This is created and pushed onto the cleanup stack by the function.

ValidateSignerLC(const CCmsSignerInfo &, const RPointerArray< CX509Certificate > &, HBufC8 *&)

IMPORT_C TBool ValidateSignerLC ( const CCmsSignerInfo & aSignerInfo,
const RPointerArray < CX509Certificate > & aCertificates,
HBufC8 *& aCertChainEncoding
)
Validates the signer and creates the certificate chain for that signer. This API is used to validate attached signature.
leave
KErrNotFound There is no matching certificate.

Parameters

const CCmsSignerInfo & aSignerInfo The signer to be validated.
const RPointerArray < CX509Certificate > & aCertificates The certificate list provided by the user to validate the signature.
HBufC8 *& aCertChainEncoding The certificate chain. This is created and pushed onto the cleanup stack by the function.

ValidateSignerLC(const CCmsSignerInfo &, HBufC8 *&, TBool, const TDesC8 &)

IMPORT_C TBool ValidateSignerLC ( const CCmsSignerInfo & aSignerInfo,
HBufC8 *& aCertChainEncoding,
TBool aIsHash,
const TDesC8 & aContentDataOrHash
)
Validates the signer and creates the certificate chain for that signer. This API is used to validate detached signature.
leave
KErrNotFound There is no matching certificate.

Parameters

const CCmsSignerInfo & aSignerInfo The signer to be validated.
HBufC8 *& aCertChainEncoding The certificate chain. This is created and pushed onto the cleanup stack by the function.
TBool aIsHash The flag represent if the next parameter is the hash of the data content.
const TDesC8 & aContentDataOrHash the descriptor that contains the data content or its hash

ValidateSignerLC(const CCmsSignerInfo &, const RPointerArray< CX509Certificate > &, HBufC8 *&, TBool, const TDesC8 &)

IMPORT_C TBool ValidateSignerLC ( const CCmsSignerInfo & aSignerInfo,
const RPointerArray < CX509Certificate > & aCertificates,
HBufC8 *& aCertChainEncoding,
TBool aIsHash,
const TDesC8 & aContentDataOrHash
)
Validates the signer and creates the certificate chain for that signer. This API is used to validate detached signature.
leave
KErrNotFound There is no matching certificate.

Parameters

const CCmsSignerInfo & aSignerInfo The signer to be validated.
const RPointerArray < CX509Certificate > & aCertificates The certificate list provided by the user to validate the signature.
HBufC8 *& aCertChainEncoding The certificate chain. This is created and pushed onto the cleanup stack by the function.
TBool aIsHash The flag represent if the next parameter is the hash of the data content.
const TDesC8 & aContentDataOrHash the descriptor that contains the data content or its hash

Version()

IMPORT_C TInt Version ( ) const

Returns the version of this CMS signed object.

Member Enumerations Documentation

Enum anonymous

Index of CMS object fields.

Enumerators

EVersionNumber = 0

Index of version field

EDigestAlgorithms = 1

Index of digest algorithm set field

EEncapsulatedContentInfo = 2

Index of encapsulated content info field

ECertificates = 3

Index of certificate set field

ERevocationLists = 4

Index of revocation list field

ESignedInfo = 5

Index of signer info set field

Member Data Documentation

RPointerArray< CCmsCertificateChoice > iCertificates

RPointerArray < CCmsCertificateChoice > iCertificates [private]

Certificate Set

TPtrC8 iContentData

TPtrC8 iContentData [private]

The data content being signed

CEncapsulatedContentInfo * iContentInfo

CEncapsulatedContentInfo * iContentInfo [private]

Encapsulated Content List

TFixedArray< TPtrC8 *, KCmsMaxSignedDataElements > iDataElements

TFixedArray < TPtrC8 *, KCmsMaxSignedDataElements > iDataElements [private]

Array of Encoded fields

RPointerArray< CX509AlgorithmIdentifier > iDigestAlgorithms

RPointerArray < CX509AlgorithmIdentifier > iDigestAlgorithms [private]

Algorithm Set

TPtrC8 iHash

TPtrC8 iHash [private]

The Hash being signed

TBool iIsCertificateRevocationListsPresent

TBool iIsCertificateRevocationListsPresent [private]

Reprents if the certificate revocationlisy is present

TBool iIsCertificateSetPresent

TBool iIsCertificateSetPresent [private]

Reprents if the certificate set is present

RPointerArray< CCmsSignerInfo > iSignerInfo

RPointerArray < CCmsSignerInfo > iSignerInfo [private]

Signer Info Set

TInt iVersion

TInt iVersion [private]

Version of the Signed object