aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/key.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src/key.cpp')
-rw-r--r--lang/cpp/src/key.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp
index 8fc266ff..0d272926 100644
--- a/lang/cpp/src/key.cpp
+++ b/lang/cpp/src/key.cpp
@@ -1033,6 +1033,26 @@ time_t Key::lastUpdate() const
return static_cast<time_t>(key ? key->last_update : 0);
}
+bool Key::isBad() const
+{
+ return isNull() || isRevoked() || isExpired() || isDisabled() || isInvalid();
+}
+
+bool Subkey::isBad() const
+{
+ return isNull() || isRevoked() || isExpired() || isDisabled() || isInvalid();
+}
+
+bool UserID::isBad() const
+{
+ return isNull() || isRevoked() || isInvalid();
+}
+
+bool UserID::Signature::isBad() const
+{
+ return isNull() || isExpired() || isInvalid();
+}
+
std::ostream &operator<<(std::ostream &os, const UserID &uid)
{
os << "GpgME::UserID(";