security: Update Signature abstraction to match 0.1.1 spec

This commit removes intermediate SignatureWithPublicKey data
structure.  All uses of such data structure should be replaced with just
Signature and check that KeyLocator is present (hasKeyLocator()).

Change-Id: I1157e05c6a717ea28df91c4bfd76c7145b520a15
Refs: #1750
diff --git a/src/security/sec-rule-relative.cpp b/src/security/sec-rule-relative.cpp
index 6350fd5..42272bc 100644
--- a/src/security/sec-rule-relative.cpp
+++ b/src/security/sec-rule-relative.cpp
@@ -59,8 +59,14 @@
   Name dataName = data.getName();
   try
     {
-      SignatureWithPublicKey sig(data.getSignature());
-      Name signerName = sig.getKeyLocator().getName();
+      if (!data.getSignature().hasKeyLocator())
+        return false;
+
+      const KeyLocator& keyLocator = data.getSignature().getKeyLocator();
+      if (keyLocator.getType() != KeyLocator::KeyLocator_Name)
+        return false;
+
+      const Name& signerName = keyLocator.getName();
       return satisfy(dataName, signerName);
     }
   catch (Tlv::Error& e)
@@ -104,8 +110,14 @@
 {
   try
     {
-      SignatureWithPublicKey sig(data.getSignature());
-      Name signerName = sig.getKeyLocator().getName();
+      if (!data.getSignature().hasKeyLocator())
+        return false;
+
+      const KeyLocator& keyLocator = data.getSignature().getKeyLocator();
+      if (keyLocator.getType() != KeyLocator::KeyLocator_Name)
+        return false;
+
+      const Name& signerName = keyLocator.getName();
       return m_signerNameRegex.match(signerName);
     }
   catch (Tlv::Error& e)