// file : openssl/agent/pkcs11/url.test.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2018 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include #include // Usage: argv[0] // // Create pkcs11::url objects from stdin lines, and for each of them print its // string representation to stdout, one per line. // int main () { using namespace std; using namespace openssl; using namespace openssl::agent::pkcs11; cin.exceptions (ios::badbit); cout.exceptions (ios::failbit | ios::badbit); try { string s; while (!eof (getline (cin, s))) { url u (s); // Validate the URL attributes. // identity idn (u); access acc (u); cout << u << endl; } return 0; } catch (const exception& e) { cerr << e << endl; return 1; } }