add example private key & encrypted PGP/INLINE mail encrypted with this key ENGINE-322
authorRoker <roker@pep-project.org>
Thu, 28 Dec 2017 22:07:33 +0100
branchENGINE-322
changeset 233310a26f0f071d
parent 2332 23ed7bbd53f4
child 2334 36d0b3f53f5c
add example private key & encrypted PGP/INLINE mail encrypted with this key
test/message_api_test.cc
     1.1 --- a/test/message_api_test.cc	Tue Dec 26 22:55:32 2017 +0100
     1.2 +++ b/test/message_api_test.cc	Thu Dec 28 22:07:33 2017 +0100
     1.3 @@ -14,67 +14,129 @@
     1.4  
     1.5  void test_MIME_decrypt_message()
     1.6  {
     1.7 -	const std::string mimetext =
     1.8 -		"Return-Path: <roker@pep-project.org>\r\n"
     1.9 -		"X-Original-To: roker@pep-project.org\r\n"
    1.10 -		"Delivered-To: roker@pep-project.org\r\n"
    1.11 -		"Received: from localhost (localhost [127.0.0.1])\r\n"
    1.12 -		"	by dragon.pibit.ch (Postfix) with ESMTP id C4FF8171C055\r\n"
    1.13 -		"	for <roker@pep-project.org>; Tue, 26 Dec 2017 17:14:42 +0100 (CET)\r\n"
    1.14 -		"Received: from dragon.pibit.ch ([127.0.0.1])\r\n"
    1.15 -		"	by localhost (dragon.pibit.ch [127.0.0.1]) (amavisd-new, port 10024)\r\n"
    1.16 -		"	with ESMTP id GojZqayOfeAq for <roker@pep-project.org>;\r\n"
    1.17 -		"	Tue, 26 Dec 2017 17:14:39 +0100 (CET)\r\n"
    1.18 -		"To: Lars Rohwedder <roker@pep-project.org>\r\n"
    1.19 -		"From: Lars Rohwedder <roker@pep-project.org>\r\n"
    1.20 -		"Subject: Test mail PGP/INLINE\r\n"
    1.21 -		"Message-ID: <8fff4ca8-a8aa-f016-a7fd-39c98a9a4f43@pep-project.org>\r\n"
    1.22 -		"Date: Tue, 26 Dec 2017 17:14:38 +0100\r\n"
    1.23 -		"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0)\r\n"
    1.24 -		" Gecko/20100101 Thunderbird/52.5.0\r\n"
    1.25 -		"MIME-Version: 1.0\r\n"
    1.26 -		"Content-Type: text/plain; charset=utf-8\r\n"
    1.27 -		"Content-Language: en-US\r\n"
    1.28 -		"Content-Transfer-Encoding: 8bit\r\n"
    1.29 -		"\r\n"
    1.30 -		"-----BEGIN PGP MESSAGE-----\r\n"
    1.31 -		"Charset: utf-8\r\n"
    1.32 -		"\r\n"
    1.33 -		"hQIMA+NkSS2yiGkeARAAgtW5xzq/ksfUIRxPZIDwGIANH0iLKhbnFbg/GssuyQOE\r\n"
    1.34 -		"+7rdevKX9UcxwBcRGJYs/aSMvY9zQE4tJy3ohf6+jnRzh3RH055A6+bsUWS/cex3\r\n"
    1.35 -		"fL7PtmQUT2PRXcXfrrk+oiCPXdJPVyRJXKGkKzwmpy7+U8mSSPoR3SIciFy/9CKs\r\n"
    1.36 -		"zhiTuQm8momz5gP/FpNyIU6E0xOdvyv9G90Y0qLzQyWFCY9fo3uRvKtvQmp2A0vj\r\n"
    1.37 -		"nI0rMBBnblLWLkLhTgEhsBSxi5/Emu2kzYXdhezb+IxuMrl7LhrZkFCSNnPWozJ7\r\n"
    1.38 -		"gyEcxK9tPOyK/SCYY+s9vg6D3F8mdJIT8Vi/87v1hQjvehc+xtiY/nNadaSDPWOh\r\n"
    1.39 -		"eWZ8FWVNRU3xowT5gyC75F8K+5IkhxsdmFGNznMzX9m+09fI515oVbDPe493JPNq\r\n"
    1.40 -		"TjKOVq406EFGIJ5+DGd1IDStUZuZBl4Z79bz9uF/vKCnvFzskTW69NypoDOe3+XL\r\n"
    1.41 -		"mP86vm3dUB3kWStHyWvH2RFbHnrbyHjZhQihsu8NdGBa3ZYatwlPhwVGaucSkrYM\r\n"
    1.42 -		"vSEgKyN+7XqQQIQSv6ncxzoNlZ7Cgoyh0BeaTIjDVH/0H6oUrljGO8UwcNhEOxGH\r\n"
    1.43 -		"WRBRI/emArMa8ro/tJ08jbFkRB1qiLSdfh0bufD0hWGGG16gXvvND4UgnVZ3VnzS\r\n"
    1.44 -		"6QGNwgYIqTQqXgsj/9PkKVaoZp3OyldpS/tq93Y4cES9DjSAcxN9MVgPIdvkGvaa\r\n"
    1.45 -		"MrKhpGu+prYEQJm1KfB4yTB+SuQOjngFiDXtsbN7jC7nCRpgQIjbCG3QKl8QUdrU\r\n"
    1.46 -		"Uy3OHuaGJUgKwy330Hi9cfCKD3lCBHr7XhSbZ/spuZudB5/bv6doQlrR9W2ccMAF\r\n"
    1.47 -		"RWsZAg7BXXzLvROgHCpcnNG/yHllQKpZ2REsUlbdNc2Sbw+tcjS1j18jGUwkSGhD\r\n"
    1.48 -		"j0hVQSYVJ1DN17QYPHV9w7WvHHw9QgDK0eDIkcykVAQqB25U+H61wg3HrQ73CFj2\r\n"
    1.49 -		"v0fyFYcSsCAj7LZnODLw6Mq+JzEIJUS1KPkJ4tiABXNCetwSUyJjaUlCfYHVE3Xi\r\n"
    1.50 -		"OjgNm1QLqjt2adK1Yi0gj7Go4CIFS4UE03WZfQkEh6y16ZSivAEQ9Wzy8E+Uy5VX\r\n"
    1.51 -		"diJQNPZ0VJozckp4wR+2Ao3yeBgQG9/zUbhihYBBGEPH6FmxscXcajssYrsbUh0D\r\n"
    1.52 -		"3IyncNEwrneiP430RhkkF9yQb+xwNxvYE0B+11PhuvtBBukDQjLSKN21mR8vBYBS\r\n"
    1.53 -		"kl1D/Z2Z388ObjPPXXGBpfWhhQyHKhPMJ0HMGUkCOf4IlmkH+vJt9a7Ex10URs1a\r\n"
    1.54 -		"KuFTB5EeNGsI6lQaze+mai7On1hI/wEC51ul5n46c75iuLRLzSTxJ/gjwg0gdHHZ\r\n"
    1.55 -		"5PLVTYfc58OXhiSDWhTvX+M+lWm49LQu+dCL3/pfLuR4D6Ytz/FDSFrSwNUQ7vOx\r\n"
    1.56 -		"3MBVK7dshY5IbTF3jbLr0fkdX6wmXapgjMF7KYS8FqxNUC/IEC1mCgSiHZDCA8TT\r\n"
    1.57 -		"WLXnnsGmB7eRAlYBpO2TAhhAhhg0aT+GhrvkZwROW4Keka+VGSt4R0+nKhrCuYkQ\r\n"
    1.58 -		"Vo5t3qUtVAo2ic/ktisa4rNPND0XQAcCi58=\r\n"
    1.59 -		"=vf0v\r\n"
    1.60 -		"-----END PGP MESSAGE-----\r\n"
    1.61 -		"\r\n";
    1.62 -	
    1.63 +	static const std::string private_key =
    1.64 +        "-----BEGIN PGP PRIVATE KEY BLOCK-----\n"
    1.65 +        "\n"
    1.66 +        "lQOmBFpCxkEBCCC8ugYsWOsv966JOl5Ahdw6YiobbU9peFLV8aMBOG+oNIPs3BQj\n"
    1.67 +        "u3FUugkVqA5In93oqVgNZ2LU6Y/RWldN+Pc4IMf6qSZnTBj/1ffBjuqAow1hPEYV\n"
    1.68 +        "354LNYoQtJXioY0X8FjRgt+NoBPphRbo+XJ0uIQckJey6uvvtukEZkMLM1ur1aID\n"
    1.69 +        "9biJZ7yXtJM7KxN5792Vo2gGp/1hlFW6SfM7E0g60L5DT8C/BsYeKtMmxKNZngo6\n"
    1.70 +        "ZBxLDAcxMcT5UpRW79B34pTINZAEsvLeT7TLajzqP/OggUrFkkwLr3KJk09aFF+6\n"
    1.71 +        "TN6CI2fDdSqdoPVEgNrZE9zFqAgVWOdhLOHRpXgt7wARAQABAAgZATpqsN4xRaIk\n"
    1.72 +        "giMdmujkGoMqB/ypoCOW0mqcp3ThESSqWR/Dh8n//k+poHj0Atf7fzie6JNsKruM\n"
    1.73 +        "Yo3mdIzyuuxHsONp6xEtNnkDgEB4WTb2btQQFrNaWXNTPzGVqiBoBShcw5xI7SiG\n"
    1.74 +        "CKaDlCePbaAHyBHO0uzBdVFo6czqkceXSJ+hNDY7xbURbkgIA5SGJ+8cssmcKKoc\n"
    1.75 +        "LDY34S3Pu0gG3+K6gSedYaHAqVVQn8dmEitvDFQ96sTNIpPiMp5Tc+/8UXziF91f\n"
    1.76 +        "XRrXYX9o3nkCvz01qtjR4LQVDztysm3/VmDcsjqhzALiiBLigyglpE5DEp0+wMUq\n"
    1.77 +        "gw5TpWZ63lf6XjEEEM+c+D3HHsEnh24+DNU2OyfFZGpp9olSaTDcXtEBuBTt/Uhy\n"
    1.78 +        "NnqF4MswQ2me4Lfr4D4sUS5jtsKkee+2IQuwtg/bBVYsL6MfV2llJco2vrOCb6y8\n"
    1.79 +        "u9CnQhRbVBd6kBMiJeE50Ijk3jP78GrkPm3rGWKCWRuXVr07+U2MsEnvSkkBfpEE\n"
    1.80 +        "EOi2NcXCCJux9xZv0xOyWogXDVLVrrhs8/PGjJO1IeaMtmrzleo3azUbWus/BYLA\n"
    1.81 +        "vJkO+PElg/MCc2ub5hFs7IqSbLmteWFiSOzTcdHNWeqETsixAc8dpbq0zhkPwdzA\n"
    1.82 +        "otLEBS3mpaB29Bpt9lzgewHoVI/o/OvUFFaP+b1Fd4wOJH8EELZPWw+85tSB1l63\n"
    1.83 +        "4B+77YoBc9wDBFg7Pt4Eo0eghFZ/159YTA1bcr3fZ8bYIgiHHNLC/Fsx+sUu00PC\n"
    1.84 +        "ctLrOxGRbuDyNy2rsezf8Bz8xpihBPuBmSbKoaZguSazgpuC1LPkVbQQVaN1h+Ir\n"
    1.85 +        "9/tJufw+hT9Eggvx5xtCo7GD1trnx0xLKbQhVGVzdCBUb25pIDxlbmdpbmUtMzIy\n"
    1.86 +        "QHBlcHRlc3QuY2g+iQE8BBMBCAAiBQJaQsZBAhsDBgsJCAcDAgYVCAIJCgsEFgID\n"
    1.87 +        "AQIeAQIXgAAKCRCvYy6fx5m31NWeCCCXgm1J7Pq4ECKaMZcp7WoWguXQW+Ellgrx\n"
    1.88 +        "B6EjZmvy1iB0RYaDz6F0HCXd0WtC2YDlkxJ47rKBHsnmcyHbFNlY0fgc5Uhs7apI\n"
    1.89 +        "bBMHHRGwl8pie05DqxQ0jBxO2esk/IPJDhLXw7gZvaY/9PUS669QWoq+L/Hhph8V\n"
    1.90 +        "5v65jnw2937bOaf6wvEUUj2cg6cUaPTZSXv26vxUrT8RD+DxbQiNjJIeGRfVj3QY\n"
    1.91 +        "9GCTcp45ZaB8kLQEVayFrC3Jougcklk5DS1zlFCHiYLa4cco/68XHL7/CFdIxxsK\n"
    1.92 +        "Rd/3FYWX6zfQZJs5U6KmGy18cXvk0OOtTru9aNHR0YiLj4Vs8K+mWA10vZ0DpgRa\n"
    1.93 +        "QsZBAQggwrnOsiJ3JNB+mTm9pZbX4mUkw7OXrar1CvOVDqrnI+H+Z9/DC1FDEupw\n"
    1.94 +        "8mD3fFV4veO6smjb9wWAXhmU88OxXziChM8WJlWz2GrZPoM2DIYu1gLycp7wo1Md\n"
    1.95 +        "mzhd/5tpBWMJ4gGS9AjvQc5ffk7JVBAnmhh4ZtdoEctHMJs7+1RhXE7KUM1QWjew\n"
    1.96 +        "2GAVAaw+KsuXvqsF8soXvlFaHe9sTHKXKUD/MN4WWPR3SIvC4yoadlUpCMfooXf8\n"
    1.97 +        "ZCFLbVirkqGy5AakF7thlaTq7bxEX5BQbP/DjVuTTd311jk4x7oT+1bT7D6iIoES\n"
    1.98 +        "DKfYijw+059CrCbjFUn3/RRg5sx/55FA2XEAEQEAAQAIHiu228SYwSeGGM2cLUt1\n"
    1.99 +        "vBxKeYDnmeb2aJFfUnia/E3NZ7f4/0fUo9qkv9th0l1asMLsU1bG/I6NcR5u3sYE\n"
   1.100 +        "iham0IIxHTdY6QluHzwN573TB8OqoLQDo2D/ATf95PhDcsWvUKIomU1ojhG3Wy+3\n"
   1.101 +        "TzIseD97O9hWhjnsaRxr1QDclghnNffz589T40wAQAkdQlfDuBABberGNR0DsCZq\n"
   1.102 +        "w1xx1+EaEt8o7sXfRMFKoBLJzya0toJNIBGdXCXVPFPtYx6RAiD1KoufgXwVCBaL\n"
   1.103 +        "CHc8QvurgyMBghc9pBcdGs60fNhWn1U4qeWzPOHO95ZWVFObBiuGqkX25revf1Dg\n"
   1.104 +        "RTY5OsBTBBDdnMElWA+l6ctlSX8vNUQBin7aPbHu1HrmUxH9EiKwUd6jdoFmssw7\n"
   1.105 +        "soohAfYJCsuTQLHPI+9W6okF4rjlvl0aS2cN4HSbLjTwdNiUgIHVKJPDq8WDgCsV\n"
   1.106 +        "bR09wsLkohmoX/qZFEQMKdr7A2ar64zQzpx6ZFB0kS71Fr6+rFUAIzePBBDg8QXr\n"
   1.107 +        "J/R6iZYnMNv/mzyNunbM3B7siwbILS1kLeS6lTYeaKORa7JFRc776rkWV//P1Soc\n"
   1.108 +        "nW2byeBxNxOmdNXlNsA6Gg8O4rn3rxEgBZlsOYUG1ZcPZZu8kNFkLTYP+mgFIP3I\n"
   1.109 +        "izn858IbnNFm0HjRMGiS+zip2r/rgbniIhLQ2l7/BBCL+2x0+Ww5I/el6A7k+y2X\n"
   1.110 +        "3xazBVOQfpPl9BgMdsuO0BBlN5RpbTfE8TVpWneeamAuRJh7ArApbAS508Thw7Sj\n"
   1.111 +        "8iLKXj5yScAEC2WO9ZsHqJ/RN3VyhCCI0u3Y75wB3qfcroZUlwvQb/WfH8/vHr2O\n"
   1.112 +        "E72YoprbNOmRFZ7LZkRX56URRn2JASMEGAEIAAkFAlpCxkECGwwACgkQr2Mun8eZ\n"
   1.113 +        "t9RozQggkb/Lb08g4w99CcXq6hV28D5bOHjiEx4XNdkeLVExhfk1zgQ9lf4rjyb2\n"
   1.114 +        "ox+e3Dc5S590NoYg/35vd/QWPsg1JiCvAu296lzOLtIiTAI1KGUJdbsLxRIduOU7\n"
   1.115 +        "6n/KVxRG4w4kJqpbu+UzBY7KtDbWzapJx8v0sdsTOVxg7kFxvYtra5TRaPfce4EX\n"
   1.116 +        "ox2V2HPhtFNSILH8Jqh/R0PV5RRbNFHZA4cKXkBJMw3BcpbpXeLCXiD6P3FNVSKh\n"
   1.117 +        "Rkd3JY0XJhwbvGPCRWkobtxkieZe0bCmKu8+gw0Zqm2QNA7J6iMT4rMZWH9k7lpp\n"
   1.118 +        "okyt7GheXlwKEtVQSAcH/NalK9Q+ckaQttA=\n"
   1.119 +        "=KACn\n"
   1.120 +        "-----END PGP PRIVATE KEY BLOCK-----\n"
   1.121 +        "\n";
   1.122 +
   1.123 +    static const std::string mimetext =
   1.124 +        "To: denden@peptest.ch\r\n"
   1.125 +        "From: Lars Rohwedder <roker@pep-project.org>\r\n"
   1.126 +        "Subject: Test for ENGINE-322\r\n"
   1.127 +        "Message-ID: <4b2d328c-b284-e359-1c2c-fe136358b8a6@pep-project.org>\r\n"
   1.128 +        "Date: Thu, 28 Dec 2017 22:00:47 +0100\r\n"
   1.129 +        "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0)\r\n"
   1.130 +        " Gecko/20100101 Thunderbird/52.5.0\r\n"
   1.131 +        "MIME-Version: 1.0\r\n"
   1.132 +        "Content-Type: text/plain; charset=utf-8\r\n"
   1.133 +        "Content-Language: en-US\r\n"
   1.134 +        "Content-Transfer-Encoding: 8bit\r\n"
   1.135 +        "\r\n"
   1.136 +        "-----BEGIN PGP MESSAGE-----\r\n"
   1.137 +        "Charset: utf-8\r\n"
   1.138 +        "\r\n"
   1.139 +        "hQEQA30SSxlFRbxRAQgggvPrko4vJ988ylqdGF7/Jtw/61VddHg7rjOTG7yZiq2J\r\n"
   1.140 +        "p0lXb0N9Bz8SON/m4NWWS5ij0Bj1wMdTgLowLxMz0PfCIyyiQIfqEBAXUcAOQh2f\r\n"
   1.141 +        "Pg2iZbynrQ1T4M/D0BlIn2bfXb790Cni+o1OmWTCx4wC6AKtGvlonLAIsH1hUfs+\r\n"
   1.142 +        "yKOyCCNaNSmyAPeF3F5v7iEO5Eez1R/UrtxcYj2QmCdVt5v0AuAlm5HVPJgj7wCd\r\n"
   1.143 +        "MeRmK4a1+sM51CcCf6Tk9uZbIVrr/XkyGVPmmHTK8E4QmvmL6PGeuIitwqKe80/L\r\n"
   1.144 +        "XH4ZYPXIxVU9o5HoSo3YJ3BSKLQzCoDRCD8JlCo08K6mrpuFAgwD42RJLbKIaR4B\r\n"
   1.145 +        "EADNgisKiIku4SrBmBkryyKMYmOTW0QKnY/wfNselpzuj5cMpKA4e60x/wEQRIvC\r\n"
   1.146 +        "m1ZO7LjhbVjNf6ws2FgytnTRf+8R/R8mp6/XIDeUvaBvUku5yoRjTeznFRwpj6yT\r\n"
   1.147 +        "WfQMlLojI2fe+y5fHKIIjTpW5HOQQv7sZ4UzE+jRpRErRVq4UI49l7yTBnG0j75w\r\n"
   1.148 +        "UZTt05OnJMQrCCiD7Fu9xDw5If3x884GehKpFGm6XqZ8V7NhwGk6mf62rZEouBQh\r\n"
   1.149 +        "AhTu/irkz30PpWY3gGj2YF0PIaQmweb9u2izox1kTfq2xRfPLg/4cOgBKy1/Xeea\r\n"
   1.150 +        "IVeaACAcoNdJaYuZCSe9CMbr5s7kusE22/6fB0L1itGr09EzhwGJS/+XSt0IwcJw\r\n"
   1.151 +        "7XDUGtmYXuTy08wUKU9McxXJ8nlUkXF9ZcswVxHKG36ZRfzx5eBPjzSnDo8EZHs2\r\n"
   1.152 +        "wr7wnS8s8J+AvB7kZYFChAct4KH9OwT3/2pSdhd8/sSCkj2zGtrB+8h2QkIE4csD\r\n"
   1.153 +        "rIHtBp4oWCJq1XOKYPvdGqWBxZ/7086kksB99Eyn+sy5C0iNTbEdUN4JkIYq1C0n\r\n"
   1.154 +        "DExbr+dqip65DEJRj7TPfwTJ5D28djPYutanSRfJS/niPqztWu0R1ISucw1TMdGU\r\n"
   1.155 +        "NcqsqQLPYzTV6xTq+bgBsi8DO4tXkcOpf7eDEP+5kDOncNLpAZGc9NUnVa/jpkYO\r\n"
   1.156 +        "XE+CNJ5SYQPdsGcir9JNXNTDgKAGSTI7OAU/ZxOcMCsmctJATcAZERFgvUy8YZN1\r\n"
   1.157 +        "3X4Ii6osc8u6shJrjL/detZs8LH8wSe6NYQdtipQo4ySAYQAO9tXdoRrfktXrYus\r\n"
   1.158 +        "eLh86toD19D5R9RxHnVEMQP5CdNWgvX7X4ngK94kJq18QCDa1bZXhHBKmWOnAtyL\r\n"
   1.159 +        "zpcUNnCWo2gml6GX2kyuL+5Ji6afwKHZg+iag8wBDLGQ+hoOMnzk1iP4DFeQ7iZN\r\n"
   1.160 +        "Qvd4mWWASd2BCnf9ulKiMw1wdzN2mpYRNo+nRHx0Zu50VUyj0xMm8VSyUZis5+YH\r\n"
   1.161 +        "I3Se7UEeS6ppLsiGcyaJDCMp/38xt5SU5NY4wAAubc6MJclECcvSkM1W/20wQ4di\r\n"
   1.162 +        "z5FhKHlqZaPTXN02h0P78wKDDwJr7fFvqtB8G2LgtwbXAkOUvn8vbomQLHBkQ+GH\r\n"
   1.163 +        "AuXqBGxKrIwyIEjLZf6hDz++0fDa/ACeFynpxNl1ehmvCl5CsEMcCiM+Ic2pZ/ML\r\n"
   1.164 +        "+Hle0GWEKej4WBzXi0j4pzR4WZFt9XCv5+yYAg+UHKc2Kn0Q+bC1AZYxhQDicTP9\r\n"
   1.165 +        "qNKTLBHRAeJoQ1y4vHXYGwRGH+penfJiKsQsyOOeoQlZar8tvRYR77K8FhxBtnYK\r\n"
   1.166 +        "Xrv+rb1BT/2Ey7P4jb8PiZpbic7ACu1MjFdmlPKrExe5+MY+Pr9ms+hxJrdBH736\r\n"
   1.167 +        "K6dojmWUQKpJRzue2lWsfESLxIVeB+vmbg2zU3PflCmMIsRNh2US7vZj2WdgqSqz\r\n"
   1.168 +        "wR2eTG4MgPVy4iiGOVT2JWS5t+KXm3kwUZTy9Twi6P1ebNm/B8KQwlutssdWip2q\r\n"
   1.169 +        "hON1aFYa4L601zrHgow592PdBkRPQZGiXNHffCvHgsxBHsj4G4JWZhmIkEK/cIWl\r\n"
   1.170 +        "RanlZdQG6UPHkoUomh7hauUUgcYe4FWt4NBKdiba36Y=\r\n"
   1.171 +        "=1lFj\r\n"
   1.172 +        "-----END PGP MESSAGE-----\r\n"
   1.173 +        "\r\n";
   1.174 +
   1.175  	PEP_SESSION session;
   1.176  	PEP_STATUS status1 = init(&session);
   1.177  	assert(status1 == PEP_STATUS_OK);
   1.178  	assert(session);
   1.179  
   1.180 +	// import secret key
   1.181 +	identity_list* pk = NULL; 
   1.182 +	status1 = import_key( session, private_key.c_str(), private_key.size(), &pk );
   1.183 +	assert(status1 == PEP_STATUS_OK);
   1.184 +	std::cout << "Imported " << identity_list_length(pk) << " private key(s)." << endl;
   1.185 +	
   1.186  	char* plaintext = nullptr;
   1.187  	stringlist_t* keys_used = nullptr;
   1.188  	PEP_rating rating;
   1.189 @@ -89,6 +151,15 @@
   1.190  	assert(plaintext);
   1.191  	
   1.192  	pEp_free(plaintext);
   1.193 +	
   1.194 +	identity_list* il = pk;
   1.195 +	while(il)
   1.196 +	{
   1.197 +		std::cout << "Delete test key \"" << il->ident->fpr << "\"" << endl;
   1.198 +		delete_keypair( session, il->ident->fpr );
   1.199 +		il = il->next;
   1.200 +	}
   1.201 +	free_identity_list(pk);
   1.202  }
   1.203  
   1.204