blob: 7f3af3fb3dcecdc483719620500b33c9e6a525fd [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
* Copyright (C) 2013 Regents of the University of California.
* @author: Yingdi Yu <yingdi@cs.ucla.edu>
* See COPYING for copyright and distribution information.
*/
#include "common.hpp"
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/face.hpp>
using namespace ndn;
int
main()
{
Name root("/ndn");
KeyChain keyChain("sqlite3", "file");
if(!keyChain.doesIdentityExist(root))
return 1;
Face face;
Name name("/local/ndn/prefix");
name.appendVersion().appendSegment(0);
Data data(name);
std::string prefix("/ndn/test");
data.setContent(reinterpret_cast<const uint8_t*>(prefix.c_str()), prefix.size());
keyChain.signByIdentity(data, root);
face.put(data);
face.getIoService().run();
}