2010-06-09 18:53:51 +02:00
|
|
|
/* validate.h - Certificate validation
|
|
|
|
* Copyright (C) 2004 g10 Code GmbH
|
|
|
|
*
|
|
|
|
* This file is part of DirMngr.
|
|
|
|
*
|
|
|
|
* DirMngr is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* DirMngr is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VALIDATE_H
|
|
|
|
#define VALIDATE_H
|
|
|
|
|
|
|
|
|
2017-02-21 14:55:04 +01:00
|
|
|
/* Flag values matching the CERTTRUST_CLASS values and a MASK for
|
|
|
|
* them. check_header_constants() checks their consistency. */
|
|
|
|
#define VALIDATE_FLAG_TRUST_SYSTEM 1
|
|
|
|
#define VALIDATE_FLAG_TRUST_CONFIG 2
|
|
|
|
#define VALIDATE_FLAG_TRUST_HKP 4
|
|
|
|
#define VALIDATE_FLAG_TRUST_HKPSPOOL 8
|
|
|
|
#define VALIDATE_FLAG_MASK_TRUST 0x0f
|
2017-02-17 14:19:15 +01:00
|
|
|
|
2017-02-17 21:31:33 +01:00
|
|
|
/* Standard CRL issuer certificate validation; i.e. CRLs are not
|
|
|
|
* considered for CRL issuer certificates. */
|
2017-02-21 14:55:04 +01:00
|
|
|
#define VALIDATE_FLAG_CRL 64
|
2017-02-17 14:19:15 +01:00
|
|
|
|
2017-02-17 21:31:33 +01:00
|
|
|
/* If this flag is set along with VALIDATE_FLAG_CRL a full CRL
|
|
|
|
* verification is done. */
|
2017-02-21 14:55:04 +01:00
|
|
|
#define VALIDATE_FLAG_RECURSIVE 128
|
2017-02-17 14:19:15 +01:00
|
|
|
|
2017-02-17 21:31:33 +01:00
|
|
|
/* Validation mode as used for OCSP. */
|
2017-02-21 14:55:04 +01:00
|
|
|
#define VALIDATE_FLAG_OCSP 256
|
2017-02-17 14:19:15 +01:00
|
|
|
|
2017-02-17 21:31:33 +01:00
|
|
|
/* Validation mode as used with TLS. */
|
2017-02-21 14:55:04 +01:00
|
|
|
#define VALIDATE_FLAG_TLS 512
|
2017-02-17 14:19:15 +01:00
|
|
|
|
2017-02-17 21:31:33 +01:00
|
|
|
/* Don't do CRL checks. */
|
2017-02-21 14:55:04 +01:00
|
|
|
#define VALIDATE_FLAG_NOCRLCHECK 1024
|
2010-06-09 18:53:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Validate the certificate CHAIN up to the trust anchor. Optionally
|
|
|
|
return the closest expiration time in R_EXPTIME. */
|
|
|
|
gpg_error_t validate_cert_chain (ctrl_t ctrl,
|
|
|
|
ksba_cert_t cert, ksba_isotime_t r_exptime,
|
2017-02-17 21:31:33 +01:00
|
|
|
unsigned int flags, char **r_trust_anchor);
|
2010-06-09 18:53:51 +02:00
|
|
|
|
|
|
|
/* Return 0 if the certificate CERT is usable for certification. */
|
2017-02-17 14:19:15 +01:00
|
|
|
gpg_error_t check_cert_use_cert (ksba_cert_t cert);
|
2010-06-09 18:53:51 +02:00
|
|
|
|
|
|
|
/* Return 0 if the certificate CERT is usable for signing OCSP
|
|
|
|
responses. */
|
2017-02-17 14:19:15 +01:00
|
|
|
gpg_error_t check_cert_use_ocsp (ksba_cert_t cert);
|
2010-06-09 18:53:51 +02:00
|
|
|
|
|
|
|
/* Return 0 if the certificate CERT is usable for signing CRLs. */
|
2017-02-17 14:19:15 +01:00
|
|
|
gpg_error_t check_cert_use_crl (ksba_cert_t cert);
|
2010-06-09 18:53:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif /*VALIDATE_H*/
|