00001 00006 /* 00007 * Copyright The Mbed TLS Contributors 00008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 00009 * 00010 * This file is provided under the Apache License 2.0, or the 00011 * GNU General Public License v2.0 or later. 00012 * 00013 * ********** 00014 * Apache License 2.0: 00015 * 00016 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00017 * not use this file except in compliance with the License. 00018 * You may obtain a copy of the License at 00019 * 00020 * http://www.apache.org/licenses/LICENSE-2.0 00021 * 00022 * Unless required by applicable law or agreed to in writing, software 00023 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00024 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00025 * See the License for the specific language governing permissions and 00026 * limitations under the License. 00027 * 00028 * ********** 00029 * 00030 * ********** 00031 * GNU General Public License v2.0 or later: 00032 * 00033 * This program is free software; you can redistribute it and/or modify 00034 * it under the terms of the GNU General Public License as published by 00035 * the Free Software Foundation; either version 2 of the License, or 00036 * (at your option) any later version. 00037 * 00038 * This program is distributed in the hope that it will be useful, 00039 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00040 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00041 * GNU General Public License for more details. 00042 * 00043 * You should have received a copy of the GNU General Public License along 00044 * with this program; if not, write to the Free Software Foundation, Inc., 00045 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00046 * 00047 * ********** 00048 */ 00049 #ifndef MBEDTLS_X509_CRL_H 00050 #define MBEDTLS_X509_CRL_H 00051 00052 #if !defined(MBEDTLS_CONFIG_FILE) 00053 #include "config.h" 00054 #else 00055 #include MBEDTLS_CONFIG_FILE 00056 #endif 00057 00058 #include "x509.h" 00059 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 00077 typedef struct mbedtls_x509_crl_entry 00078 { 00079 mbedtls_x509_buf raw; 00080 00081 mbedtls_x509_buf serial; 00082 00083 mbedtls_x509_time revocation_date; 00084 00085 mbedtls_x509_buf entry_ext; 00086 00087 struct mbedtls_x509_crl_entry *next; 00088 } 00089 mbedtls_x509_crl_entry; 00090 00095 typedef struct mbedtls_x509_crl 00096 { 00097 mbedtls_x509_buf raw; 00098 mbedtls_x509_buf tbs; 00100 int version; 00101 mbedtls_x509_buf sig_oid; 00103 mbedtls_x509_buf issuer_raw; 00105 mbedtls_x509_name issuer; 00107 mbedtls_x509_time this_update; 00108 mbedtls_x509_time next_update; 00109 00110 mbedtls_x509_crl_entry entry; 00112 mbedtls_x509_buf crl_ext; 00113 00114 mbedtls_x509_buf sig_oid2; 00115 mbedtls_x509_buf sig; 00116 mbedtls_md_type_t sig_md; 00117 mbedtls_pk_type_t sig_pk; 00118 void *sig_opts; 00120 struct mbedtls_x509_crl *next; 00121 } 00122 mbedtls_x509_crl; 00123 00134 int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, 00135 const unsigned char *buf, size_t buflen ); 00148 int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen ); 00149 00150 #if defined(MBEDTLS_FS_IO) 00151 00161 int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path ); 00162 #endif /* MBEDTLS_FS_IO */ 00163 00175 int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix, 00176 const mbedtls_x509_crl *crl ); 00177 00183 void mbedtls_x509_crl_init( mbedtls_x509_crl *crl ); 00184 00190 void mbedtls_x509_crl_free( mbedtls_x509_crl *crl ); 00191 00192 /* \} name */ 00193 /* \} addtogroup x509_module */ 00194 00195 #ifdef __cplusplus 00196 } 00197 #endif 00198 00199 #endif /* mbedtls_x509_crl.h */