Panda3D
openSSLWrapper.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file openSSLWrapper.I
10  * @author drose
11  * @date 2009-09-05
12  */
13 
14 /**
15  * Reads a chain of trusted certificates from the indicated data buffer and
16  * adds them to the X509_STORE object. The data buffer should be PEM-
17  * formatted. Returns the number of certificates read on success, or 0 on
18  * failure.
19  *
20  * You should call this only with trusted, locally-stored certificates; not
21  * with certificates received from an untrusted source.
22  */
23 INLINE int OpenSSLWrapper::
24 load_certificates_from_pem_ram(const std::string &data) {
25  return load_certificates_from_pem_ram(data.data(), data.size());
26 }
27 
28 /**
29  * Reads a chain of trusted certificates from the indicated data buffer and
30  * adds them to the X509_STORE object. The data buffer should be DER-
31  * formatted. Returns the number of certificates read on success, or 0 on
32  * failure.
33  *
34  * You should call this only with trusted, locally-stored certificates; not
35  * with certificates received from an untrusted source.
36  */
37 INLINE int OpenSSLWrapper::
38 load_certificates_from_der_ram(const std::string &data) {
39  return load_certificates_from_der_ram(data.data(), data.size());
40 }