1 /* compliance.h - Definitions for compliance modi
2 * Copyright (C) 2017 g10 Code GmbH
3 * Copyright (C) 2017 Bundesamt für Sicherheit in der Informationstechnik
5 * This file is part of GnuPG.
7 * This file is free software; you can redistribute it and/or modify
8 * it under the terms of either
10 * - the GNU Lesser General Public License as published by the Free
11 * Software Foundation; either version 3 of the License, or (at
12 * your option) any later version.
16 * - the GNU General Public License as published by the Free
17 * Software Foundation; either version 2 of the License, or (at
18 * your option) any later version.
20 * or both in parallel, as here.
22 * This file is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, see <https://www.gnu.org/licenses/>.
31 #ifndef GNUPG_COMMON_COMPLIANCE_H
32 #define GNUPG_COMMON_COMPLIANCE_H
35 #include "openpgpdefs.h"
37 void gnupg_initialize_compliance (int gnupg_module_name);
39 enum gnupg_compliance_mode
41 CO_GNUPG, CO_RFC4880, CO_RFC2440,
42 CO_PGP6, CO_PGP7, CO_PGP8, CO_DE_VS
47 PK_USE_ENCRYPTION, PK_USE_DECRYPTION,
48 PK_USE_SIGNING, PK_USE_VERIFICATION,
51 int gnupg_pk_is_compliant (enum gnupg_compliance_mode compliance, int algo,
52 gcry_mpi_t key[], unsigned int keylength,
53 const char *curvename);
54 int gnupg_pk_is_allowed (enum gnupg_compliance_mode compliance,
55 enum pk_use_case use, int algo, gcry_mpi_t key[],
56 unsigned int keylength, const char *curvename);
57 int gnupg_cipher_is_compliant (enum gnupg_compliance_mode compliance,
59 enum gcry_cipher_modes mode);
60 int gnupg_cipher_is_allowed (enum gnupg_compliance_mode compliance,
63 enum gcry_cipher_modes mode);
64 int gnupg_digest_is_compliant (enum gnupg_compliance_mode compliance,
65 digest_algo_t digest);
66 int gnupg_digest_is_allowed (enum gnupg_compliance_mode compliance,
68 digest_algo_t digest);
69 int gnupg_rng_is_compliant (enum gnupg_compliance_mode compliance);
71 const char *gnupg_status_compliance_flag (enum gnupg_compliance_mode
74 struct gnupg_compliance_option
80 int gnupg_parse_compliance_option (const char *string,
81 struct gnupg_compliance_option options[],
84 const char *gnupg_compliance_option_string (enum gnupg_compliance_mode
88 #endif /*GNUPG_COMMON_COMPLIANCE_H*/