1 /* GNU Mailutils -- a suite of utilities for electronic mail 2 Copyright (C) 2009-2021 Free Software Foundation, Inc. 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 3 of the License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General 15 Public License along with this library. If not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 #ifndef _MUCPP_SECRET_H 19 #define _MUCPP_SECRET_H 20 21 #include <string> 22 #include <errno.h> 23 #include <mailutils/secret.h> 24 #include <mailutils/cpp/error.h> 25 26 namespace mailutils 27 { 28 29 class Secret 30 { 31 protected: 32 mu_secret_t secret; 33 bool owner; 34 35 public: 36 Secret (const std::string&); 37 Secret (const char* str, size_t len); 38 Secret (const mu_secret_t); 39 ~Secret (); 40 41 std::string password (); 42 void password_unref (); 43 }; 44 45 } 46 47 #endif // not _MUCPP_SECRET_H 48 49