javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 71 d5e927d5853b
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
    30 #include <unifiedkeystore.h>
    30 #include <unifiedkeystore.h>
    31 #include <mctwritablecertstore.h>
    31 #include <mctwritablecertstore.h>
    32 #include <charconv.h>
    32 #include <charconv.h>
    33 #include <pkcs10.h>
    33 #include <pkcs10.h>
    34 #include <secdlg.h>
    34 #include <secdlg.h>
    35 
       
    36 #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
       
    37 #include <PKIDlg.h>
    35 #include <PKIDlg.h>
    38 #endif
       
    39 
       
    40 #include <securityerr.h>
    36 #include <securityerr.h>
    41 
    37 
    42 
    38 
    43 
    39 
    44 // CONSTANTS
    40 // CONSTANTS
    69 // Destructor
    65 // Destructor
    70 CSTSCredentialManager::~CSTSCredentialManager()
    66 CSTSCredentialManager::~CSTSCredentialManager()
    71 {
    67 {
    72     delete iEncodedCert;
    68     delete iEncodedCert;
    73     delete iIssuerAndSerialNumber;
    69     delete iIssuerAndSerialNumber;
    74 #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS	
       
    75     if (iPKIDialog)
    70     if (iPKIDialog)
    76     {
    71     {
    77         iPKIDialog->Release();
    72         iPKIDialog->Release();
    78     }
    73     }
    79 #endif
       
    80     delete iDistinguishedName;
    74     delete iDistinguishedName;
    81     delete iDisplayName;
    75     delete iDisplayName;
    82     delete iRequestEncoded;
    76     delete iRequestEncoded;
    83     delete iRequest;
    77     delete iRequest;
    84     if (iCertInfoArray)
    78     if (iCertInfoArray)
   537 // Symbian 2nd phase constructor can leave.
   531 // Symbian 2nd phase constructor can leave.
   538 // -----------------------------------------------------------------------------
   532 // -----------------------------------------------------------------------------
   539 //
   533 //
   540 void CSTSCredentialManager::ConstructL()
   534 void CSTSCredentialManager::ConstructL()
   541 {
   535 {
   542 	#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
       
   543     iPKIDialog = PKIDialogFactory::CreateNoteL();
   536     iPKIDialog = PKIDialogFactory::CreateNoteL();
   544  #endif
   537 
   545     User::LeaveIfError(iFileServer.Connect());
   538     User::LeaveIfError(iFileServer.Connect());
   546     iWait = new(ELeave) CActiveSchedulerWait;
   539     iWait = new(ELeave) CActiveSchedulerWait;
   547     iStore = CUnifiedCertStore::NewL(iFileServer, ETrue);
   540     iStore = CUnifiedCertStore::NewL(iFileServer, ETrue);
   548     iKeyStore = CUnifiedKeyStore::NewL(iFileServer);
   541     iKeyStore = CUnifiedKeyStore::NewL(iFileServer);
   549     iStore->Initialize(iStatus);
   542     iStore->Initialize(iStatus);
   624 
   617 
   625     if (iCertInfoArray->Count() == 0)
   618     if (iCertInfoArray->Count() == 0)
   626     {
   619     {
   627         // not found, ok to add
   620         // not found, ok to add
   628         iState = EAddDialog;
   621         iState = EAddDialog;
   629         #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
       
   630         iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate,
   622         iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate,
   631                                     iSubject, iStatus);
   623                                     iSubject, iStatus);
   632         #endif
       
   633         SetActive();
   624         SetActive();
   634         return;
   625         return;
   635     }
   626     }
   636 
   627 
   637 
   628 
   727 
   718 
   728 
   719 
   729     CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ];
   720     CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ];
   730     iState = ERemoveDialog;
   721     iState = ERemoveDialog;
   731     iHandle = certInfo->Handle();
   722     iHandle = certInfo->Handle();
   732     #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
       
   733     iPKIDialog->DeleteCertificate(iHandle, iStatus);
   723     iPKIDialog->DeleteCertificate(iHandle, iStatus);
   734     #endif
       
   735     SetActive();
   724     SetActive();
   736 }
   725 }
   737 
   726 
   738 
   727 
   739 
   728 
   791         Complete(KErrGeneral);
   780         Complete(KErrGeneral);
   792         return;
   781         return;
   793     }
   782     }
   794     iState = ECSRDialog;
   783     iState = ECSRDialog;
   795     iHandle = iKeyInfo->Handle();
   784     iHandle = iKeyInfo->Handle();
   796 		#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
   785 
   797     iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus);
   786     iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus);
   798     #endif
       
   799     SetActive();
   787     SetActive();
   800 
   788 
   801 }
   789 }
   802 
   790 
   803 // -----------------------------------------------------------------------------
   791 // -----------------------------------------------------------------------------
  1037 {
  1025 {
  1038 
  1026 
  1039     FunctionServer::doServerSideInit();
  1027     FunctionServer::doServerSideInit();
  1040 
  1028 
  1041 }
  1029 }
       
  1030 
       
  1031