27 #include "../../encoding/block-helpers.hpp" 28 #include "../../util/indented-stream.hpp" 29 #include "../transform.hpp" 57 BOOST_THROW_EXCEPTION(
Data::Error(
"Name does not follow the naming convention for certificate"));
60 BOOST_THROW_EXCEPTION(
Data::Error(
"ContentType is not KEY"));
63 BOOST_THROW_EXCEPTION(
Data::Error(
"FreshnessPeriod is not set"));
66 BOOST_THROW_EXCEPTION(
Data::Error(
"Content is empty"));
108 BOOST_THROW_EXCEPTION(
Data::Error(
"Content is empty"));
141 os <<
"Certificate name:\n";
142 os <<
" " << cert.
getName() <<
"\n";
151 os <<
"Additional Description:\n";
153 os <<
" " << item.first <<
": " << item.second <<
"\n";
160 os <<
"Public key bits:\n";
167 os <<
"Signature Information:\n";
172 os <<
" Key Locator: ";
175 os <<
"Self-Signed ";
177 os << keyLocator <<
"\n";
188 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` " 189 "does not follow the naming conventions"));
199 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` " 200 "does not follow the naming conventions"));
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix of the name.
Data & setContentType(uint32_t type)
Copyright (c) 2011-2015 Regents of the University of California.
static const ssize_t KEY_ID_OFFSET
std::string toUri() const
Get URI representation of the name.
The certificate following the certificate format naming convention.
const Name & getName() const
Get name.
Buffer getPublicKey() const
Get public key bits (in PKCS#8 format)
name::Component getIssuerId() const
Get issuer ID.
static const size_t MIN_KEY_NAME_LENGTH
const Block & getContent() const
Get Content.
Name getIdentity() const
Get identity name.
const Component & get(ssize_t i) const
Get the component at the given index.
Abstraction of AdditionalDescription.
Name extractKeyNameFromCertName(const Name &certName)
Extract key name from the certificate name certName.
const Block & getTypeSpecificTlv(uint32_t type) const
Get SignatureType-specific sub-element.
const Name & getName() const
get Name element
Represents a TLV element of NDN packet format.
bool isValid(const time::system_clock::TimePoint &now=time::system_clock::now()) const
Check if now falls within the validity period.
indicates KeyLocator contains a Name
bool hasKeyLocator() const
Check if KeyLocator exists in SignatureInfo.
static const size_t MIN_CERT_NAME_LENGTH
const Component & at(ssize_t i) const
Get the component at the given index.
tlv::SignatureTypeValue getType() const
Get SignatureType.
Abstraction of validity period.
const Signature & getSignature() const
Get Signature.
static const ssize_t KEY_COMPONENT_OFFSET
std::pair< time::system_clock::TimePoint, time::system_clock::TimePoint > getPeriod() const
Get the stored validity period.
static const ssize_t VERSION_OFFSET
Name getKeyName() const
Get key name.
Represents an absolute name.
std::string toIsoString(const system_clock::TimePoint &timePoint)
Convert to the ISO string representation of the time (YYYYMMDDTHHMMSS,fffffffff)
size_t size() const
Get number of components.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &other)
Represents a name component.
name::Component getKeyId() const
Get key ID.
static bool isValidName(const Name &certName)
Check if the specified name follows the naming convention for the certificate.
indicates content is a public key
static const name::Component KEY_COMPONENT
static const ssize_t ISSUER_ID_OFFSET
ValidityPeriod getValidityPeriod() const
Get validity period of the certificate.
a concept check for TLV abstraction with .wireEncode method
const KeyLocator & getKeyLocator() const
Get KeyLocator.
const SignatureInfo & getSignatureInfo() const
Get SignatureInfo.
time::milliseconds getFreshnessPeriod() const
Represents a Data packet.
const Block & getExtension(uint32_t type) const
Get extension with TLV type.
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
General-purpose automatically managed/resized buffer.
Output to stream with specified indent or prefix.
uint32_t getContentType() const
bool isValid(const time::system_clock::TimePoint &ts=time::system_clock::now()) const
Check if the certificate is valid at ts.
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
Name extractIdentityFromCertName(const Name &certName)
Extract identity namespace from the certificate name certName.