CCmsSignedObject Class Reference

class CCmsSignedObject : public CSignedObject

A representation of a RFC2630 (signed data) entity.

Inherits from

Public Member Functions
~CCmsSignedObject()
IMPORT_C voidAddCertificateL(const CX509Certificate &)
IMPORT_C voidAddCertificateL(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 voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsCertificateRevocationListsPresent()
IMPORT_C TBoolIsCertificateSetPresent()
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 voidSignL(const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)
IMPORT_C voidSignL(const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)
IMPORT_C const TPtrC8SignedDataL()
IMPORT_C const RPointerArray< CCmsSignerInfo > &SignerInfo()
IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &, HBufC8 *&)
IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &, const RPointerArray< CX509Certificate > &, HBufC8 *&)
IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &, HBufC8 *&, TBool, const TDesC8 &)
IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &, const RPointerArray< CX509Certificate > &, HBufC8 *&, TBool, const TDesC8 &)
IMPORT_C TIntVersion()
Private Member Functions
CCmsSignedObject()
voidAddDigestAlgorithmL(TAlgorithmId)
CCmsSignerIdentifier *BuildSignerIdentifierLC(const CX509Certificate &)
voidBuildSignerInfoCertListAndAlgoritmListL(TAlgorithmId, TBool, const TDesC8 &, const CDSAPrivateKey &, const CX509Certificate &, TBool)
voidBuildSignerInfoCertListAndAlgoritmListL(TAlgorithmId, TBool, const TDesC8 &, const CRSAPrivateKey &, const CX509Certificate &, TBool)
voidConstructL(const CCmsContentInfo &)
voidConstructL(TCmsContentInfoType, TBool, const TDesC8 &)
voidConstructL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CDSAPrivateKey &, const CX509Certificate &, TBool)
voidConstructL(TCmsContentInfoType, const TDesC8 &, TAlgorithmId, const CRSAPrivateKey &, const CX509Certificate &, TBool)
voidDecodeCertificatesL(const TDesC8 &)
voidDecodeDigestAlgorithmsL(const TDesC8 &)
voidDecodeEncapsulatedContentInfoL(const TDesC8 &)
voidDecodeRevocationListsL(const TDesC8 &)
voidDecodeSignedDataL(const TDesC8 &)
voidDecodeSignerInfoL(const TDesC8 &)
CASN1EncBase *EncodeAlgorithmsLC()
CASN1EncBase *EncodeCertificatesLC()
CASN1EncBase *EncodeSignerInfoLC()
voidInitSignedObjectL(const TDesC8 &)
voidSetContentData(const TDesC8 &)
voidSetHash(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
enumanonymous {
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 voidAddCertificateL(const CX509Certificate &aCert)

Appends the X509 certificate to the certificate list.

Parameters

const CX509Certificate & aCertThe X509 certificate to be appended.

AddCertificateL(const TDesC8 &, CCmsCertificateChoice::TCertificateType)

IMPORT_C voidAddCertificateL(const TDesC8 &aCert,
CCmsCertificateChoice::TCertificateTypeaType
)

Appends an encoded attribute certificate to the certificate list.

Parameters

const TDesC8 & aCertThe encoded certificate to be appended.
CCmsCertificateChoice::TCertificateType aTypeThe type of the encoded certificate..

AddDigestAlgorithmL(TAlgorithmId)

voidAddDigestAlgorithmL(TAlgorithmIdaDigestAlgorithm)[private]

Append the algorithm to the algoritm list

Parameters

TAlgorithmId aDigestAlgorithmthe 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 & aCertthe signer's certificate.

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

voidBuildSignerInfoCertListAndAlgoritmListL(TAlgorithmIdaDigestAlgorithm,
TBoolaIsHash,
const TDesC8 &aValue,
const CDSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[private]

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

Parameters

TAlgorithmId aDigestAlgorithmthe digest algorithm identifier.
TBool aIsHashA flag the represent if the next descriptor is the hash value rather that original data
const TDesC8 & aValuethe data content or its hash.
const CDSAPrivateKey & aKeythe DSA private used to sign.
const CX509Certificate & aCertthe signer's certificate
TBool aAddCertificatethe flag to represent if the certificate is added to the certificate set

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

voidBuildSignerInfoCertListAndAlgoritmListL(TAlgorithmIdaDigestAlgorithm,
TBoolaIsHash,
const TDesC8 &aValue,
const CRSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[private]

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

Parameters

TAlgorithmId aDigestAlgorithmthe digest algorithm identifier.
TBool aIsHashA flag the represent if the next descriptor is the hash value rather that original data
const TDesC8 & aValuethe data content or its hash.
const CRSAPrivateKey & aKeythe RSA private used to sign.
const CX509Certificate & aCertthe signer's certificate
TBool aAddCertificatethe 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 &)

voidConstructL(const CCmsContentInfo &aContentInfo)[private]

Second phase constructor for decoding a CMS signed data object

Parameters

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

ConstructL(TCmsContentInfoType, TBool, const TDesC8 &)

voidConstructL(TCmsContentInfoTypeaType,
TBoolaIsDetached,
const TDesC8 &aContentData
)[private]

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

Parameters

TCmsContentInfoType aTypethe encapsulated content info type.
TBool aIsDetachedif the CMS signed data does not contains the data content being signed.
const TDesC8 & aContentDatathe content data descriptor.

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

voidConstructL(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CDSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[private]

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

Parameters

TCmsContentInfoType aTypethe encapsulated content info type.
const TDesC8 & aHashValuethe hash of the data content to create the signature.
TAlgorithmId aDigestAlgorithmthe digest algorithm.
const CDSAPrivateKey & aKeythe DSA private to create signature.
const CX509Certificate & aCertthe signer's certficate
TBool aAddCertificatea flag to represent if the signer's certificate is added to certificate set.

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

voidConstructL(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CRSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[private]

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

Parameters

TCmsContentInfoType aTypethe encapsulated content info type.
const TDesC8 & aHashValuethe hash of the data content to create the signature.
TAlgorithmId aDigestAlgorithmthe digest algorithm.
const CRSAPrivateKey & aKeythe RSA private to create signature.
const CX509Certificate & aCertthe signer's certficate
TBool aAddCertificatea 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 TUintaIndex)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 aIndexThe encoded data element position in the tbsCertificate data structure. See the enumeration: CX509Certificate::Anonymous.

DecodeCertificatesL(const TDesC8 &)

voidDecodeCertificatesL(const TDesC8 &aRawData)[private]

Decode the certificate set.

Parameters

const TDesC8 & aRawData

DecodeDigestAlgorithmsL(const TDesC8 &)

voidDecodeDigestAlgorithmsL(const TDesC8 &aRawData)[private]

Decode the digest algorithm set.

Parameters

const TDesC8 & aRawData

DecodeEncapsulatedContentInfoL(const TDesC8 &)

voidDecodeEncapsulatedContentInfoL(const TDesC8 &aRawData)[private]

Decode the encapsulated content info

Parameters

const TDesC8 & aRawData

DecodeRevocationListsL(const TDesC8 &)

voidDecodeRevocationListsL(const TDesC8 &aRawData)[private]

Decode the certificate revocation set. Not implemented now!

Parameters

const TDesC8 & aRawData

DecodeSignedDataL(const TDesC8 &)

voidDecodeSignedDataL(const TDesC8 &aRawData)[private]

Decode the CMS Signer data.

Parameters

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

DecodeSignerInfoL(const TDesC8 &)

voidDecodeSignerInfoL(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 &)

voidInitSignedObjectL(const TDesC8 &aRawData)[private]

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

Parameters

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

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(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 & aStreamStream from which the contents of the field should be internalised.

IsCertificateRevocationListsPresent()

IMPORT_C TBoolIsCertificateRevocationListsPresent()const

Returns whether the certificate revocation list exists.

IsCertificateSetPresent()

IMPORT_C TBoolIsCertificateSetPresent()const

Returns whether the certificate list exists.

NewL(TCmsContentInfoType, TBool, const TDesC8 &)

IMPORT_C CCmsSignedObject *NewL(TCmsContentInfoTypeaType,
TBoolaIsDetached,
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 aTypeThe type of the encapsulated content.
TBool aIsDetachedA boolean indicating whether the encapsulated data is detached.
const TDesC8 & aContentDataThe 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(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CDSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[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 aTypeEncapsulated Content data type.
const TDesC8 & aHashValueThe hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithmThe digest algorithm used to create the hash.
const CDSAPrivateKey & aKeyThe DSA private key used to sign.
const CX509Certificate & aCertThe signer's certificate.
TBool aAddCertificateA 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(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CRSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[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 aTypeEncapsulated Content data type.
const TDesC8 & aHashValueThe hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithmThe digest algorithm used to create the hash.
const CRSAPrivateKey & aKeyThe RSA private key used to sign.
const CX509Certificate & aCertaCert The signer's certificate.
TBool aAddCertificateA 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 & aContentInfoThe CMS content info that contains the encoded signed object.

NewLC(TCmsContentInfoType, TBool, const TDesC8 &)

IMPORT_C CCmsSignedObject *NewLC(TCmsContentInfoTypeaType,
TBoolaIsDetached,
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 aTypeThe type of the encapsulated content.
TBool aIsDetachedA boolean indicating whether the encapsulated data is detached.
const TDesC8 & aContentDataThe 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(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CDSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[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 aTypeEncapsulated Content data type.
const TDesC8 & aHashValueThe hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithmThe digest algorithm used to create the hash.
const CDSAPrivateKey & aKeyThe DSA private key used to sign.
const CX509Certificate & aCertThe signer's certificate.
TBool aAddCertificateA 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(TCmsContentInfoTypeaType,
const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CRSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)[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 aTypeEncapsulated Content data type.
const TDesC8 & aHashValueThe hash value of the data content to be signed.
TAlgorithmId aDigestAlgorithmThe digest algorithm used to create the hash.
const CRSAPrivateKey & aKeyThe RSA private key used to sign.
const CX509Certificate & aCertThe signer's certificate.
TBool aAddCertificateA 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 & aContentInfoThe CMS content info that contains the encoded signed object.

SetContentData(const TDesC8 &)

voidSetContentData(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 & aContentDataThe data content being signed.

SetHash(const TDesC8 &)

voidSetHash(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 & aHashThe hash being signed.

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

IMPORT_C voidSignL(const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CDSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)
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 & aHashValueThe 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 aDigestAlgorithmThe digest algorithm used to create the hash.
const CDSAPrivateKey & aKeythe DSA private key used to sign.
const CX509Certificate & aCertthe signer's certificate.
TBool aAddCertificateA 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 voidSignL(const TDesC8 &aHashValue,
TAlgorithmIdaDigestAlgorithm,
const CRSAPrivateKey &aKey,
const CX509Certificate &aCert,
TBoolaAddCertificate
)
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 & aHashValueThe 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 aDigestAlgorithmThe digest algorithm used to create the hash.
const CRSAPrivateKey & aKeythe RSA private key used to sign.
const CX509Certificate & aCertthe signer's certificate.
TBool aAddCertificateA boolean indicating whether the signer's certificate is added to the signed data object.

SignedDataL()

IMPORT_C const TPtrC8SignedDataL()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 & aSignerInfothe signer info reference contains the signature
const CX509Certificate & aEndEntityCertthe certificate used to create the signature.

ValidateSignerLC(const CCmsSignerInfo &, HBufC8 *&)

IMPORT_C TBoolValidateSignerLC(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 & aSignerInfoThe signer to be validated.
HBufC8 *& aCertChainEncodingThe certificate chain. This is created and pushed onto the cleanup stack by the function.

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

IMPORT_C TBoolValidateSignerLC(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 & aSignerInfoThe signer to be validated.
const RPointerArray< CX509Certificate > & aCertificatesThe certificate list provided by the user to validate the signature.
HBufC8 *& aCertChainEncodingThe certificate chain. This is created and pushed onto the cleanup stack by the function.

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

IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &aSignerInfo,
HBufC8 *&aCertChainEncoding,
TBoolaIsHash,
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 & aSignerInfoThe signer to be validated.
HBufC8 *& aCertChainEncodingThe certificate chain. This is created and pushed onto the cleanup stack by the function.
TBool aIsHashThe flag represent if the next parameter is the hash of the data content.
const TDesC8 & aContentDataOrHashthe descriptor that contains the data content or its hash

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

IMPORT_C TBoolValidateSignerLC(const CCmsSignerInfo &aSignerInfo,
const RPointerArray< CX509Certificate > &aCertificates,
HBufC8 *&aCertChainEncoding,
TBoolaIsHash,
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 & aSignerInfoThe signer to be validated.
const RPointerArray< CX509Certificate > & aCertificatesThe certificate list provided by the user to validate the signature.
HBufC8 *& aCertChainEncodingThe certificate chain. This is created and pushed onto the cleanup stack by the function.
TBool aIsHashThe flag represent if the next parameter is the hash of the data content.
const TDesC8 & aContentDataOrHashthe descriptor that contains the data content or its hash

Version()

IMPORT_C TIntVersion()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