Revision: 201023 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 11:39:05 +0300
branchRCL_3
changeset 70 b38692a04122
parent 63 07c4e3a0535d
child 74 0d3a50e36d4b
child 79 a5e05e7296f9
Revision: 201023 Kit: 2010123
contentmgmt/referencedrmagent/refcafhelper/bwins/cafhelperu.def
contentmgmt/referencedrmagent/refcafhelper/eabi/cafhelperu.def
contentmgmt/referencedrmagent/refcafhelper/group/bld.inf
contentmgmt/referencedrmagent/refcafhelper/group/refcafhelper.mmp
contentmgmt/referencedrmagent/refcafhelper/inc/refcafhelper.h
contentmgmt/referencedrmagent/refcafhelper/inc/refcafhelper.iby
contentmgmt/referencedrmagent/refcafhelper/source/refcafhelper.cpp
cryptomgmtlibs/securityutils/group/bld.inf
cryptoservices/certificateandkeymgmt/asn1/asn1libdec.cpp
cryptoservices/certificateandkeymgmt/bwins/ASN1u.def
cryptoservices/certificateandkeymgmt/bwins/X509_v2u.def
cryptoservices/certificateandkeymgmt/eabi/asn1U.def
cryptoservices/certificateandkeymgmt/eabi/x509_v2u.def
cryptoservices/certificateandkeymgmt/inc/x509cert.h
cryptoservices/certificateandkeymgmt/x509/x509cert.cpp
securityanddataprivacytools/securitytools/certapp/encdec/certinfo.cpp
securityanddataprivacytools/securitytools/certapp/encdec/certinfo.h
securityanddataprivacytools/securitytools/certapp/encdec/filecertstore.cpp
securityanddataprivacytools/securitytools/certapp/encdec/x509utils.cpp
securityanddataprivacytools/securitytools/certapp/encdec/x509utils.h
--- a/contentmgmt/referencedrmagent/refcafhelper/bwins/cafhelperu.def	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	?NewCafHelperImplL@CReferenceCafHelper@@QAEPAVMCAFHelperInterface@ContentAccess@@XZ @ 1 NONAME ; class ContentAccess::MCAFHelperInterface * CReferenceCafHelper::NewCafHelperImplL(void)
-	?HandleCAFErrorL@CReferenceCafHelper@@UAEHHABVTDesC16@@@Z @ 2 NONAME ; int CReferenceCafHelper::HandleCAFErrorL(int, class TDesC16 const &)
-	?HandleCAFErrorL@CReferenceCafHelper@@UAEHHAAVRFile@@@Z @ 3 NONAME ; int CReferenceCafHelper::HandleCAFErrorL(int, class RFile &)
-	?HandleCAFErrorL@CReferenceCafHelper@@UAEHHABVTDesC8@@@Z @ 4 NONAME ; int CReferenceCafHelper::HandleCAFErrorL(int, class TDesC8 const &)
-	?Release@CReferenceCafHelper@@UAEXXZ @ 5 NONAME ; void CReferenceCafHelper::Release(void)
-
--- a/contentmgmt/referencedrmagent/refcafhelper/eabi/cafhelperu.def	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	_ZN19CReferenceCafHelper17NewCafHelperImplLEv @ 1 NONAME
-	_ZN19CReferenceCafHelper15HandleCAFErrorLEiRK7TDesC16 @ 2 NONAME
-	_ZThn4_N19CReferenceCafHelper15HandleCAFErrorLEiRK7TDesC16 @ 3 NONAME
-	_ZN19CReferenceCafHelper15HandleCAFErrorLEiR5RFile @ 4 NONAME
-	_ZThn4_N19CReferenceCafHelper15HandleCAFErrorLEiR5RFile @ 5 NONAME
-	_ZN19CReferenceCafHelper15HandleCAFErrorLEiRK6TDesC8 @ 6 NONAME
-	_ZThn4_N19CReferenceCafHelper15HandleCAFErrorLEiRK6TDesC8 @ 7 NONAME
-	_ZN19CReferenceCafHelper7ReleaseEv @ 8 NONAME
-	_ZThn4_N19CReferenceCafHelper7ReleaseEv @ 9 NONAME
-
--- a/contentmgmt/referencedrmagent/refcafhelper/group/bld.inf	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-* Reference CafHelper implementation for Content Access Framework
-*
-*/
-
-
-/**
- @file
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_TESTMMPFILES
-
-#ifndef TOOLS
-#ifndef TOOLS2
-refcafhelper.mmp
-#endif // TOOLS2
-#endif // TOOLS
-
-PRJ_TESTEXPORTS
-
-../inc/refcafhelper.h		/epoc32/include/test/refcafhelper.h
-
-// ROM test iby
-../inc/refcafhelper.iby /epoc32/rom/include/refcafhelper.iby
\ No newline at end of file
--- a/contentmgmt/referencedrmagent/refcafhelper/group/refcafhelper.mmp	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-* Reference implementation of polymorphic interface defined by KCAFHelperInterfaceUID.
-*
-*/
-
-
-/**
- @file
-*/
-
-TARGET		cafhelper.dll
-CAPABILITY	All -Tcb
-TARGETTYPE	DLL
-
-UID			0x20024480 0x2002551D
-VENDORID	0x70000001
-
-UNPAGED
-
-SOURCEPATH	../source
-SOURCE		refcafhelper.cpp
-
-USERINCLUDE	../inc
-
-OS_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE OS_LAYER_PLATFORM_EXPORT_PATH(caf)
-SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(caf)
-
-LIBRARY		euser.lib
-SMPSAFE
--- a/contentmgmt/referencedrmagent/refcafhelper/inc/refcafhelper.h	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-
-/** 
-@file 
-
-@test
-@internalComponent
-*/
-
-#ifndef __REFCAFHELPER_H__
-#define __REFCAFHELPER_H__
-
-#include <e32base.h>
-#include <caf/cafhelperinterface.h>
-
-using namespace ContentAccess;
-/**
- This is a reference implementation of the polymorphic interface defined by 
- UID KCAFHelperInterfaceUID.
- 
- @file 
- @test
- @internalComponent
-*/
-	 	
-NONSHARABLE_CLASS(CReferenceCafHelper) : public CBase, public MCAFHelperInterface
-	{
-	public:
-		
-		IMPORT_C MCAFHelperInterface* NewCafHelperImplL();
-		
-		CReferenceCafHelper();
-		
-		/**  
-		 This method handles the CAF error received for a given file.
-		 @param aError		One of the CAF errors. 
-		 @param aFileName 	File name or file URI for which the error is received
-		 @return 			KErrNone if the error is handled successfully.Otherwise one of the other system-wide
-							errors.
-		 @capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
-		*/
-		IMPORT_C virtual TInt HandleCAFErrorL(TInt aError, const TDesC& aFileName);
-		
-		/**  
-		 This method handles the CAF error received for a given file .
-		 @param aError		One of the CAF errors. 
-		 @param aFileHandle File handle for which the error is received
-		 @return 			KErrNone if the error is handled successfully.Otherwise one of the other system-wide
-							errors.
-		 @capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
-		*/	
-		IMPORT_C virtual TInt HandleCAFErrorL(TInt aError, RFile& aFileHandle);
-		
-		/**  
-		 This method handles the CAF error received for WMDRM content .
-		 @param aError		One of the CAF errors. 
-		 @param aHeaderData The header data of the content for which the error is received
-		 @return 			KErrNone if the error is handled successfully.Otherwise one of the other system-wide
-							errors.
-		 @capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
-		*/
-		IMPORT_C virtual TInt HandleCAFErrorL(TInt aError, const TDesC8& aHeaderData);
-		
-		IMPORT_C virtual void Release();
-		
-		virtual ~CReferenceCafHelper();
-		};
-
-#endif
-
--- a/contentmgmt/referencedrmagent/refcafhelper/inc/refcafhelper.iby	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-
-#ifndef __REFCAFHELPER_IBY__
-#define __REFCAFHELPER_IBY__
-
-#include <testexecute.iby>
-
-file=ABI_DIR\BUILD_DIR\cafhelper.dll		System\Libs\cafhelper.dll
-
-#endif // __REFCAFHELPER_IBY__
\ No newline at end of file
--- a/contentmgmt/referencedrmagent/refcafhelper/source/refcafhelper.cpp	Tue May 25 14:37:45 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-
-#include <e32base.h>
-#include "refcafhelper.h"
-#include <caferr.h>
-
-
-EXPORT_C MCAFHelperInterface* CReferenceCafHelper::NewCafHelperImplL()
-    {
-    return new (ELeave) CReferenceCafHelper;
-    }
-
-CReferenceCafHelper::CReferenceCafHelper()
-	{
-	}
-
-EXPORT_C TInt CReferenceCafHelper::HandleCAFErrorL(TInt /*aError*/, const TDesC& /*aFileName*/)
-	{
-	return KErrNotSupported;
-	}
-
-EXPORT_C TInt CReferenceCafHelper::HandleCAFErrorL(TInt /*aError*/, RFile& /*aFileHandle*/)
-	{
-	return KErrNotSupported;
-	}
-
-EXPORT_C TInt CReferenceCafHelper::HandleCAFErrorL(TInt /*aError*/, const TDesC8& /*aHeaderData*/)
-	{
-	return KErrNotSupported;
-	}
-	
-EXPORT_C void CReferenceCafHelper::Release()
-	{
-	delete this;
-	}
-
-CReferenceCafHelper::~CReferenceCafHelper()
-	{
-	}
-	
--- a/cryptomgmtlibs/securityutils/group/bld.inf	Tue May 25 14:37:45 2010 +0300
+++ b/cryptomgmtlibs/securityutils/group/bld.inf	Wed Jun 09 11:39:05 2010 +0300
@@ -28,7 +28,7 @@
 ../inc/euserext.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(euserext.h)
 ../inc/miscutil.h 	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(miscutil.h)
 ../inc/callbacktimer.h 	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(callbacktimer.h)
-../inc/SecSettingsclient.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(SecSettings/SecSettingsclient.h)
+../inc/secsettingsclient.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(secsettings/secsettingsclient.h)
 
 ../inc/securityerr.h	SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(securityerr.h)
 // ROMKIT includes
--- a/cryptoservices/certificateandkeymgmt/asn1/asn1libdec.cpp	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/asn1/asn1libdec.cpp	Wed Jun 09 11:39:05 2010 +0300
@@ -18,3 +18,8 @@
 
 
 #include <asn1dec.h>
+
+// Dummy definition, just to satisfy SDK creation check
+EXPORT_C TASN1DecEnumerated::TASN1DecEnumerated()
+{
+}
--- a/cryptoservices/certificateandkeymgmt/bwins/ASN1u.def	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/bwins/ASN1u.def	Wed Jun 09 11:39:05 2010 +0300
@@ -130,4 +130,5 @@
 	??1CASN1EncPrintableString@@UAE@XZ @ 129 NONAME ; CASN1EncPrintableString::~CASN1EncPrintableString(void)
 	?NewL@CASN1EncPrintableString@@SAPAV1@ABVTDesC8@@@Z @ 130 NONAME ; class CASN1EncPrintableString * CASN1EncPrintableString::NewL(class TDesC8 const &)
 	?NewLC@CASN1EncPrintableString@@SAPAV1@ABVTDesC8@@@Z @ 131 NONAME ; class CASN1EncPrintableString * CASN1EncPrintableString::NewLC(class TDesC8 const &)
+	??0TASN1DecEnumerated@@QAE@XZ @ 132 NONAME ; TASN1DecEnumerated::TASN1DecEnumerated(void)
 
--- a/cryptoservices/certificateandkeymgmt/bwins/X509_v2u.def	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/bwins/X509_v2u.def	Wed Jun 09 11:39:05 2010 +0300
@@ -279,5 +279,5 @@
 	?NewL@CCertificateValidationWarnings@@SAPAV1@H@Z @ 278 NONAME ; class CCertificateValidationWarnings * CCertificateValidationWarnings::NewL(int)
 	?NewLC@CCertificateValidationWarnings@@SAPAV1@H@Z @ 279 NONAME ; class CCertificateValidationWarnings * CCertificateValidationWarnings::NewLC(int)
 	?Warnings@CCertificateValidationWarnings@@QBEABV?$RArray@VTValidationStatus@@@@XZ @ 280 NONAME ; class RArray<class TValidationStatus> const & CCertificateValidationWarnings::Warnings(void) const
-	?SubjectKeyIdL@CX509Certificate@@QAE?AV?$TBuf8@$0BE@@@XZ @ 281 NONAME ; class TBuf8<20> CX509Certificate::SubjectKeyIdL(void)
+	?SubjectKeyIdL@CX509Certificate@@QBE?AV?$TBuf8@$0BE@@@XZ @ 281 NONAME ; class TBuf8<20> CX509Certificate::SubjectKeyIdL(void) const
 
--- a/cryptoservices/certificateandkeymgmt/eabi/asn1U.def	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/eabi/asn1U.def	Wed Jun 09 11:39:05 2010 +0300
@@ -204,4 +204,6 @@
 	_ZTV23CASN1EncPrintableString @ 203 NONAME ; #<VT>#
 	_ZN17CASN1EncPrimitiveC2Ej @ 204 NONAME
 	_ZN17TASN1DecBMPString10CheckValidERK6TDesC8 @ 205 NONAME
+	_ZN18TASN1DecEnumeratedC1Ev @ 206 NONAME
+	_ZN18TASN1DecEnumeratedC2Ev @ 207 NONAME
 
--- a/cryptoservices/certificateandkeymgmt/eabi/x509_v2u.def	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/eabi/x509_v2u.def	Wed Jun 09 11:39:05 2010 +0300
@@ -397,5 +397,5 @@
 	_ZNK30CCertificateValidationWarnings9CertIndexEv @ 396 NONAME
 	_ZTI30CCertificateValidationWarnings @ 397 NONAME
 	_ZTV30CCertificateValidationWarnings @ 398 NONAME
-	_ZN16CX509Certificate13SubjectKeyIdLEv @ 399 NONAME
+	_ZNK16CX509Certificate13SubjectKeyIdLEv @ 399 NONAME
 
--- a/cryptoservices/certificateandkeymgmt/inc/x509cert.h	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/inc/x509cert.h	Wed Jun 09 11:39:05 2010 +0300
@@ -621,7 +621,7 @@
 	* as an extension in the certificate, any other certificate it returns the keyidentifier as 
 	* calculated by Symbian's proprietary logic.
 	* @return	The subject key identifier for the certificate. */
-	IMPORT_C TKeyIdentifier SubjectKeyIdL();
+	IMPORT_C TKeyIdentifier SubjectKeyIdL() const;
 				
 	/** Destructor.
 	* 
--- a/cryptoservices/certificateandkeymgmt/x509/x509cert.cpp	Tue May 25 14:37:45 2010 +0300
+++ b/cryptoservices/certificateandkeymgmt/x509/x509cert.cpp	Wed Jun 09 11:39:05 2010 +0300
@@ -1338,10 +1338,10 @@
 	return KeyIdentifierL();
 	}
 
-EXPORT_C TKeyIdentifier CX509Certificate::SubjectKeyIdL()
+EXPORT_C TKeyIdentifier CX509Certificate::SubjectKeyIdL() const
 	{
 	// if it is a v1 or v2 type then there is no way of knowing which is a CA, treat all certs as CA as done in the certificate recognizer.
-	if (Version() != 3 )
+	if (Version() < 3 )
 		{
 		return SubjectKeyIdentifierL();
 		}
--- a/securityanddataprivacytools/securitytools/certapp/encdec/certinfo.cpp	Tue May 25 14:37:45 2010 +0300
+++ b/securityanddataprivacytools/securitytools/certapp/encdec/certinfo.cpp	Wed Jun 09 11:39:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -197,6 +197,11 @@
 	return (TCertificateFormat)iFormat.Value();
 }
 
+TCertificateOwnerType CertInfo::CertificateOwnerType() const
+{
+	return (TCertificateOwnerType)iCertificateOwnerType.Value();
+}
+
 
 KeyIdentifierObject &CertInfo::SubjectKeyId()
 {
--- a/securityanddataprivacytools/securitytools/certapp/encdec/certinfo.h	Tue May 25 14:37:45 2010 +0300
+++ b/securityanddataprivacytools/securitytools/certapp/encdec/certinfo.h	Wed Jun 09 11:39:05 2010 +0300
@@ -1,6 +1,6 @@
 #ifndef __CERTINFO_H__
 #define __CERTINFO_H__/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -64,6 +64,8 @@
 
 	TUint32 OutputCertificateId() const;
 	void SetOutputCertificateId(TUint32 aId);
+
+	TCertificateOwnerType CertificateOwnerType() const;
 	
 private:
 	EncDecObject<TUint8> iTmpCombinedDeletableAndFormat;
--- a/securityanddataprivacytools/securitytools/certapp/encdec/filecertstore.cpp	Tue May 25 14:37:45 2010 +0300
+++ b/securityanddataprivacytools/securitytools/certapp/encdec/filecertstore.cpp	Wed Jun 09 11:39:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -286,10 +286,11 @@
 	if(iCertInfo.CertificateFormat() == EX509Certificate)
 		{
 		TKeyIdentifier subjectKeyId;
-		
+		bool isCA = ( iCertInfo.CertificateOwnerType() != EUserCertificate );
+
 		// nb. If processing a swicertstore we ignore any SubjectKeyId in the extension.
 		if(X509SubjectKeyId((iSwiMode)?(KIgnoreCertificateExtension) : (KUseCertificateExtension), 
-							false,
+							false, isCA,
 							iCertData,
 							iCertSubject, subjectKeyId))
 			{
--- a/securityanddataprivacytools/securitytools/certapp/encdec/x509utils.cpp	Tue May 25 14:37:45 2010 +0300
+++ b/securityanddataprivacytools/securitytools/certapp/encdec/x509utils.cpp	Wed Jun 09 11:39:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -191,7 +191,7 @@
 #endif
 
 bool X509SubjectKeyId(EUseCertificateExtension aUseExtension, bool aUseRfc3280Algorithm,
-					  const std::string &aCert, 
+					  bool aIsCa, const std::string &aCert, 
 					  std::string &aSubject, TKeyIdentifier &aSubjectKeyId)
 {
 	bool done = false;
@@ -210,8 +210,17 @@
 	// Return the Subject Name
 	prog << Log::Indent() << "Cert subject is '" << x509->name << "'" << Log::Endl();
 	aSubject = std::string(x509->name);
-
-	if(aUseExtension)
+	TUint32 ver = X509_get_version(x509);
+	prog << Log::Indent() << "Cert version is '" << ver << "'" << Log::Endl();
+	
+	// if the ver is a v1 or v2 type then there is no way of knowing which is a CA, treat all certs as CA as done in the certificate recognizer.
+	bool treatAsCa = false;  
+	if ( ver < 3 || aIsCa )
+		{
+		treatAsCa = true;
+		}
+	
+	if(treatAsCa && aUseExtension)
 		{
 		// Attempt to read Subject Key Id extension
 		ASN1_OCTET_STRING *subKeyId = (ASN1_OCTET_STRING *) X509_get_ext_d2i(x509, NID_subject_key_identifier, NULL, NULL);
--- a/securityanddataprivacytools/securitytools/certapp/encdec/x509utils.h	Tue May 25 14:37:45 2010 +0300
+++ b/securityanddataprivacytools/securitytools/certapp/encdec/x509utils.h	Wed Jun 09 11:39:05 2010 +0300
@@ -1,6 +1,6 @@
 #ifndef __X509UTILS_H__
 #define __X509UTILS_H__/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -71,7 +71,7 @@
    If the certificate is invalid then exit the program with an error message!
  */
 bool X509SubjectKeyId(EUseCertificateExtension aUseExtension, bool aUseRfc3280Algorithm,
-					  const std::string &aCert, 
+					  bool aIsCa, const std::string &aCert, 
 					  std::string &aSubject, TKeyIdentifier &aSubjectKeyId);
 
 /**