cpp: Add keylist mode WithSecret
* lang/cpp/src/global.h (WithSecret): New. * lang/cpp/src/context.cpp (operator<<): Handle WithSecret. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t, convert_from_gpgme_keylist_mode_t): Ditto. -- GnuPG-bug-id: 4794
This commit is contained in:
parent
b714a6bbc8
commit
188cc9e9b5
@ -1695,6 +1695,7 @@ std::ostream &operator<<(std::ostream &os, KeyListMode mode)
|
|||||||
CHECK(Ephemeral);
|
CHECK(Ephemeral);
|
||||||
CHECK(WithTofu);
|
CHECK(WithTofu);
|
||||||
CHECK(WithKeygrip);
|
CHECK(WithKeygrip);
|
||||||
|
CHECK(WithSecret);
|
||||||
#undef CHECK
|
#undef CHECK
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,8 @@ enum KeyListMode {
|
|||||||
Validate = 0x10,
|
Validate = 0x10,
|
||||||
Ephemeral = 0x20,
|
Ephemeral = 0x20,
|
||||||
WithTofu = 0x40,
|
WithTofu = 0x40,
|
||||||
WithKeygrip = 0x80
|
WithKeygrip = 0x80,
|
||||||
|
WithSecret = 0x100
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SignatureMode { NormalSignatureMode, Detached, Clearsigned };
|
enum SignatureMode { NormalSignatureMode, Detached, Clearsigned };
|
||||||
|
@ -84,6 +84,9 @@ static inline gpgme_keylist_mode_t add_to_gpgme_keylist_mode_t(unsigned int oldm
|
|||||||
if (newmodes & GpgME::WithKeygrip) {
|
if (newmodes & GpgME::WithKeygrip) {
|
||||||
oldmode |= GPGME_KEYLIST_MODE_WITH_KEYGRIP;
|
oldmode |= GPGME_KEYLIST_MODE_WITH_KEYGRIP;
|
||||||
}
|
}
|
||||||
|
if (newmodes & GpgME::WithSecret) {
|
||||||
|
oldmode |= GPGME_KEYLIST_MODE_WITH_SECRET;
|
||||||
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (newmodes & ~(GpgME::Local |
|
if (newmodes & ~(GpgME::Local |
|
||||||
GpgME::Extern |
|
GpgME::Extern |
|
||||||
@ -92,10 +95,11 @@ static inline gpgme_keylist_mode_t add_to_gpgme_keylist_mode_t(unsigned int oldm
|
|||||||
GpgME::Validate |
|
GpgME::Validate |
|
||||||
GpgME::Ephemeral |
|
GpgME::Ephemeral |
|
||||||
GpgME::WithTofu |
|
GpgME::WithTofu |
|
||||||
GpgME::WithKeygrip)) {
|
GpgME::WithKeygrip |
|
||||||
|
GpgME::WithSecret)) {
|
||||||
//std::cerr << "GpgME::Context: keylist mode must be one of Local, "
|
//std::cerr << "GpgME::Context: keylist mode must be one of Local, "
|
||||||
//"Extern, Signatures, SignatureNotations, Validate, Ephemeral, WithTofu, "
|
//"Extern, Signatures, SignatureNotations, Validate, Ephemeral, WithTofu, "
|
||||||
//"WithKeygrip, or a combination thereof!" << std::endl;
|
//"WithKeygrip, WithSecret, or a combination thereof!" << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return static_cast<gpgme_keylist_mode_t>(oldmode);
|
return static_cast<gpgme_keylist_mode_t>(oldmode);
|
||||||
@ -116,6 +120,9 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
|
|||||||
if (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS) {
|
if (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS) {
|
||||||
result |= GpgME::SignatureNotations;
|
result |= GpgME::SignatureNotations;
|
||||||
}
|
}
|
||||||
|
if (mode & GPGME_KEYLIST_MODE_WITH_SECRET) {
|
||||||
|
result |= GpgME::WithSecret;
|
||||||
|
}
|
||||||
if (mode & GPGME_KEYLIST_MODE_WITH_TOFU) {
|
if (mode & GPGME_KEYLIST_MODE_WITH_TOFU) {
|
||||||
result |= GpgME::WithTofu;
|
result |= GpgME::WithTofu;
|
||||||
}
|
}
|
||||||
@ -133,6 +140,7 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
|
|||||||
GPGME_KEYLIST_MODE_EXTERN |
|
GPGME_KEYLIST_MODE_EXTERN |
|
||||||
GPGME_KEYLIST_MODE_SIGS |
|
GPGME_KEYLIST_MODE_SIGS |
|
||||||
GPGME_KEYLIST_MODE_SIG_NOTATIONS |
|
GPGME_KEYLIST_MODE_SIG_NOTATIONS |
|
||||||
|
GPGME_KEYLIST_MODE_WITH_SECRET |
|
||||||
GPGME_KEYLIST_MODE_WITH_TOFU |
|
GPGME_KEYLIST_MODE_WITH_TOFU |
|
||||||
GPGME_KEYLIST_MODE_WITH_KEYGRIP |
|
GPGME_KEYLIST_MODE_WITH_KEYGRIP |
|
||||||
GPGME_KEYLIST_MODE_EPHEMERAL |
|
GPGME_KEYLIST_MODE_EPHEMERAL |
|
||||||
|
Loading…
Reference in New Issue
Block a user