亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? certificatedialog.cxx

?? 這是一個開源碼的sip用戶代理 寫的都很清楚是用C++語言開發的 對于研究sip協議的朋友絕對是有很好的參考價值
?? CXX
字號:
/* *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU Library General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* Copyright (C) 2004  * * Authors: Erik Eliasson <eliasson@it.kth.se> *          Johan Bilien <jobi@via.ecp.fr>*/#include"CertificateDialog.h"#include<iostream>using namespace std;CertificateDialog::CertificateDialog( QWidget * parent/*, certificate_chain * cc */):		QTabDialog( parent ),		persTab( this ),		rootCaBox( 0, Qt::Vertical, "Root certificates database", this ),		certChainBox( 0, Qt::Vertical, 				"Personal certificates chain", &persTab ),		pkBox( 2, Qt::Horizontal, 				"Personal information", &persTab ),		layout( &persTab, 3 ),		rootCaLayout( rootCaBox.layout() ),		certChainLayout( certChainBox.layout() ),		rootCaList( &rootCaBox ),		certChainList( &certChainBox ),		addCaDirButton(  "Add a directory", &rootCaBox ),		addCaFileButton( "Add a file", &rootCaBox ),		removeCaButton( "Remove", &rootCaBox ),				addCertChainButton( "Add", &certChainBox ),		removeCertChainButton( "Remove", &certChainBox ),		certLabel( &pkBox ),		certBrowse( "Certificate", &pkBox ),		pkLabel( &pkBox ),		pkBrowse( "Private key", &pkBox ),		lastChain( NULL ),		certDb( NULL ),		certChain( NULL ),		cert( NULL )		{	setCaption( "Certificates management" );		insertTab( &persTab, "Personal settings" );	insertTab( &rootCaBox, "CA database" );	layout.addWidget( &pkBox );	layout.addWidget( &certChainBox );	//layout.addWidget( &rootCaBox );		rootCaLayout.addMultiCellWidget( &rootCaList, 0, 0, 0, 2 );	rootCaLayout.addWidget( &addCaDirButton, 1, 0 );	rootCaLayout.addWidget( &addCaFileButton, 1, 1 );	rootCaLayout.addWidget( &removeCaButton, 1, 2 );	certChainLayout.addMultiCellWidget( &certChainList, 0, 0, 0, 1 );	certChainLayout.addWidget( &addCertChainButton, 1, 0 ); 	certChainLayout.addWidget( &removeCertChainButton, 1, 1 ); 	rootCaList.addColumn( "Type" );	rootCaList.addColumn( "Item" );	certChainList.addColumn( "Common name" );	certChainList.addColumn( "Issuer" );	connect( &addCaDirButton,  SIGNAL(clicked()), this, SLOT(addCaDir()));	connect( &addCaFileButton, SIGNAL(clicked()), this, SLOT(addCaFile()));	connect( &addCertChainButton, SIGNAL(clicked()), this, 			SLOT( addCertChain() ));	connect( &removeCaButton, SIGNAL(clicked()), this, 			SLOT( removeCa() ));		connect( &removeCertChainButton, SIGNAL(clicked()), this, 			SLOT( removeCertChain() ));		connect( &certBrowse, SIGNAL(clicked()), this, 			SLOT( chooseCert() ));	connect( &pkBrowse, SIGNAL(clicked()), this, 			SLOT( choosePk() ));		certChainList.setAllColumnsShowFocus( true );	rootCaList.setAllColumnsShowFocus( true );	certChainList.setRootIsDecorated( true );	pkBrowse.setEnabled( false );	addCertChainButton.setEnabled( false );	removeCertChainButton.setEnabled( false );}void CertificateDialog::setCertChain( MRef<certificate_chain *> chain ){	certChain = chain;	if( chain.isNull() ){		return;	}	MRef<certificate *> item;	MRef<CertChainItem *> listItem;	item = chain->get_first();	if( !(item.isNull()) ){		cert = item;		addCertChainButton.setEnabled( true );		removeCertChainButton.setEnabled( true );		pkBrowse.setEnabled( true );		certLabel.setText( cert->get_file().c_str() );		pkLabel.setText( cert->get_pk_file().c_str() );	}	chain->lock();	item = chain->get_next();	while( ! (item.isNull()) ){		if( certChainList.childCount() == 0 ){			listItem = MRef<CertChainItem*>(new CertChainItem( &certChainList, item ));			lastChain = listItem;		}		else{			listItem = new CertChainItem( 				(QListViewItem *)*lastChain, 				item );			lastChain = listItem;		}				item = chain->get_next();		//certChainList.insertItem( listItem );	}	chain->unlock();}		void CertificateDialog::setRootCa( MRef<ca_db *> caDb ){	ca_db_item * item = NULL;	QListViewItem * listItem;	certDb = caDb;	if( caDb.isNull() ){		return;	}		caDb->lock();	caDb->init_index();	item = caDb->get_next();	while( item != NULL ){		if( item->type == CERT_DB_ITEM_TYPE_OTHER ){			listItem = new QListViewItem( &rootCaList, 				"Other", 				"unimplemented" );		}		else if( item->type == CERT_DB_ITEM_TYPE_FILE ){			listItem = new QListViewItem( &rootCaList, 				"File", 				item->item.c_str() );		}		else{			listItem = new QListViewItem( &rootCaList, 				"Directory",				item->item.c_str() );		}		item = caDb->get_next();	}	caDb->unlock();}void CertificateDialog::addCaDir(){	QListViewItem * listItem = NULL;	QString result;#ifndef OPIE	QFileDialog * fileDialog = new QFileDialog( this, "certDir", TRUE );	fileDialog->setMode( QFileDialog::Directory );        fileDialog->setCaption( 			QFileDialog::tr( "Choose a certificate directory" ) );#else	OFileDialog * fileDialog = new OFileDialog("Choose a certificate directory", this, TRUE, OFileSelector::EXTENDED_ALL, "." );  #endif	        if( fileDialog->exec() == QDialog::Accepted ){#ifdef OPIE		result = fileDialog->fileName();#else		result = fileDialog->selectedFile();#endif        	//editCertificate.setText( fileCertificate->selectedFile() );		certDb->add_directory( result.ascii() );		listItem = new QListViewItem( &rootCaList, 			"Directory",			result );			}		        delete fileDialog;}void CertificateDialog::addCaFile(){	QListViewItem * listItem = NULL;	QString result;#ifndef OPIE	QFileDialog * fileDialog = new QFileDialog( this, "certDir", TRUE );        fileDialog->setCaption( 			QFileDialog::tr( "Choose a CA certificate file" ) );#else	OFileDialog * fileDialog = new OFileDialog("Choose a CA certificate file", this, TRUE, OFileSelector::EXTENDED_ALL, "." );  #endif        if( fileDialog->exec() == QDialog::Accepted ){#ifdef OPIE		result = fileDialog->fileName();#else		result = fileDialog->selectedFile();#endif        	//editCertificate.setText( fileCertificate->selectedFile() );		try{			certDb->add_file( result.ascii() );		} catch( certificate_exception * exc ){			QMessageBox::critical( this, "Minisip",  		  	"Minisip could not open that certificate file.\n"    			"Please check that the file is a correct\n"			"PEM-encoded certificate." );			delete fileDialog;			return;		}		listItem = new QListViewItem( &rootCaList, 			"File",			result );	}		        delete fileDialog;}void CertificateDialog::removeCa(){	QListViewItem * selected = NULL;	ca_db_item removed;	selected = rootCaList.selectedItem();	if( selected == NULL ){		return;	}		if( selected->text(0) == "File"  ){		removed.type = CERT_DB_ITEM_TYPE_FILE;	}	else if( selected->text(0) == "Directory"  ){		removed.type = CERT_DB_ITEM_TYPE_DIR;	}	else{		removed.type = CERT_DB_ITEM_TYPE_OTHER;	}	removed.item = selected->text(1).ascii();	certDb->lock();	certDb->remove( &removed );	certDb->unlock();	delete( selected );}void CertificateDialog::addCertChain(){	certificate * cert = NULL;	CertChainItem * listItem = NULL;	QString result;#ifndef OPIE	QFileDialog * fileDialog = new QFileDialog( this, "certDir", TRUE );        fileDialog->setCaption( 			QFileDialog::tr( "Choose a certificate file" ) );#else	OFileDialog * fileDialog = new OFileDialog("Choose a certificate file", this, TRUE, OFileSelector::EXTENDED_ALL, "." );  #endif        if( fileDialog->exec() == QDialog::Accepted ){#ifdef OPIE		result = fileDialog->fileName();#else		result = fileDialog->selectedFile();#endif        	//editCertificate.setText( fileCertificate->selectedFile() );		try{			cert = new certificate( result.ascii() );			certChain->lock();			certChain->add_certificate( cert );			certChain->unlock();		} catch( certificate_exception * exc ){			QMessageBox::critical( this, "Minisip",  		  	"Minisip could not open that certificate file.\n"    			"Please check that the file is a correct\n"			"PEM-encoded certificate." );			delete fileDialog;			return;		}		if( certChainList.childCount() > 0 ){			if( lastChain->getCert()->get_issuer()				!= cert->get_name() ){				QMessageBox::critical( this, "Minisip",  		  		"The selected certificate is not\n"    				"assigned to the issuer of the previous\n"				"one." );				delete fileDialog;				return;			}			else			{				listItem = new CertChainItem( 				*lastChain,				cert );				lastChain = listItem;			}		}	}		        delete fileDialog;}void CertificateDialog::removeCertChain(){	MRef<CertChainItem *> temp;	temp = (CertChainItem *)lastChain->parent();//	delete( lastChain );	lastChain=NULL;	if( certChainList.childCount() == 0 ){		addCertChainButton.setEnabled( false );		removeCertChainButton.setEnabled( false );		certLabel.setText( "" );		pkLabel.setText("");		pkBrowse.setEnabled( false );		lastChain = NULL;	}	else{		lastChain = temp;	}}void CertificateDialog::chooseCert(){	CertChainItem * listItem = NULL;	certificate * chosenCert = NULL;	QString result;#ifndef OPIE	QFileDialog * fileDialog = new QFileDialog( this, "certDir", TRUE );        fileDialog->setCaption( 			QFileDialog::tr( "Choose a certificate file" ) );#else	OFileDialog * fileDialog = new OFileDialog("Choose a certificate file", this, TRUE, OFileSelector::EXTENDED_ALL, "." );  #endif        if( fileDialog->exec() == QDialog::Accepted ){#ifdef OPIE		result = fileDialog->fileName();#else		result = fileDialog->selectedFile();#endif		try{			chosenCert = new certificate( result.ascii() );					} catch( certificate_exception * exc ){			QMessageBox::critical( this, "Minisip",  		  	"Minisip could not open that certificate file.\n"    			"Please check that the file is a correct\n"			"PEM-encoded certificate." );			delete fileDialog;			return;		}		cert = chosenCert;		certLabel.setText( result );		/* Set this certificate as root of the cert chain */				listItem = new CertChainItem( &certChainList, chosenCert );		certChain->clear();		certChain->add_certificate( chosenCert );		pkBrowse.setEnabled( true );		addCertChainButton.setEnabled( true );		removeCertChainButton.setEnabled( true );		lastChain = listItem;	}		        delete fileDialog;}void CertificateDialog::choosePk(){	CertChainItem * listItem = NULL;	QString result;#ifndef OPIE	QFileDialog * fileDialog = new QFileDialog( this, "certDir", TRUE );        fileDialog->setCaption( 			QFileDialog::tr( "Choose a private key file" ) );#else	OFileDialog * fileDialog = new OFileDialog("Choose a private key file", this, TRUE, OFileSelector::EXTENDED_ALL, "." );  #endif        if( fileDialog->exec() == QDialog::Accepted ){#ifdef OPIE		result = fileDialog->fileName();#else		result = fileDialog->selectedFile();#endif		try{			cert->set_pk( result.ascii() );		} 		catch( certificate_exception_pkey * exc ){			QMessageBox::critical( this, "Minisip",  		  	"The private key file you selected does not.\n"    			"match the selected certificate." );			delete fileDialog;			return;		}		catch( certificate_exception * exc ){			QMessageBox::critical( this, "Minisip",  		  	"Minisip could not open that file.\n"    			"Please check that the file is a correct\n"			"PEM-encoded private key." );			delete fileDialog;			return;		}		pkLabel.setText( result );		certChainList.setEnabled( true );		((CertChainItem *)(certChainList.firstChild()))->pkFileName = result.ascii();	}		        delete fileDialog;}void CertificateDialog::accept(){	//CertChainItem * item = (CertChainItem *)certChainList.firstChild();	/* Rebuild the certificate chain */	//certChain->clear();	/*while( item->childCount() != 0 ){		certChain->lock();		certChain->add_certificate( item->getCert() );		certChain->unlock();		item = (CertChainItem *) item->firstChild();	}*/	QTabDialog::accept();}		CertChainItem::CertChainItem( QListView * parent, MRef<certificate *> cert ):	QListViewItem( parent, cert->get_cn().c_str(), 			cert->get_issuer_cn().c_str()  ){			this->cert = cert;	this->fileName = cert->get_file();	this->pkFileName = cert->get_pk_file();}CertChainItem::CertChainItem( QListViewItem * parent, MRef<certificate *> cert ):	QListViewItem( parent, cert->get_cn().c_str(), 			cert->get_issuer_cn().c_str()  ){			this->cert = cert;	this->fileName = cert->get_file();	this->pkFileName = cert->get_pk_file();}CertChainItem::~CertChainItem(){			//delete( cert );}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品欧美日韩精品一| 欧美美女一区二区| 亚洲一二三区在线观看| 欧美tickling挠脚心丨vk| 99re成人精品视频| 国产一区亚洲一区| 午夜亚洲国产au精品一区二区| 久久精品欧美一区二区三区麻豆| 欧美三级视频在线观看| www..com久久爱| 麻豆一区二区三| 亚洲第一久久影院| 亚洲同性gay激情无套| 久久一日本道色综合| 欧美日韩高清一区二区| 99久久精品免费看国产| 国产精品一区二区在线播放| 三级亚洲高清视频| 一区二区三区精密机械公司| 国产日产欧美一区| 精品国产一区二区三区忘忧草 | 成人黄色777网| 九九九精品视频| 日韩精品三区四区| 亚洲成人精品一区| 亚洲在线观看免费| 亚洲精品欧美二区三区中文字幕| 国产视频一区二区三区在线观看| 日韩三级伦理片妻子的秘密按摩| 欧美色网一区二区| 欧美怡红院视频| 色婷婷综合久久久久中文 | 欧美精品一区二区三区在线播放 | 精品中文字幕一区二区| 视频在线在亚洲| 五月激情综合婷婷| 午夜精品视频一区| 亚洲高清久久久| 亚洲一级二级三级在线免费观看| 夜夜精品视频一区二区 | 亚洲人妖av一区二区| 国产精品美女一区二区在线观看| 国产色91在线| 中文字幕欧美激情一区| 中文字幕免费不卡在线| 国产精品乱人伦中文| 综合久久给合久久狠狠狠97色| 国产精品女主播av| 亚洲欧美日韩久久| 亚洲一区二区视频在线观看| 精品国产一区二区三区不卡 | 夜夜精品浪潮av一区二区三区| 最新热久久免费视频| 亚洲色图丝袜美腿| 夜夜揉揉日日人人青青一国产精品 | 亚洲mv在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 麻豆91在线观看| 国产精品自拍网站| 91网站最新地址| 欧美日本在线看| 欧美变态口味重另类| 国产欧美精品国产国产专区| 成人免费视频在线观看| 夜夜精品视频一区二区| 青青草97国产精品免费观看| 激情小说亚洲一区| 亚洲精品一区二区三区影院| 久久久久综合网| 亚洲天堂免费在线观看视频| 午夜精品久久久久久久久久| 久久99国产精品久久| 成人免费观看av| 在线精品视频免费播放| 欧美草草影院在线视频| 国产精品麻豆久久久| 亚洲大尺度视频在线观看| 久久国产精品露脸对白| jlzzjlzz亚洲日本少妇| 欧美视频在线观看一区二区| 精品国产乱码久久久久久浪潮 | 亚洲中国最大av网站| 免费观看在线色综合| 成人精品视频一区二区三区| 欧美日韩国产综合视频在线观看| 欧美变态tickle挠乳网站| 亚洲视频网在线直播| 日韩电影在线免费看| 成人h版在线观看| 欧美喷潮久久久xxxxx| 国产日韩欧美a| 亚洲不卡av一区二区三区| 韩国三级中文字幕hd久久精品| 99国产麻豆精品| 欧美一区二区三区爱爱| 自拍偷拍国产亚洲| 精品一区中文字幕| 欧美三级三级三级爽爽爽| 国产欧美日韩在线| 免费在线观看视频一区| 91传媒视频在线播放| 久久久久久久久岛国免费| 亚洲18影院在线观看| 99re热视频这里只精品| 久久综合久久综合亚洲| 日韩精品每日更新| 91官网在线观看| 中文字幕一区三区| 国产v综合v亚洲欧| 精品国产乱码91久久久久久网站| 亚洲一区二区偷拍精品| 91丝袜高跟美女视频| 久久综合久久综合亚洲| 免费在线看一区| 欧美肥大bbwbbw高潮| 亚洲视频1区2区| 9人人澡人人爽人人精品| 久久精品视频一区二区三区| 久久国内精品视频| 欧美一区二区三区四区久久| 亚洲一区二区三区中文字幕| 99久久免费视频.com| 国产欧美日韩三区| 国产精选一区二区三区| 2024国产精品| 精品一区二区三区在线观看国产| 91精品欧美久久久久久动漫| 亚洲成人免费视| 欧洲国内综合视频| 亚洲福利视频一区| 欧美色图免费看| 性欧美疯狂xxxxbbbb| 国产精品色呦呦| 国产成人精品免费网站| 久久久国产午夜精品| 国产成人综合在线观看| 久久久久久久免费视频了| 国产伦精一区二区三区| 久久综合色一综合色88| 国产精品亚洲一区二区三区妖精| 精品国产一区二区三区av性色| 久久97超碰国产精品超碰| 久久嫩草精品久久久久| 国产成人综合在线播放| 国产精品天干天干在线综合| 成人av电影在线| 亚洲精品免费在线观看| 欧美午夜精品免费| 视频一区免费在线观看| 欧美不卡一区二区三区四区| 国产一区在线不卡| 国产精品热久久久久夜色精品三区| 成人国产亚洲欧美成人综合网| 中文字幕亚洲一区二区va在线| 色婷婷综合久久久| 亚洲韩国精品一区| 日韩精品一区二区三区在线播放 | 欧美亚洲免费在线一区| 午夜成人在线视频| 欧美一区二区免费| 国产一区二区主播在线| 国产精品视频你懂的| 欧美网站大全在线观看| 久久精品国产**网站演员| 国产欧美日韩亚州综合 | 另类调教123区| 久久精品人人爽人人爽| 91黄色免费观看| 免费在线观看成人| 中文在线一区二区| 欧美剧情片在线观看| 国产综合色精品一区二区三区| 国产精品欧美一区喷水| 欧美高清视频不卡网| 国产伦理精品不卡| 亚洲高清久久久| 国产亚洲美州欧州综合国| 欧美色倩网站大全免费| 久久精品国产一区二区三区免费看| 欧美国产乱子伦| 欧美美女网站色| 成人黄色免费短视频| 奇米色777欧美一区二区| 国产精品久久久久久久久久免费看| 欧美午夜精品久久久久久孕妇 | 美女精品一区二区| 中文字幕在线一区二区三区| 91精品一区二区三区在线观看| 不卡欧美aaaaa| 久色婷婷小香蕉久久| 亚洲一区在线电影| 日本一区二区三区视频视频| 678五月天丁香亚洲综合网| 成人avav在线| 国内成人免费视频| 天堂在线亚洲视频| 亚洲三级久久久| 国产三区在线成人av| 日韩欧美国产午夜精品| 在线观看免费视频综合|