1 /* validate.h - Certificate validation 2 * Copyright (C) 2004 g10 Code GmbH 3 * 4 * This file is part of DirMngr. 5 * 6 * DirMngr is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * DirMngr is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 */ 20 21 #ifndef VALIDATE_H 22 #define VALIDATE_H 23 24 25 enum { 26 /* Simple certificate validation mode. */ 27 VALIDATE_MODE_CERT = 0, 28 /* Standard CRL issuer certificate validation; i.e. CRLs are not 29 considered for CRL issuer certificates. */ 30 VALIDATE_MODE_CRL = 1, 31 /* Full CRL validation. */ 32 VALIDATE_MODE_CRL_RECURSIVE = 2, 33 /* Validation as used for OCSP. */ 34 VALIDATE_MODE_OCSP = 3 35 }; 36 37 38 /* Validate the certificate CHAIN up to the trust anchor. Optionally 39 return the closest expiration time in R_EXPTIME. */ 40 gpg_error_t validate_cert_chain (ctrl_t ctrl, 41 ksba_cert_t cert, ksba_isotime_t r_exptime, 42 int mode, char **r_trust_anchor); 43 44 /* Return 0 if the certificate CERT is usable for certification. */ 45 gpg_error_t cert_use_cert_p (ksba_cert_t cert); 46 47 /* Return 0 if the certificate CERT is usable for signing OCSP 48 responses. */ 49 gpg_error_t cert_use_ocsp_p (ksba_cert_t cert); 50 51 /* Return 0 if the certificate CERT is usable for signing CRLs. */ 52 gpg_error_t cert_use_crl_p (ksba_cert_t cert); 53 54 55 #endif /*VALIDATE_H*/ 56