blob: 3571f7fdb2e61d1963803092be04cdc64824b0e9 [file] [log] [blame]
Jeff Thompson958bf9b2013-10-12 17:20:51 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
6 * See COPYING for copyright and distribution information.
7 */
8
9#include "../../encoding/der/der.hpp"
10#include <ndn-cpp/security/certificate/certificate-subject-description.hpp>
11
12using namespace std;
Jeff Thompson958bf9b2013-10-12 17:20:51 -070013
14namespace ndn {
15
Jeff Thompsonce115762013-12-18 14:59:56 -080016ptr_lib::shared_ptr<der::DerNode>
Jeff Thompson61a25ff2013-12-20 10:40:04 -080017CertificateSubjectDescription::toDer() const
Jeff Thompson958bf9b2013-10-12 17:20:51 -070018{
Jeff Thompsonce115762013-12-18 14:59:56 -080019 ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence());
Jeff Thompson958bf9b2013-10-12 17:20:51 -070020
Jeff Thompsonce115762013-12-18 14:59:56 -080021 ptr_lib::shared_ptr<der::DerOid> oid(new der::DerOid(oid_));
22 ptr_lib::shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_));
Jeff Thompson958bf9b2013-10-12 17:20:51 -070023
24 root->addChild(oid);
25 root->addChild(value);
26
27 return root;
Jeff Thompson958bf9b2013-10-12 17:20:51 -070028}
29
30}