Changeset 63

Show
Ignore:
Timestamp:
02/22/12 00:32:32 (9 years ago)
Author:
vsilva
Message:

Fix SDK show window parameter, improve xades sdk

Location:
middleware-offline/trunk/_src
Files:
4 added
8 modified

Legend:

Unmodified
Added
Removed
  • middleware-offline/trunk/_src/eidmw/eidgui/AutoUpdates.cpp

    r59 r63  
    347347 
    348348#ifdef WIN32 
    349         if (arch == "x86_64") 
     349        if (arch == "i386") 
    350350        { 
    351351                pkgname.append("PteidMW35-Basic-en.msi"); 
  • middleware-offline/trunk/_src/eidmw/eidgui/dlgsignature.cpp

    r41 r63  
    5757                        this->resize(thiswidth,height-20); //make sure the window fits 
    5858                } 
     59                 
     60                /* QVBoxLayout *layout = new QVBoxLayout; 
     61        this->setLayout(layout); 
     62 
     63                this->layout()->setSizeConstraint(QLayout::SetFixedSize); 
     64                this->setSizeGripEnabled(false); */ 
    5965 
    6066        } 
     
    127133        QMenu *myMenu = new QMenu(ui.listView); 
    128134        //myMenu->addAction("Remove Item"); 
    129         QAction *_open = new QAction("Remove", this); 
    130         myMenu->addAction(_open); 
    131         connect( _open, SIGNAL( triggered() ), this, SLOT( RemoveFromView() ) ); 
     135        QAction *_remove = new QAction("Remove", this); 
     136        myMenu->addAction(_remove); 
     137        connect( _remove, SIGNAL( triggered() ), this, SLOT( RemoveFromView() ) ); 
    132138        QAction* selectedItem = myMenu->exec(globalPos); 
    133  
    134139 
    135140        /*if (selectedItem) 
     
    197202            connect(&this->FutureWatcher, SIGNAL(finished()), pdialog, SLOT(cancel())); 
    198203 
    199             int outp_len = native_path.size(); 
     204                //Get the Xades-T checkbox value 
     205                QCheckBox *xades_t = ui.checkBox; 
     206                bool is_xades_t = xades_t->checkState() == Qt::Checked; 
    200207             
    201208 
     
    205212                strcpy(output_file,(char*)native_path.toStdString().c_str()); 
    206213#else 
     214                int outp_len = native_path.size();  
    207215                output_file =  new char[outp_len*2]; 
    208216            strncpy(output_file, native_path.toUtf8().constData(), outp_len*2); 
    209217#endif       
    210218            PTEID_LOG(PTEID_LOG_LEVEL_DEBUG, "eidgui", "Save to file %s", output_file); 
    211             QFuture<void> future = QtConcurrent::run(this, &dlgSignature::runsign, files_to_sign, i, output_file); 
     219            QFuture<void> future = QtConcurrent::run(this, &dlgSignature::runsign, files_to_sign, i, output_file, is_xades_t); 
    212220            this->FutureWatcher.setFuture(future); 
    213221 
     
    227235} 
    228236 
    229 void dlgSignature::runsign(const char ** paths, unsigned int n_paths, const char *output_path) 
    230 { 
    231     unsigned long       ReaderStartIdx = 1; 
    232     bool                bRefresh = false; 
    233     //unsigned long     ReaderEndIdx   = ReaderSet.readerCount(bRefresh); 
    234     unsigned long       ReaderIdx          = 0; 
     237void dlgSignature::runsign(const char ** paths, unsigned int n_paths, const char *output_path, bool timestamp) 
     238{ 
    235239 
    236240    try 
     
    238242            PTEID_EIDCard*      Card = dynamic_cast<PTEID_EIDCard*>(m_CI_Data.m_pCard); 
    239243            PTEID_ByteArray SignXades; 
    240             SignXades = Card->SignXadesT(paths, n_paths, output_path); 
     244                        if (timestamp) 
     245                                SignXades = Card->SignXadesT(paths, n_paths, output_path); 
     246                        else 
     247                                SignXades = Card->SignXades(paths, n_paths, output_path); 
    241248         
    242249    } 
     
    247254    } 
    248255 
    249     //pdialog->close(); 
    250  
    251256    return; 
    252257} 
  • middleware-offline/trunk/_src/eidmw/eidgui/dlgsignature.h

    r35 r63  
    5353 
    5454    void SignListView (QStringList list); 
    55     void runsign(const char ** paths, unsigned int n_paths, const char *output_path); 
     55    void runsign(const char ** paths, unsigned int n_paths, const char *output_path, bool timestamp); 
    5656 
    5757}; 
  • middleware-offline/trunk/_src/eidmw/eidlib/eidlib.h

    r59 r63  
    776776        public: 
    777777        PTEIDSDK_API static bool VerifySignature(const char *container, char * error_buffer, unsigned long *error_size); 
     778        PTEIDSDK_API static bool VerifySignature(const char *container, char * error_buffer, unsigned long &error_size); 
    778779 
    779780}; 
  • middleware-offline/trunk/_src/eidmw/eidlib/eidlib.i

    r59 r63  
    530530 
    531531%typemap(javain) const unsigned char* "$javainput" 
     532 
     533%ignore eIDMW::PTEID_SigVerifier::VerifySignature(const char *container, char * error_buffer, unsigned long *error_size); 
     534 
     535%typemap(javaout) bool eIDMW::PTEID_SigVerifier::VerifySignature(const char *container, char * error_buffer, unsigned long &error_size) 
     536{ 
     537 
     538          long          error_size_internal  = pteidlibJava_WrapperJNI.new_ulongp(); 
     539          boolean       retval     = pteidlibJava_WrapperJNI.PTEID_SigVerifier_VerifySignature(container, error_buffer, error_size_internal); 
     540           
     541          error_size.m_long = pteidlibJava_WrapperJNI.ulongp_value(error_size_internal); 
     542          pteidlibJava_WrapperJNI.delete_ulongp(error_size_internal); 
     543          return retval; 
     544} 
     545 
     546%typemap(in) const char * const * (jint size) { 
     547 
     548    int i = 0; 
     549    size = jenv->GetArrayLength($input); 
     550    $1 = (char **) malloc((size+1)*sizeof(char *)); 
     551    /* make a copy of each string */ 
     552    for (i = 0; i<size; i++) { 
     553        jstring j_string = (jstring)jenv->GetObjectArrayElement($input, i); 
     554        const char * c_string = jenv->GetStringUTFChars( j_string, 0); 
     555        $1[i] = (char*) malloc((strlen(c_string)+1)*sizeof(char)); 
     556        strcpy($1[i], c_string); 
     557        jenv->ReleaseStringUTFChars(j_string, c_string); 
     558        jenv->DeleteLocalRef(j_string); 
     559    } 
     560    $1[i] = 0; 
     561 
     562} 
    532563 
    533564//------------------------------------------------ 
  • middleware-offline/trunk/_src/eidmw/eidlib/eidlibxades.cpp

    r59 r63  
    3333} 
    3434 
     35bool PTEID_SigVerifier::VerifySignature(const char *container_path, char * error_buffer, unsigned long &error_size) 
     36{ 
     37        bool res = false; 
     38 
     39        res = APLVerifySignature(container_path, error_buffer, &error_size); 
     40        return res; 
     41 
     42} 
    3543 
    3644PTEID_ByteArray PTEID_EIDCard::SignXades(const char * const* paths, unsigned int n_paths, const char *output_path) 
  • middleware-offline/trunk/_src/eidmw/eidlibJava_Wrapper/create_java_files.sh

    r5 r63  
    1 swig -c++ -java -package be.portugal.eid -o ./GeneratedFiles/eidlibJava_Wrapper.cpp -outdir ./GeneratedFiles ../eidlib/eidlib.i  
     1swig -c++ -java -package pt.gov.cartaodecidadao -o ./GeneratedFiles/eidlibJava_Wrapper.cpp -outdir ./GeneratedFiles ../eidlib/eidlib.i  
  • middleware-offline/trunk/_src/eidmw/mdw_online_patches/apply_patches.sh

    r41 r63  
    22 
    33#patch -p0 -i build_on_glibc_2.14.patch 
    4 #patch -p0 -i dont_ask_for_pin_on_sign.patch 
     4patch -p0 -i dont_ask_for_pin_on_sign.patch 
    55patch -p0 -i use_rpath_origin.patch