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