1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
22 #include "ssl_types.h"
23 #include "ssl_stack.h"
25 DEFINE_STACK_OF(X509_NAME)
28 * @brief create a X509 certification object according to input X509 certification
30 * @param ix - input X509 certification point
32 * @return new X509 certification object point
34 X509* __X509_new(X509 *ix);
37 * @brief create a X509 certification object
41 * @return X509 certification object point
46 * @brief load a character certification context into system context. If '*cert' is pointed to the
47 * certification, then load certification into it. Or create a new X509 certification object
49 * @param cert - a point pointed to X509 certification
50 * @param buffer - a point pointed to the certification context memory point
51 * @param length - certification bytes
53 * @return X509 certification object point
55 X509* d2i_X509(X509 **cert, const unsigned char *buffer, long len);
58 * @brief free a X509 certification object
60 * @param x - X509 certification object point
64 void X509_free(X509 *x);
67 * @brief set SSL context client CA certification
69 * @param ctx - SSL context point
70 * @param x - X509 certification point
76 int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);
79 * @brief add CA client certification into the SSL
81 * @param ssl - SSL point
82 * @param x - X509 certification point
88 int SSL_add_client_CA(SSL *ssl, X509 *x);
91 * @brief load certification into the SSL
93 * @param ssl - SSL point
94 * @param len - data bytes
95 * @param d - data point
102 int SSL_use_certificate_ASN1(SSL *ssl, int len, const unsigned char *d);
104 const char *X509_verify_cert_error_string(long n);