23 #ifndef NDN_CERTIFICATE_HPP
24 #define NDN_CERTIFICATE_HPP
26 #include "../../data.hpp"
27 #include "../../common.hpp"
29 #include "certificate-subject-description.hpp"
30 #include "certificate-extension.hpp"
31 #include "public-key.hpp"
35 typedef std::vector<CertificateSubjectDescription> SubjectDescriptionList;
36 typedef std::vector<CertificateExtension> ExtensionList;
83 const SubjectDescriptionList&
84 getSubjectDescriptionList()
const {
return subjectDescriptionList_; }
86 SubjectDescriptionList&
87 getSubjectDescriptionList() {
return subjectDescriptionList_; }
97 getExtensionList()
const {
return extensionList_; }
100 getExtensionList() {
return extensionList_; }
106 getNotBefore() {
return notBefore_; }
109 getNotBefore()
const {
return notBefore_; }
115 getNotAfter() {
return notAfter_; }
118 getNotAfter()
const {
return notAfter_; }
121 setPublicKeyInfo(
const PublicKey& key) { key_ = key; }
124 getPublicKeyInfo() {
return key_; }
127 getPublicKeyInfo()
const {
return key_; }
144 printCertificate(std::ostream& os)
const;
147 printCertificate()
const;
153 SubjectDescriptionList subjectDescriptionList_;
157 ExtensionList extensionList_;
160 ptr_lib::shared_ptr<DerNode>
Certificate()
The default constructor.
Definition: certificate.cpp:37
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
bool isTooEarly() const
Check if the certificate is valid.
Definition: certificate.cpp:55
void addSubjectDescription(const CertificateSubjectDescription &description)
Add a subject description.
Definition: certificate.hpp:81
A CertificateSubjectDescription represents the SubjectDescription entry in a Certificate.
Definition: certificate-subject-description.hpp:36
bool isTooLate() const
Check if the certificate is valid.
Definition: certificate.cpp:65
void encode()
Encode the contents of the certificate in DER format and set the Content and MetaInfo fields...
Definition: certificate.cpp:75
A CertificateExtension represents the Extension entry in a certificate.
Definition: certificate-extension.hpp:37
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:116
void addExtension(const CertificateExtension &extension)
Add a certificate extension.
Definition: certificate.hpp:94
virtual void wireDecode(const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Override to call the base class wireDecode then populate the certificate fields.
Definition: certificate.cpp:83
virtual ~Certificate()
The virtual destructor.
Definition: certificate.cpp:49
Definition: certificate.hpp:38