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