[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/libkdenetwork/gpgmepp
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-04-21 12:16:08
Message-ID: 20040421121608.D6A1B9A5A () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Convenience method Key::isRoot() telling whether or not this key is a root certificate.


  M +5 -0      key.cpp   1.10
  M +7 -0      key.h   1.8


--- kdepim/libkdenetwork/gpgmepp/key.cpp  #1.9:1.10
@@ -194,4 +194,9 @@ namespace GpgME {
   }
 
+  bool Key::isRoot() const {
+    return d->key && d->key->subkeys && d->key->subkeys->fpr && d->key->chain_id &&
+      strcasecmp( d->key->subkeys->fpr, d->key->chain_id ) == 0;
+  }
+
   bool Key::canEncrypt() const {
     return d->key && d->key->can_encrypt;

--- kdepim/libkdenetwork/gpgmepp/key.h  #1.7:1.8
@@ -72,4 +72,11 @@ namespace GpgME {
     bool isSecret() const { return hasSecret(); }
 
+    /*!
+      @return true if this is a X.509 root certificate (currently
+      equivalent to something like
+      strcmp( chainID(), subkey(0).fingerprint() ) == 0 )
+    */
+    bool isRoot() const;
+
     enum OwnerTrust { Unknown=0, Undefined=1, Never=2,
                     Marginal=3, Full=4, Ultimate=5 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic