security+tools: Allow user to explicitly specify the cert name prefix before 'KEY' component in ndnsec-certgen

Change-Id: I71e137e89b5ab0cd5db7001b39ff76c22a448bd2
Refs: #1659
diff --git a/tests/unit-tests/security/test-keychain.cpp b/tests/unit-tests/security/test-keychain.cpp
index 9a2300d..1149dce 100644
--- a/tests/unit-tests/security/test-keychain.cpp
+++ b/tests/unit-tests/security/test-keychain.cpp
@@ -163,6 +163,15 @@
   BOOST_CHECK(idCert->getName().getPrefix(5) ==
               Name().append(identity).append("KEY").append("Lower"));
 
+  shared_ptr<IdentityCertificate> idCert11 =
+    keyChain.prepareUnsignedIdentityCertificate(lowerKeyName, identity,
+                                                time::system_clock::now(),
+                                                time::system_clock::now() + time::days(365),
+                                                subjectDescription,
+                                                lowerIdentity);
+  BOOST_CHECK(static_cast<bool>(idCert11));
+  BOOST_CHECK(idCert11->getName().getPrefix(6) ==
+              Name().append(lowerIdentity).append("KEY"));
 
   Name anotherIdentity("/TestKeyChain/PrepareIdentityCertificate/Another/");
   anotherIdentity.appendVersion();