<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Dear all,</p>
    <p>I'm struggling with setting up a simple trust/security system in
      NDN. I find it difficult to find an updated set information that
      will work for all system components. Please correct me if I
      misunderstood something.<br>
    </p>
    <p>I have a very simple scenario: one producer and one consumer on
      one machine. I want to have a central entity (root) and a
      publisher (publisher) that will be allowed to publish trusted
      content.<br>
    </p>
    <p>I first create the root certificate using ndnsec and selfsign it:
      <i><br>
      </i></p>
    <p><i>    ndnsec-key-gen -n /root</i><i><br>
      </i></p>
    <p><i>    ndnsec-sign-req /root > root.cert</i></p>
    <p>Next I create a certificate for the publisher and sign it using
      the root certificate:<br>
    </p>
    <p><i>   ndnsec-key-gen -n /root/publisher >
        unsigned_publisher.cert</i><i><br>
      </i><i>   ndnsec-cert-gen -S 201510080000 -E 202010080000  -s
        /root -i /root/publisher -r unsigned_publisher.cert  >
        publisher.cert</i></p>
    <p><br>
    </p>
    <p>I then used the publisher identity to sign the data:</p>
    <p><i>    m_ident =
        m_keyChain.createIdentity(Name("/root/publisher"));</i><i><br>
      </i><i>    m_info = ndn::security::SigningInfo(m_ident);</i></p>
    <p><i>    m_keyChain.sign(*data, m_info);</i><br>
    </p>
    <p>On the consumer side I use a validator to validate data:</p>
    <p><i>    m_validator->load("sample.cfg");</i></p>
    <p><i>    m_validator->validate (data,</i><i><br>
      </i><i>            ndn::bind(&Consumer::onValidated, this,
        _1),</i><i><br>
      </i><i>            ndn::bind(&Consumer::onValidationFailed,
        this, _1, _2));</i></p>
    <p><br>
    </p>
    <p>I want to trust everything signed with the publishers key. The
      sample.cfg is:</p>
    <p><i>    rule</i><i><br>
      </i><i>    {</i><i><br>
      </i><i>      id "Sample Rule"</i><i><br>
      </i><i>      for data</i><i><br>
      </i><i>      filter</i><i><br>
      </i><i>      {</i><i><br>
      </i><i>        type name</i><i><br>
      </i><i>        name /root/publisher</i><i><br>
      </i><i>        relation is-prefix-of</i><i><br>
      </i><i>      }</i><i><br>
      </i><i>      checker</i><i><br>
      </i><i>      {</i><i><br>
      </i><i>        type hierarchical</i><i><br>
      </i><i>        sig-type rsa-sha256</i><i><br>
      </i><i>      }</i><i><br>
      </i><i>    }</i><i><br>
      </i><i><br>
      </i><i>    trust-anchor</i><i><br>
      </i><i>    {</i><i><br>
      </i><i>      type file</i><i><br>
      </i><i>      file-name "root.cert"</i><i><br>
      </i><i>    }</i><br>
    </p>
    <br>
    <p>Now, when I launch the consumer, it issues an interest, gets the
      data, issues another interest to get the key
      (/root/publisher/KEY/4%05i%7E%3C%F6%87%2F/%FD%00%00%01_%25%8Bz%80),
      but ends up with an error:</p>
    <p><i>    Malformed certificate (Name does not follow the naming
        convention for certificate). </i><br>
    </p>
    <p><br>
    </p>
    <p>My question is now, is it how I'm supposed to do this? If yes,
      what's the problem here? If not, is there any example tutorial,
      walking through the all steps of managing trust in NDN (ndnsec,
      app, validator)?</p>
    <p>Thanks in advance,</p>
    <p>Michał<br>
    </p>
  </body>
</html>