#include <certificate.hpp>
Data Structures | |
class | Error |
Public Types | |
typedef std::vector< CertificateSubjectDescription > | SubjectDescriptionList |
typedef std::vector< CertificateExtension > | ExtensionList |
Public Member Functions | |
Certificate () | |
The default constructor. More... | |
Certificate (const Data &data) | |
Create a Certificate from the content in the data packet. More... | |
Certificate (const Block &block) | |
Create a Certificate from the a block. More... | |
virtual | ~Certificate () |
void | wireDecode (const Block &wire) |
void | encode () |
encode certificate info into content More... | |
void | addSubjectDescription (const CertificateSubjectDescription &description) |
Add a subject description. More... | |
const SubjectDescriptionList & | getSubjectDescriptionList () const |
SubjectDescriptionList & | getSubjectDescriptionList () |
void | addExtension (const CertificateExtension &extension) |
Add a certificate extension. More... | |
const ExtensionList & | getExtensionList () const |
ExtensionList & | getExtensionList () |
void | setNotBefore (const time::system_clock::TimePoint ¬Before) |
time::system_clock::TimePoint & | getNotBefore () |
const time::system_clock::TimePoint & | getNotBefore () const |
void | setNotAfter (const time::system_clock::TimePoint ¬After) |
time::system_clock::TimePoint & | getNotAfter () |
const time::system_clock::TimePoint & | getNotAfter () const |
void | setPublicKeyInfo (const PublicKey &key) |
PublicKey & | getPublicKeyInfo () |
const PublicKey & | getPublicKeyInfo () const |
bool | isTooEarly () |
Check if the certificate is valid. More... | |
bool | isTooLate () |
Check if the certificate is valid. More... | |
void | printCertificate (std::ostream &os, const std::string &indent="") const |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to a wire format. More... | |
const Block & | wireEncode (EncodingBuffer &encoder, const Block &signatureValue) const |
Finalize Data packet encoding with the specified SignatureValue. More... | |
bool | hasWire () const |
Check if Data is already has wire encoding. More... | |
const Name & | getName () const |
Get name of the Data packet. More... | |
Data & | setName (const Name &name) |
Set name to a copy of the given Name. More... | |
const Name & | getFullName () const |
Get full name of Data packet, including the implicit digest. More... | |
const MetaInfo & | getMetaInfo () const |
Get MetaInfo block from Data packet. More... | |
Data & | setMetaInfo (const MetaInfo &metaInfo) |
Set metaInfo to a copy of the given MetaInfo. More... | |
uint32_t | getContentType () const |
Data & | setContentType (uint32_t type) |
const time::milliseconds & | getFreshnessPeriod () const |
Data & | setFreshnessPeriod (const time::milliseconds &freshnessPeriod) |
const name::Component & | getFinalBlockId () const |
Data & | setFinalBlockId (const name::Component &finalBlockId) |
const Block & | getContent () const |
Get content Block. More... | |
Data & | setContent (const uint8_t *buffer, size_t bufferSize) |
Set the content from the buffer (buffer will be copied) More... | |
Data & | setContent (const Block &block) |
Set the content from the block. More... | |
Data & | setContent (const ConstBufferPtr &contentValue) |
Set the content from the pointer to immutable buffer. More... | |
const Signature & | getSignature () const |
Data & | setSignature (const Signature &signature) |
Set the signature to a copy of the given signature. More... | |
Data & | setSignatureValue (const Block &value) |
bool | operator== (const Data &other) const |
bool | operator!= (const Data &other) const |
template<typename T > | |
shared_ptr< T > | getTag () const |
get a tag item More... | |
template<typename T > | |
void | setTag (shared_ptr< T > tag) const |
set a tag item More... | |
template<typename T > | |
void | removeTag () const |
remove tag item More... | |
Protected Member Functions | |
void | decode () |
void | onChanged () |
Clear the wire encoding. More... | |
Protected Attributes | |
SubjectDescriptionList | m_subjectDescriptionList |
time::system_clock::TimePoint | m_notBefore |
time::system_clock::TimePoint | m_notAfter |
PublicKey | m_key |
ExtensionList | m_extensionList |
Definition at line 39 of file v1/certificate.hpp.
typedef std::vector<CertificateExtension> ndn::security::v1::Certificate::ExtensionList |
Definition at line 53 of file v1/certificate.hpp.
typedef std::vector<CertificateSubjectDescription> ndn::security::v1::Certificate::SubjectDescriptionList |
Definition at line 52 of file v1/certificate.hpp.
ndn::security::v1::Certificate::Certificate | ( | ) |
The default constructor.
Definition at line 45 of file v1/certificate.cpp.
|
explicit |
Create a Certificate from the content in the data packet.
data | The data packet with the content to decode. |
Definition at line 51 of file v1/certificate.cpp.
|
explicit |
Create a Certificate from the a block.
block | The raw block of the certificate |
Definition at line 58 of file v1/certificate.cpp.
|
virtual |
Definition at line 64 of file v1/certificate.cpp.
|
inline |
Add a certificate extension.
extension | the extension to be added |
Definition at line 113 of file v1/certificate.hpp.
|
inline |
Add a subject description.
description | The description to be added. |
Definition at line 91 of file v1/certificate.hpp.
|
protected |
Definition at line 197 of file v1/certificate.cpp.
void ndn::security::v1::Certificate::encode | ( | ) |
encode certificate info into content
Definition at line 94 of file v1/certificate.cpp.
|
inherited |
|
inlineinherited |
|
inline |
Definition at line 119 of file v1/certificate.hpp.
|
inline |
Definition at line 125 of file v1/certificate.hpp.
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 155 of file v1/certificate.hpp.
|
inline |
Definition at line 161 of file v1/certificate.hpp.
|
inline |
Definition at line 137 of file v1/certificate.hpp.
|
inline |
Definition at line 143 of file v1/certificate.hpp.
|
inline |
Definition at line 173 of file v1/certificate.hpp.
|
inline |
Definition at line 179 of file v1/certificate.hpp.
|
inlineinherited |
|
inline |
Definition at line 97 of file v1/certificate.hpp.
|
inline |
Definition at line 103 of file v1/certificate.hpp.
|
inlineinherited |
get a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
nullptr | if no Tag of type T is stored |
Definition at line 67 of file tag-host.hpp.
|
inlineinherited |
bool ndn::security::v1::Certificate::isTooEarly | ( | ) |
Check if the certificate is valid.
Definition at line 76 of file v1/certificate.cpp.
bool ndn::security::v1::Certificate::isTooLate | ( | ) |
Check if the certificate is valid.
Definition at line 85 of file v1/certificate.cpp.
|
protectedinherited |
|
inherited |
|
inherited |
void ndn::security::v1::Certificate::printCertificate | ( | std::ostream & | os, |
const std::string & | indent = "" |
||
) | const |
Definition at line 269 of file v1/certificate.cpp.
|
inlineinherited |
remove tag item
Definition at line 94 of file tag-host.hpp.
|
inherited |
Set the content from the block.
Depending on type of the supplied block, there are two cases:
block | The Block containing the content to assign |
|
inherited |
Set the content from the pointer to immutable buffer.
This method will create a Block with tlv::Content and set contentValue as a payload for this block. Note that this method is very different from setContent(const Block&), since it does not require that payload should be a valid TLV element.
contentValue | The pointer to immutable buffer containing the content to assign |
|
inherited |
|
inherited |
|
inherited |
|
inline |
Definition at line 149 of file v1/certificate.hpp.
|
inline |
Definition at line 131 of file v1/certificate.hpp.
|
inline |
Definition at line 167 of file v1/certificate.hpp.
|
inlineinherited |
set a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 80 of file tag-host.hpp.
void ndn::security::v1::Certificate::wireDecode | ( | const Block & | wire | ) |
Definition at line 69 of file v1/certificate.cpp.
|
inherited |
Fast encoding or block size estimation.
encoder | EncodingEstimator or EncodingBuffer instance |
wantUnsignedPortionOnly | Request only unsigned portion to be encoded in block. If true, only Name, MetaInfo, Content, and SignatureInfo blocks will be encoded into the block. Note that there will be no outer TLV header of the Data packet. |
|
inherited |
|
inherited |
Finalize Data packet encoding with the specified SignatureValue.
encoder | EncodingBuffer instance, containing Name, MetaInfo, Content, and SignatureInfo (without outer TLV header of the Data packet). |
signatureValue | SignatureValue block to be added to Data packet to finalize the wire encoding |
This method is intended to be used in concert with Data::wireEncode(EncodingBuffer&, true) method to optimize Data packet wire format creation:
Data data; ... EncodingBuffer encoder; data.wireEncode(encoder, true); ... Block signatureValue = <sign_over_unsigned_portion>(encoder.buf(), encoder.size()); data.wireEncode(encoder, signatureValue)
|
protected |
Definition at line 210 of file v1/certificate.hpp.
|
protected |
Definition at line 209 of file v1/certificate.hpp.
|
protected |
Definition at line 208 of file v1/certificate.hpp.
|
protected |
Definition at line 207 of file v1/certificate.hpp.
|
protected |
Definition at line 206 of file v1/certificate.hpp.