test/message_api_test.cc
branchENGINE-128
changeset 1325 5f2e643a4fd7
parent 1006 0dc1800f8b2d
child 1328 b8163caba309
     1.1 --- a/test/message_api_test.cc	Thu Oct 20 21:46:43 2016 +0200
     1.2 +++ b/test/message_api_test.cc	Mon Oct 24 14:35:42 2016 +0200
     1.3 @@ -129,6 +129,31 @@
     1.4      cout << "rating :" << rating2 << "\n";
     1.5      free_stringlist(keylist5);
     1.6  
     1.7 +    cout << "\nTesting MIME_encrypt_message / MIME_decrypt_message...\n\n";
     1.8 +
     1.9 +    cout << "opening alice_bob_encrypt_test_plaintext_mime.eml for reading\n";
    1.10 +    ifstream inFile4 ("test_mails/alice_bob_encrypt_test_plaintext_mime.eml");
    1.11 +    assert(inFile4.is_open());
    1.12 +    
    1.13 +    string text4;
    1.14 +    
    1.15 +    cout << "reading alice_bob_encrypt_test_plaintext_mime.eml sample\n";
    1.16 +    while (!inFile4.eof()) {
    1.17 +        static string line;
    1.18 +        getline(inFile4, line);
    1.19 +        text4 += line + "\r\n";
    1.20 +    }
    1.21 +    inFile4.close();
    1.22 +    
    1.23 +    const char* out_msg_plain = text4.c_str();
    1.24 +    char* enc_msg = NULL;
    1.25 +    char* dec_msg = NULL;
    1.26 +
    1.27 +    PEP_STATUS status7 = MIME_encrypt_message(session, text4.c_str(), text4.length(), NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
    1.28 +    assert(status7 == PEP_STATUS_OK);
    1.29 +    
    1.30 +    cout << enc_msg << endl;
    1.31 +    
    1.32      cout << "freeing messages…\n";
    1.33      free_message(msg4);
    1.34      free_message(msg3);