00001 00006 /* 00007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 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 * This file is part of mbed TLS (https://tls.mbed.org) 00050 */ 00051 #ifndef MBEDTLS_X509_CRL_H 00052 #define MBEDTLS_X509_CRL_H 00053 00054 #if !defined(MBEDTLS_CONFIG_FILE) 00055 #include "config.h" 00056 #else 00057 #include MBEDTLS_CONFIG_FILE 00058 #endif 00059 00060 #include "x509.h" 00061 00062 #ifdef __cplusplus 00063 extern "C" { 00064 #endif 00065 00079 typedef struct mbedtls_x509_crl_entry 00080 { 00081 mbedtls_x509_buf raw; 00082 00083 mbedtls_x509_buf serial; 00084 00085 mbedtls_x509_time revocation_date; 00086 00087 mbedtls_x509_buf entry_ext; 00088 00089 struct mbedtls_x509_crl_entry *next; 00090 } 00091 mbedtls_x509_crl_entry; 00092 00097 typedef struct mbedtls_x509_crl 00098 { 00099 mbedtls_x509_buf raw; 00100 mbedtls_x509_buf tbs; 00102 int version; 00103 mbedtls_x509_buf sig_oid; 00105 mbedtls_x509_buf issuer_raw; 00107 mbedtls_x509_name issuer; 00109 mbedtls_x509_time this_update; 00110 mbedtls_x509_time next_update; 00111 00112 mbedtls_x509_crl_entry entry; 00114 mbedtls_x509_buf crl_ext; 00115 00116 mbedtls_x509_buf sig_oid2; 00117 mbedtls_x509_buf sig; 00118 mbedtls_md_type_t sig_md; 00119 mbedtls_pk_type_t sig_pk; 00120 void *sig_opts; 00122 struct mbedtls_x509_crl *next; 00123 } 00124 mbedtls_x509_crl; 00125 00136 int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, 00137 const unsigned char *buf, size_t buflen ); 00150 int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen ); 00151 00152 #if defined(MBEDTLS_FS_IO) 00153 00163 int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path ); 00164 #endif /* MBEDTLS_FS_IO */ 00165 00177 int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix, 00178 const mbedtls_x509_crl *crl ); 00179 00185 void mbedtls_x509_crl_init( mbedtls_x509_crl *crl ); 00186 00192 void mbedtls_x509_crl_free( mbedtls_x509_crl *crl ); 00193 00194 /* \} name */ 00195 /* \} addtogroup x509_module */ 00196 00197 #ifdef __cplusplus 00198 } 00199 #endif 00200 00201 #endif /* mbedtls_x509_crl.h */