DCMTK简介十一-dcmtls程序库
本帖最后由 medimage 于 2015-12-4 21:29 编辑十一、dcmtls程序库
dcmtls是网络库的安全扩展。This module contains classes that implement DICOM network communication tunneled through a Transport Layer Security (TLS) connection, conforming to the DICOM "Security Enhancements One" extension (formerly Supplement 31). This module requires the external OpenSSL library.主要接口:
--DcmTLSTransportLayer: factory class which creates secure TLS transport layer connections and maintains the parameters common to all TLS transport connections in one application (e.g. the pool of trusted certificates, the key and certificate to be used for authentication and the list of ciphersuite to be used for association negotiation.)。在tlslayer.h文件中定义。
--DcmTLSConnection: this class represents a TLS (Transport Layer Security) V1 based secure transport connection.举例:
--TLS的关联请求应用
T_ASC_Network *net; // network initialization code not shown,
T_ASC_Parameters *params; // we just assume these pointers to be valid// create TLS object that initializes the random generator through a file// "random.dat" containing random data (1 kByte is sufficient).DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, "random.dat");if (TCS_ok != tLayer->setPrivateKeyFile("privkey.pem", SSL_FILETYPE_PEM))
{
cerr << "unable to load private key" << endl;
return;
}if (TCS_ok != tLayer->setCertificateFile("certificate.pem", SSL_FILETYPE_PEM))
{
cerr << "unable to load certificate" << endl;
return;
}// enable the TLS_RSA_WITH_3DES_EDE_CBC_SHA ciphersuitetLayer->setCipherSuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);// accept any certificate from the remote site (not recommended)tLayer->setCertificateVerification(DCV_ignoreCertificate);// register and activate TLS layerASC_setTransportLayer(net, tLayer, 1);ASC_setTransportLayerType(params, 1);
谢谢分享 看看!!!!!谢谢楼主!!! 楼主太伟大了 有谁试过啊! 谢谢LZ 回复看下,!!
页:
[1]