pkiutilities/untrustedcertificatedialog/src/untrustedcertificatewidget_symbian.cpp
changeset 30 cc1cea6aabaf
parent 26 aad866c37519
equal deleted inserted replaced
26:aad866c37519 30:cc1cea6aabaf
    18 
    18 
    19 #include "untrustedcertificatewidget.h"
    19 #include "untrustedcertificatewidget.h"
    20 #include "untrustedcertificatedefinitions.h"
    20 #include "untrustedcertificatedefinitions.h"
    21 #include "untrustedcertificateinfobase.h"
    21 #include "untrustedcertificateinfobase.h"
    22 #include "untrustedcertificateinfo_symbian.h"
    22 #include "untrustedcertificateinfo_symbian.h"
    23 #include <x509cert.h>                   // CX509Certificate
    23 #include <securitydefs.h>                           // TValidationError
    24 
       
    25 
       
    26 // ======== LOCAL FUNCTIONS ========
       
    27 
       
    28 // ----------------------------------------------------------------------------
       
    29 // DoProcessEncodedCertificateL()
       
    30 // ----------------------------------------------------------------------------
       
    31 //
       
    32 UntrustedCertificateInfoBase* DoProcessEncodedCertificateL( const QByteArray &encodedCert )
       
    33 {
       
    34     TPtrC8 ptr8( reinterpret_cast<const TText8*>(encodedCert.constData()), encodedCert.length());
       
    35     CX509Certificate* cert = CX509Certificate::NewLC( ptr8 );
       
    36 
       
    37     UntrustedCertificateInfoSymbian *info = 0;
       
    38     info = new UntrustedCertificateInfoSymbian(*cert);
       
    39     CleanupStack::PopAndDestroy( cert );
       
    40 
       
    41     return info;
       
    42 }
       
    43 
    24 
    44 
    25 
    45 // ======== MEMBER FUNCTIONS ========
    26 // ======== MEMBER FUNCTIONS ========
    46 
    27 
    47 // ----------------------------------------------------------------------------
    28 // ----------------------------------------------------------------------------
    57 // UntrustedCertificateWidget::processEncodedCertificate()
    38 // UntrustedCertificateWidget::processEncodedCertificate()
    58 // ----------------------------------------------------------------------------
    39 // ----------------------------------------------------------------------------
    59 //
    40 //
    60 void UntrustedCertificateWidget::processEncodedCertificate(const QByteArray &encodedCert)
    41 void UntrustedCertificateWidget::processEncodedCertificate(const QByteArray &encodedCert)
    61 {
    42 {
    62     UntrustedCertificateInfoBase *info = 0;
    43     UntrustedCertificateInfoBase *info = new UntrustedCertificateInfoSymbian(encodedCert);
    63     QT_TRAP_THROWING(info = DoProcessEncodedCertificateL(encodedCert));
       
    64     if (mCertificateInfo) {
    44     if (mCertificateInfo) {
    65         delete mCertificateInfo;
    45         delete mCertificateInfo;
    66         mCertificateInfo = 0;
    46         mCertificateInfo = 0;
    67     }
    47     }
    68     mCertificateInfo = info;
    48     mCertificateInfo = info;