This library provides a simple and nice C++ wrapper around these libraries, so that programmers can concentrate on functionality. It offers general support for PCSC-lite, OpenSSL, PKCS#11, plus specific functionality for the SuisseID.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
747 B
25 lines
747 B
/*! @file |
|
|
|
@id $Id$ |
|
*/ |
|
// 1 2 3 4 5 6 7 8 |
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
|
|
|
//#define OPENSSL_LOG(X) |
|
#include <openssl.hxx> |
|
#include <iostream> |
|
|
|
int main(int argc, char** argv) try { |
|
openssl::Init init; |
|
std::string host(argc>1?argv[1]:"swisssign.com"); |
|
std::string port(argc>2?argv[2]:"80"); |
|
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl; |
|
openssl::TCP ssl(host+':'+port); |
|
ssl<<"GET / HTTP/1.1\x0D\x0AHost: "<<host |
|
<<"\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A"; |
|
while (ssl) std::cout<<ssl; |
|
return 0; |
|
} catch (const std::exception& x) { |
|
std::cerr<<"**** ERROR: "<<x.what()<<std::endl; |
|
return 1; |
|
}
|
|
|