NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
certificate-subject-description.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
certificate-subject-description.hpp
"
27
28
#include "
cryptopp.hpp
"
29
30
namespace
ndn
{
31
namespace
security
{
32
namespace
v1 {
33
34
void
35
CertificateSubjectDescription::encode
(CryptoPP::BufferedTransformation& out)
const
36
{
37
using namespace
CryptoPP
;
38
// RelativeDistinguishedName ::=
39
// SET OF AttributeTypeAndValue
40
//
41
// AttributeTypeAndValue ::= SEQUENCE {
42
// type AttributeType,
43
// value AttributeValue }
44
//
45
// AttributeType ::= OBJECT IDENTIFIER
46
//
47
// AttributeValue ::= ANY DEFINED BY AttributeType
48
DERSequenceEncoder attributeTypeAndValue(out);
49
{
50
m_oid.encode(attributeTypeAndValue);
51
DEREncodeTextString(attributeTypeAndValue, m_value, PRINTABLE_STRING);
52
}
53
attributeTypeAndValue.MessageEnd();
54
}
55
56
void
57
CertificateSubjectDescription::decode
(CryptoPP::BufferedTransformation& in)
58
{
59
using namespace
CryptoPP
;
60
// RelativeDistinguishedName ::=
61
// SET OF AttributeTypeAndValue
62
//
63
// AttributeTypeAndValue ::= SEQUENCE {
64
// type AttributeType,
65
// value AttributeValue }
66
//
67
// AttributeType ::= OBJECT IDENTIFIER
68
//
69
// AttributeValue ::= ANY DEFINED BY AttributeType
70
71
BERSequenceDecoder attributeTypeAndValue(in);
72
{
73
m_oid.decode(attributeTypeAndValue);
74
77
BERDecodeTextString(attributeTypeAndValue, m_value, PRINTABLE_STRING);
78
}
79
attributeTypeAndValue.MessageEnd();
80
}
81
82
}
// namespace v1
83
}
// namespace security
84
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
CryptoPP
Copyright (c) 2013-2016 Regents of the University of California.
Definition:
oid.hpp:29
certificate-subject-description.hpp
ndn::security::v1::CertificateSubjectDescription::encode
void encode(CryptoPP::BufferedTransformation &out) const
Definition:
certificate-subject-description.cpp:35
cryptopp.hpp
ndn::security::v1::CertificateSubjectDescription::decode
void decode(CryptoPP::BufferedTransformation &in)
Definition:
certificate-subject-description.cpp:57
security
ndnSIM
ndn-cxx
src
security
v1
certificate-subject-description.cpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13