tests: remove unused KeyChainFixture::makeCert()
If similar functionality is needed in the future, KeyChain::makeCertificate() should be used instead. Change-Id: I918a957b70e1516db2b319bd0587d3daa62c18d1
This commit is contained in:
1 parent
f36375232f
commit
832d2300ee
2 files changed
+1
-35
No files matched your search
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <ndn-cxx/util/io.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
namespace ndn::tests {
|
||||
|
||||
@@ -40,30 +40,6 @@ KeyChainFixture::~KeyChainFixture()
|
||||
}
|
||||
}
|
||||
|
||||
Certificate
|
||||
KeyChainFixture::makeCert(const Key& key, const std::string& issuer, const Key& signingKey)
|
||||
{
|
||||
Certificate cert;
|
||||
cert.setName(Name(key.getName())
|
||||
.append(issuer)
|
||||
.appendVersion());
|
||||
|
||||
// set metainfo
|
||||
cert.setContentType(tlv::ContentType_Key);
|
||||
cert.setFreshnessPeriod(1_h);
|
||||
|
||||
// set content
|
||||
cert.setContent(key.getPublicKey());
|
||||
|
||||
// set signature info
|
||||
ndn::SignatureInfo info;
|
||||
auto now = time::system_clock::now();
|
||||
info.setValidityPeriod(ValidityPeriod(now - 30_days, now + 30_days));
|
||||
|
||||
m_keyChain.sign(cert, signingByKey(signingKey ? signingKey : key).setSignatureInfo(info));
|
||||
return cert;
|
||||
}
|
||||
|
||||
bool
|
||||
KeyChainFixture::saveCert(const Data& cert, const std::string& filename)
|
||||
{
|
||||
|
||||
@@ -39,16 +39,6 @@ protected:
|
||||
using Key = ndn::security::Key;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Creates and returns a certificate for a given key
|
||||
* @param key The key for which to make a certificate
|
||||
* @param issuer The IssuerId to include in the certificate name
|
||||
* @param signingKey The key with which to sign the certificate; if not provided, the
|
||||
* certificate will be self-signed
|
||||
*/
|
||||
Certificate
|
||||
makeCert(const Key& key, const std::string& issuer, const Key& signingKey = Key());
|
||||
|
||||
/**
|
||||
* @brief Saves an NDN certificate to a file
|
||||
* @return true if successful, false otherwise
|
||||
|
||||
Reference in new issue
Block a user