equal
deleted
inserted
replaced
34 #include <secdlg.h> |
34 #include <secdlg.h> |
35 #include <PKIDlg.h> |
35 #include <PKIDlg.h> |
36 #include <securityerr.h> |
36 #include <securityerr.h> |
37 |
37 |
38 |
38 |
39 |
|
40 // CONSTANTS |
39 // CONSTANTS |
41 _LIT(KSTSSymbianKeyStoreLabel, "Software key store"); |
40 _LIT(KSTSSymbianKeyStoreLabel, "Software key store"); |
42 _LIT(KSTSSymbianCertificateStoreLabel, "Software certificate store"); |
41 _LIT(KSTSSymbianCertificateStoreLabel, "Software certificate store"); |
43 |
42 |
44 // ============================ MEMBER FUNCTIONS =============================== |
43 // ============================ MEMBER FUNCTIONS =============================== |
65 // Destructor |
64 // Destructor |
66 CSTSCredentialManager::~CSTSCredentialManager() |
65 CSTSCredentialManager::~CSTSCredentialManager() |
67 { |
66 { |
68 delete iEncodedCert; |
67 delete iEncodedCert; |
69 delete iIssuerAndSerialNumber; |
68 delete iIssuerAndSerialNumber; |
70 if (iPKIDialog) |
69 |
71 { |
|
72 iPKIDialog->Release(); |
|
73 } |
|
74 delete iDistinguishedName; |
70 delete iDistinguishedName; |
75 delete iDisplayName; |
71 delete iDisplayName; |
76 delete iRequestEncoded; |
72 delete iRequestEncoded; |
77 delete iRequest; |
73 delete iRequest; |
78 if (iCertInfoArray) |
74 if (iCertInfoArray) |
531 // Symbian 2nd phase constructor can leave. |
527 // Symbian 2nd phase constructor can leave. |
532 // ----------------------------------------------------------------------------- |
528 // ----------------------------------------------------------------------------- |
533 // |
529 // |
534 void CSTSCredentialManager::ConstructL() |
530 void CSTSCredentialManager::ConstructL() |
535 { |
531 { |
536 iPKIDialog = PKIDialogFactory::CreateNoteL(); |
532 |
537 |
|
538 User::LeaveIfError(iFileServer.Connect()); |
533 User::LeaveIfError(iFileServer.Connect()); |
539 iWait = new(ELeave) CActiveSchedulerWait; |
534 iWait = new(ELeave) CActiveSchedulerWait; |
540 iStore = CUnifiedCertStore::NewL(iFileServer, ETrue); |
535 iStore = CUnifiedCertStore::NewL(iFileServer, ETrue); |
541 iKeyStore = CUnifiedKeyStore::NewL(iFileServer); |
536 iKeyStore = CUnifiedKeyStore::NewL(iFileServer); |
542 iStore->Initialize(iStatus); |
537 iStore->Initialize(iStatus); |
617 |
612 |
618 if (iCertInfoArray->Count() == 0) |
613 if (iCertInfoArray->Count() == 0) |
619 { |
614 { |
620 // not found, ok to add |
615 // not found, ok to add |
621 iState = EAddDialog; |
616 iState = EAddDialog; |
622 iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate, |
617 |
623 iSubject, iStatus); |
|
624 SetActive(); |
618 SetActive(); |
625 return; |
619 return; |
626 } |
620 } |
627 |
621 |
628 |
622 |
718 |
712 |
719 |
713 |
720 CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ]; |
714 CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ]; |
721 iState = ERemoveDialog; |
715 iState = ERemoveDialog; |
722 iHandle = certInfo->Handle(); |
716 iHandle = certInfo->Handle(); |
723 iPKIDialog->DeleteCertificate(iHandle, iStatus); |
717 |
|
718 |
724 SetActive(); |
719 SetActive(); |
725 } |
720 } |
726 |
721 |
727 |
722 |
728 |
723 |
781 return; |
776 return; |
782 } |
777 } |
783 iState = ECSRDialog; |
778 iState = ECSRDialog; |
784 iHandle = iKeyInfo->Handle(); |
779 iHandle = iKeyInfo->Handle(); |
785 |
780 |
786 iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus); |
781 |
787 SetActive(); |
782 SetActive(); |
788 |
783 |
789 } |
784 } |
790 |
785 |
791 // ----------------------------------------------------------------------------- |
786 // ----------------------------------------------------------------------------- |