akmhoque | 66e6618 | 2014-02-21 17:56:03 -0600 | [diff] [blame^] | 1 | #include <ndn-cpp-dev/security/identity-certificate.hpp> |
| 2 | #include <ndn-cpp-dev/encoding/block.hpp> |
| 3 | #include "nlsr_km.hpp" |
| 4 | |
| 5 | namespace nlsr |
| 6 | { |
| 7 | void |
| 8 | KeyManager::initKeyManager(ConfParameter &cp) |
| 9 | { |
| 10 | ndn::Name identityName(cp.getRouterPrefix()+"/nlsr"); |
| 11 | kChain.deleteIdentity(identityName); |
| 12 | ndn::Name certName = kChain.createIdentity(identityName); |
| 13 | cout<<"Certificate Name: "<<certName.toUri()<<endl; |
| 14 | ndn::Name keyName= |
| 15 | ndn::IdentityCertificate::certificateNameToPublicKeyName(certName); |
| 16 | cout<<"Key Name: "<<keyName.toUri()<<endl; |
| 17 | } |
| 18 | |
| 19 | } |
| 20 | |
| 21 | |
| 22 | |