Jeff Thompson | 958bf9b | 2013-10-12 17:20:51 -0700 | [diff] [blame] | 1 | /* -*- 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 | |
| 12 | using namespace std; |
| 13 | using namespace ndn::ptr_lib; |
| 14 | |
| 15 | namespace ndn { |
| 16 | |
| 17 | shared_ptr<der::DerNode> |
| 18 | CertificateSubjectDescription::toDer() |
| 19 | { |
| 20 | shared_ptr<der::DerSequence> root(new der::DerSequence()); |
| 21 | |
| 22 | shared_ptr<der::DerOid> oid(new der::DerOid(oid_)); |
| 23 | shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_)); |
| 24 | |
| 25 | root->addChild(oid); |
| 26 | root->addChild(value); |
| 27 | |
| 28 | return root; |
Jeff Thompson | 958bf9b | 2013-10-12 17:20:51 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | } |