### ----------------------------------------------------
### -- GPGME
### -- Licenses: Artistic-2.0
### -- Authors: Curt Tilmes <curt@tilmes.org>
### -- File: lib/GPGME/Constants.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
_ERR_SYSTEM_ERROR +| 139,
    GPG_ERR_EXFULL => GPG_ERR_SYSTEM_ERROR +| 140,
);

constant \GPG_ERR_CODE_MASK = 65535;

enum GPGME::Locale (
    LC_CTYPE    => 0,
    LC_MESSAGES => 5,
    LC_ALL      => 6,
);

enum GPGME::Protocol (                            # gpgme_protocol_t
    GPGME_PROTOCOL_OPENPGP  => 0,
    GPGME_PROTOCOL_CMS      => 1,
    GPGME_PROTOCOL_GPGCONF  => 2,
    GPGME_PROTOCOL_ASSUAN   => 3,
    GPGME_PROTOCOL_G13      => 4,
    GPGME_PROTOCOL_UISERVER => 5,
    GPGME_PROTOCOL_SPAWN    => 6,
    GPGME_PROTOCOL_DEFAULT  => 254,
    GPGME_PROTOCOL_UNKNOWN  => 255
);

enum GPGME::PinentryMode (                        # gpgme_pinentry_mode_t
    GPGME_PINENTRY_MODE_DEFAULT  => 0,
    GPGME_PINENTRY_MODE_ASK      => 1,
    GPGME_PINENTRY_MODE_CANCEL   => 2,
    GPGME_PINENTRY_MODE_ERROR    => 3,
    GPGME_PINENTRY_MODE_LOOPBACK => 4
);

enum GPGME::KeylistMode (                         # gpgme_keylist_mode_t
    GPGME_KEYLIST_MODE_LOCAL         => 1,
    GPGME_KEYLIST_MODE_EXTERN        => 2,
    GPGME_KEYLIST_MODE_SIGS          => 4,
    GPGME_KEYLIST_MODE_SIG_NOTATIONS => 8,
    GPGME_KEYLIST_MODE_WITH_SECRET   => 16,
    GPGME_KEYLIST_MODE_WITH_TOFU     => 32,
    GPGME_KEYLIST_MODE_EPHEMERAL     => 128,
    GPGME_KEYLIST_MODE_VALIDATE      => 256
);

enum GPGME::Validity (                            # gpgme_validity_t
    GPGME_VALIDITY_UNKNOWN   => 0,
    GPGME_VALIDITY_UNDEFINED => 1,
    GPGME_VALIDITY_NEVER     => 2,
    GPGME_VALIDITY_MARGINAL  => 3,
    GPGME_VALIDITY_FULL      => 4,
    GPGME_VALIDITY_ULTIMATE  => 5
);

enum GPGME::PubKeyAlgorithm (                     # gpgme_pubkey_algo_t
    GPGME_PK_RSA   => 1,
    GPGME_PK_RSA_E => 2,
    GPGME_PK_RSA_S => 3,
    GPGME_PK_ELG_E => 16,
    GPGME_PK_DSA   => 17,
    GPGME_PK_ECC   => 18,
    GPGME_PK_ELG   => 20,
    GPGME_PK_ECDSA => 301,
    GPGME_PK_ECDH  => 302,
    GPGME_PK_EDDSA => 303
);

enum GPGME::CreateFlags (
    GPGME_CREATE_SIGN       => 1 +< 0,
    GPGME_CREATE_ENCR       => 1 +< 1,
    GPGME_CREATE_CERT       => 1 +< 2,
    GPGME_CREATE_AUTH       => 1 +< 3,
    GPGME_CREATE_NOPASSWD   => 1 +< 7,
    GPGME_CREATE_SELFSIGNED => 1 +< 8,
    GPGME_CREATE_NOSTORE    => 1 +< 9,
    GPGME_CREATE_WANTPUB    => 1 +< 10,
    GPGME_CREATE_WANTSEC    => 1 +< 11,
    GPGME_CREATE_FORCE      => 1 +< 12,
    GPGME_CREATE_NOEXPIRE   => 1 +< 13,
);

enum GPGME::KeySignFlags (
    GPGME_KEYSIGN_LOCAL    => 1 +< 7,
    GPGME_KEYSIGN_LFSEP    => 1 +< 8,
    GPGME_KEYSIGN_NOEXPIRE => 1 +< 9,
);

enum GPGME::DataType (                            # gpgme_data_type_t
    GPGME_DATA_TYPE_INVALID       => 0,
    GPGME_DATA_TYPE_UNKNOWN       => 1,
    GPGME_DATA_TYPE_PGP_SIGNED    => 0x10,
    GPGME_DATA_TYPE_PGP_ENCRYPTED => 0x11,
    GPGME_DATA_TYPE_PGP_OTHER     => 0x12,
    GPGME_DATA_TYPE_PGP_KEY       => 0x13,
    GPGME_DATA_TYPE_PGP_SIGNATURE => 0x18,
    GPGME_DATA_TYPE_CMS_SIGNED    => 0x20,
    GPGME_DATA_TYPE_CMS_ENCRYPTED => 0x21,
    GPGME_DATA_TYPE_CMS_OTHER     => 0x22,
    GPGME_DATA_TYPE_X509_CERT     => 0x23,
    GPGME_DATA_TYPE_PKCS12        => 0x24,
);

enum GPGME::DataEncoding (                        # gpgme_data_encoding_t
    GPGME_DATA_ENCODING_NONE   => 0,
    GPGME_DATA_ENCODING_BINARY => 1,
    GPGME_DATA_ENCODING_BASE64 => 2,
    GPGME_DATA_ENCODING_ARMOR  => 3,
    GPGME_DATA_ENCODING_URL    => 4,
    GPGME_DATA_ENCODING_URLESC => 5,
    GPGME_DATA_ENCODING_URL0   => 6,
    GPGME_DATA_ENCODING_MIME   => 7,
);

enum GPGME::ExportMode (                          # gpgme_export_mode_t
    GPGME_EXPORT_MODE_EXTERN  => 2,
    GPGME_EXPORT_MODE_MINIMAL => 4,
    GPGME_EXPORT_MODE_SECRET  => 16,
    GPGME_EXPORT_MODE_RAW     => 32,
    GPGME_EXPORT_MODE_PKCS12  => 64,
);

enum GPGME::SigMode (                             # gpgme_sig_mode_t
    GPGME_SIG_MODE_NORMAL => 0,
    GPGME_SIG_MODE_DETACH => 1,
    GPGME_SIG_MODE_CLEAR  => 2,
);

enum GPGME::HashAlgorithm (                       # gpgme_hash_algo_t
    GPGME_MD_NONE          => 0,
    GPGME_MD_MD5           => 1,
    GPGME_MD_SHA1          => 2,
    GPGME_MD_RMD160        => 3,
    GPGME_MD_MD2           => 5,
    GPGME_MD_TIGER         => 6,
    GPGME_MD_HAVAL         => 7,
    GPGME_MD_SHA256        => 8,
    GPGME_MD_SHA384        => 9,
    GPGME_MD_SHA512        => 10,
    GPGME_MD_SHA224        => 11,
    GPGME_MD_MD4           => 301,
    GPGME_MD_CRC32         => 302,
    GPGME_MD_CRC32_RFC1510 => 303,
    GPGME_MD_CRC24_RFC2440 => 304
);

enum GPGME::EncryptFlags (                        # gpgme_encrypt_flags_t
    GPGME_ENCRYPT_ALWAYS_TRUST  => 1,
    GPGME_ENCRYPT_NO_ENCRYPT_TO => 2,
    GPGME_ENCRYPT_PREPARE       => 4,
    GPGME_ENCRYPT_EXPECT_SIGN   => 8,
    GPGME_ENCRYPT_NO_COMPRESS   => 16,
    GPGME_ENCRYPT_SYMMETRIC     => 32,
    GPGME_ENCRYPT_THROW_KEYIDS  => 64,
    GPGME_ENCRYPT_WRAP          => 128
);

enum GPGME::DecryptFlags (                        # gpgme_decrypt_flags_t
    GPGME_DECRYPT_VERIFY => 1,
    GPGME_DECRYPT_UNWRAP => 128,
);

enum GPGME::AuditLogFlags (
    GPGME_AUDITLOG_DEFAULT   => 0,
    GPGME_AUDITLOG_HTML      => 1,
    GPGME_AUDITLOG_WITH_HELP => 128,
);

enum GPGME::SigNotationFlags (                    # gpgme_sig_notation_flags_t
    GPGME_SIG_NOTATION_HUMAN_READABLE => 1,
    GPGME_SIG_NOTATION_CRITICAL       => 2,
);

enum GPGME::SigSum (                              # gpgme_sigsum_t
    GPGME_SIGSUM_VALID         => 0x0001,
    GPGME_SIGSUM_GREEN         => 0x0002,
    GPGME_SIGSUM_RED           => 0x0004,
    GPGME_SIGSUM_KEY_REVOKED   => 0x0010,
    GPGME_SIGSUM_KEY_EXPIRED   => 0x0020,
    GPGME_SIGSUM_SIG_EXPIRED   => 0x0040,
    GPGME_SIGSUM_KEY_MISSING   => 0x0080,
    GPGME_SIGSUM_CRL_MISSING   => 0x0100,
    GPGME_SIGSUM_CRL_TOO_OLD   => 0x0200,
    GPGME_SIGSUM_BAD_POLICY    => 0x0400,
    GPGME_SIGSUM_SYS_ERROR     => 0x0800,
    GPGME_SIGSUM_TOFU_CONFLICT => 0x1000,
);

enum GPGME::ImportFlags (
    GPGME_IMPORT_NEW    => 1,
    GPGME_IMPORT_UID    => 2,
    GPGME_IMPORT_SIG    => 4,
    GPGME_IMPORT_SUBKEY => 8,
    GPGME_IMPORT_SECRET => 16,
);

enum GPGME::DeleteFlags (
    GPGME_DELETE_ALLOW_SECRET => 1 +< 0,
    GPGME_DELETE_FORCE        => 1 +< 1,
);

enum GPGME::TOFUValidity (
    GPGME_TOFU_VALIDITY_CONFLICT         => 0,
    GPGME_TOFU_VALIDITY_NOHISTORY        => 1,
    GPGME_TOFU_VALIDITY_TOOLITTLEHISTORY => 2,
    GPGME_TOFU_VALIDITY_ENOUGHHISTORY    => 3,
    GPGME_TOFU_VALIDITY_LOTOFHISTORY     => 4
);

enum GPGME::TOFUPolicy (                           # gpgme_tofu_policy_t
    GPGME_TOFU_POLICY_NONE    => 0,
    GPGME_TOFU_POLICY_AUTO    => 1,
    GPGME_TOFU_POLICY_GOOD    => 2,
    GPGME_TOFU_POLICY_UNKNOWN => 3,
    GPGME_TOFU_POLICY_BAD     => 4,
    GPGME_TOFU_POLICY_ASK     => 5
);


