change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
cpp/MiniTLS.h@1:27b41ba7e847, 2014-06-09 (annotated)
- Committer:
- MiniTLS
- Date:
- Mon Jun 09 14:57:32 2014 +0000
- Revision:
- 1:27b41ba7e847
Renamed to MiniTLS and added doc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 1:27b41ba7e847 | 1 | /* |
MiniTLS | 1:27b41ba7e847 | 2 | MiniTLS - A super trimmed down TLS/SSL Library for embedded devices |
MiniTLS | 1:27b41ba7e847 | 3 | Author: Donatien Garnier |
MiniTLS | 1:27b41ba7e847 | 4 | Copyright (C) 2013-2014 AppNearMe Ltd |
MiniTLS | 1:27b41ba7e847 | 5 | |
MiniTLS | 1:27b41ba7e847 | 6 | This program is free software; you can redistribute it and/or |
MiniTLS | 1:27b41ba7e847 | 7 | modify it under the terms of the GNU General Public License |
MiniTLS | 1:27b41ba7e847 | 8 | as published by the Free Software Foundation; either version 2 |
MiniTLS | 1:27b41ba7e847 | 9 | of the License, or (at your option) any later version. |
MiniTLS | 1:27b41ba7e847 | 10 | |
MiniTLS | 1:27b41ba7e847 | 11 | This program is distributed in the hope that it will be useful, |
MiniTLS | 1:27b41ba7e847 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
MiniTLS | 1:27b41ba7e847 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MiniTLS | 1:27b41ba7e847 | 14 | GNU General Public License for more details. |
MiniTLS | 1:27b41ba7e847 | 15 | |
MiniTLS | 1:27b41ba7e847 | 16 | You should have received a copy of the GNU General Public License |
MiniTLS | 1:27b41ba7e847 | 17 | along with this program; if not, write to the Free Software |
MiniTLS | 1:27b41ba7e847 | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
MiniTLS | 1:27b41ba7e847 | 19 | *//** |
MiniTLS | 1:27b41ba7e847 | 20 | * \file MiniTLS.h |
MiniTLS | 1:27b41ba7e847 | 21 | * \copyright Copyright (c) AppNearMe Ltd 2013 |
MiniTLS | 1:27b41ba7e847 | 22 | * \author Donatien Garnier |
MiniTLS | 1:27b41ba7e847 | 23 | */ |
MiniTLS | 1:27b41ba7e847 | 24 | |
MiniTLS | 1:27b41ba7e847 | 25 | #ifndef MINITLS_CPP_H_ |
MiniTLS | 1:27b41ba7e847 | 26 | #define MINITLS_CPP_H_ |
MiniTLS | 1:27b41ba7e847 | 27 | |
MiniTLS | 1:27b41ba7e847 | 28 | class TLSSocket; |
MiniTLS | 1:27b41ba7e847 | 29 | |
MiniTLS | 1:27b41ba7e847 | 30 | #include "core/fwk.h" |
MiniTLS | 1:27b41ba7e847 | 31 | #include "tls/minitls.h" |
MiniTLS | 1:27b41ba7e847 | 32 | #include "crypto/crypto_prng.h" |
MiniTLS | 1:27b41ba7e847 | 33 | |
MiniTLS | 1:27b41ba7e847 | 34 | #include "inc/minitls_errors.h" |
MiniTLS | 1:27b41ba7e847 | 35 | |
MiniTLS | 1:27b41ba7e847 | 36 | /** MiniTLS library |
MiniTLS | 1:27b41ba7e847 | 37 | * |
MiniTLS | 1:27b41ba7e847 | 38 | */ |
MiniTLS | 1:27b41ba7e847 | 39 | class MiniTLS |
MiniTLS | 1:27b41ba7e847 | 40 | { |
MiniTLS | 1:27b41ba7e847 | 41 | public: |
MiniTLS | 1:27b41ba7e847 | 42 | MiniTLS(); |
MiniTLS | 1:27b41ba7e847 | 43 | ~MiniTLS(); |
MiniTLS | 1:27b41ba7e847 | 44 | |
MiniTLS | 1:27b41ba7e847 | 45 | void init(); |
MiniTLS | 1:27b41ba7e847 | 46 | |
MiniTLS | 1:27b41ba7e847 | 47 | void feedPRNG(uint8_t* buffer, size_t length); |
MiniTLS | 1:27b41ba7e847 | 48 | |
MiniTLS | 1:27b41ba7e847 | 49 | minitls_err_t addCertificate(const uint8_t* cert, size_t certSize, const uint8_t* pubKey, size_t pubKeySize); |
MiniTLS | 1:27b41ba7e847 | 50 | |
MiniTLS | 1:27b41ba7e847 | 51 | private: |
MiniTLS | 1:27b41ba7e847 | 52 | crypto_prng_t m_prng; |
MiniTLS | 1:27b41ba7e847 | 53 | minitls_t m_minitls; |
MiniTLS | 1:27b41ba7e847 | 54 | tls_x509_certificate_t m_cert; |
MiniTLS | 1:27b41ba7e847 | 55 | |
MiniTLS | 1:27b41ba7e847 | 56 | friend class TLSSocket; |
MiniTLS | 1:27b41ba7e847 | 57 | }; |
MiniTLS | 1:27b41ba7e847 | 58 | |
MiniTLS | 1:27b41ba7e847 | 59 | |
MiniTLS | 1:27b41ba7e847 | 60 | #endif /* MINITLS_CPP_H_ */ |