security: Added IdentityCertificate::certificateNameToPublicKeyName and use it in signByCertificate so that it doesn't t need to retrieve the certificate just to get the key name.
diff --git a/include/ndn-cpp/security/certificate/identity-certificate.hpp b/include/ndn-cpp/security/certificate/identity-certificate.hpp
index d111acc..7ce95f9 100644
--- a/include/ndn-cpp/security/certificate/identity-certificate.hpp
+++ b/include/ndn-cpp/security/certificate/identity-certificate.hpp
@@ -49,6 +49,14 @@
static bool
isIdentityCertificate(const Certificate& certificate);
+ /**
+ * Get the public key name from the full certificate name.
+ * @param certificateName The full certificate name.
+ * @return The related public key name.
+ */
+ static Name
+ certificateNameToPublicKeyName(const Name& certificateName);
+
private:
static bool
isCorrectName(const Name& name);