00001 00006 /* 00007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 00008 * SPDX-License-Identifier: Apache-2.0 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00011 * not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00018 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 * 00022 * This file is part of mbed TLS (https://tls.mbed.org) 00023 */ 00024 #ifndef MBEDTLS_X509_CRL_H 00025 #define MBEDTLS_X509_CRL_H 00026 00027 #if !defined(MBEDTLS_CONFIG_FILE) 00028 #include "config.h" 00029 #else 00030 #include MBEDTLS_CONFIG_FILE 00031 #endif 00032 00033 #include "x509.h" 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00052 typedef struct mbedtls_x509_crl_entry 00053 { 00054 mbedtls_x509_buf raw; 00055 00056 mbedtls_x509_buf serial; 00057 00058 mbedtls_x509_time revocation_date; 00059 00060 mbedtls_x509_buf entry_ext; 00061 00062 struct mbedtls_x509_crl_entry *next; 00063 } 00064 mbedtls_x509_crl_entry; 00065 00070 typedef struct mbedtls_x509_crl 00071 { 00072 mbedtls_x509_buf raw; 00073 mbedtls_x509_buf tbs; 00075 int version; 00076 mbedtls_x509_buf sig_oid; 00078 mbedtls_x509_buf issuer_raw; 00080 mbedtls_x509_name issuer; 00082 mbedtls_x509_time this_update; 00083 mbedtls_x509_time next_update; 00084 00085 mbedtls_x509_crl_entry entry; 00087 mbedtls_x509_buf crl_ext; 00088 00089 mbedtls_x509_buf sig_oid2; 00090 mbedtls_x509_buf sig; 00091 mbedtls_md_type_t sig_md; 00092 mbedtls_pk_type_t sig_pk; 00093 void *sig_opts; 00095 struct mbedtls_x509_crl *next; 00096 } 00097 mbedtls_x509_crl; 00098 00109 int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, 00110 const unsigned char *buf, size_t buflen ); 00123 int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen ); 00124 00125 #if defined(MBEDTLS_FS_IO) 00126 00136 int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path ); 00137 #endif /* MBEDTLS_FS_IO */ 00138 00150 int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix, 00151 const mbedtls_x509_crl *crl ); 00152 00158 void mbedtls_x509_crl_init( mbedtls_x509_crl *crl ); 00159 00165 void mbedtls_x509_crl_free( mbedtls_x509_crl *crl ); 00166 00167 /* \} name */ 00168 /* \} addtogroup x509_module */ 00169 00170 #ifdef __cplusplus 00171 } 00172 #endif 00173 00174 #endif /* mbedtls_x509_crl.h */