| 52 | } |
| 53 | |
| 54 | bool SignedDocument::load(const std::string& uri, DDS::Security::SecurityException& ex) |
| 55 | { |
| 56 | using namespace CommonUtilities; |
| 57 | |
| 58 | original_.length(0); |
| 59 | content_.clear(); |
| 60 | verified_ = false; |
| 61 | filename_ = default_filename; |
| 62 | |
| 63 | URI uri_info(uri); |
| 64 | |
| 65 | switch (uri_info.scheme) { |
| 66 | case URI::URI_FILE: { |
| 67 | load_file(uri_info.everything_else); |
| 68 | break; |
| 69 | } |
| 70 | case URI::URI_DATA: |
| 71 | original_.length(static_cast<unsigned int>(uri_info.everything_else.length() + 1)); |
| 72 | std::memcpy(original_.get_buffer(), uri_info.everything_else.c_str(), uri_info.everything_else.length() + 1); |
| 73 | filename_ = data_filename; |
| 74 | break; |
| 75 | |
| 76 | case URI::URI_PKCS11: |
| 77 | case URI::URI_UNKNOWN: |
| 78 | default: |
| 79 | ACE_ERROR((LM_WARNING, |
| 80 | "(%P|%t) SSL::SignedDocument::load: WARNING: Unsupported URI scheme\n")); |
| 81 | break; |
| 82 | } |
| 83 | |
| 84 | if (original_.length() == 0) { |
| 85 | std::stringstream msg; |
| 86 | msg << "SSL::SignedDocument::load: WARNING: Failed to load document supplied " |
| 87 | "with URI '" << uri << "'"; |
| 88 | set_security_error(ex, -1, 0, msg.str().c_str()); |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | return true; |
| 93 | } |
| 94 | |
| 95 | class StackOfX509 { |
| 96 | public: |
nothing calls this directly
no test coverage detected