35 BOOST_CONCEPT_ASSERT((WireEncodable<Certificate>));
36 BOOST_CONCEPT_ASSERT((WireDecodable<Certificate>));
138 return (certName.
size() >= Certificate::MIN_CERT_NAME_LENGTH &&
145 os <<
"Certificate name:\n";
146 os <<
" " << cert.
getName() <<
"\n";
154 if (additionalDescription) {
155 os <<
"Additional Description:\n";
157 os <<
" " << item.first <<
": " << item.second <<
"\n";
161 os <<
"Public key bits:\n";
163 using namespace transform;
168 os <<
"Signature Information:\n";
174 os <<
" Key Locator: ";
176 os <<
"Self-Signed ";
178 os << *keyLoc <<
"\n";
189 NDN_THROW(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` " 190 "does not respect the naming conventions"));
193 return certName.
getPrefix(Certificate::KEY_COMPONENT_OFFSET);
200 NDN_THROW(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` " 201 "does not respect the naming conventions"));
204 return certName.
getPrefix(Certificate::KEY_ID_OFFSET + 1);
PartialName getPrefix(ssize_t nComponents) const
Returns a prefix of the name.
Data & setContentType(uint32_t type)
static const ssize_t KEY_ID_OFFSET
The certificate following the certificate format naming convention.
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
std::string to_string(const T &val)
Name getIdentity() const
Get identity name.
const Component & get(ssize_t i) const
Returns an immutable reference to the component at the specified index.
Abstraction of AdditionalDescription.
Name extractKeyNameFromCertName(const Name &certName)
Extract key name from the certificate name certName.
Represents a TLV element of the NDN packet format.
optional< KeyLocator > getKeyLocator() const noexcept
Get KeyLocator.
bool isValid(const time::system_clock::TimePoint &now=time::system_clock::now()) const
Check if now falls within the validity period.
static const size_t MIN_CERT_NAME_LENGTH
optional< Block > getCustomTlv(uint32_t type) const
Get first custom TLV element with the specified TLV-TYPE.
const Component & at(ssize_t i) const
Returns an immutable reference to the component at the specified index, with bounds checking...
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
int32_t getSignatureType() const noexcept
Get SignatureType.
Abstraction of validity period.
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.
const Name & getName() const noexcept
Get name.
Represents an absolute name.
std::string toIsoString(const system_clock::TimePoint &timePoint)
Convert to the ISO string representation of the time (YYYYMMDDTHHMMSS,fffffffff)
SignatureTypeValue
SignatureType values.
size_t size() const
Returns the number of components.
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.
const Block & getContent() const noexcept
Get the Content element.
void toUri(std::ostream &os, name::UriFormat format=name::UriFormat::DEFAULT) const
Write URI representation of the name to the output stream.
static const name::Component KEY_COMPONENT
static const ssize_t ISSUER_ID_OFFSET
Block getExtension(uint32_t type) const
Get extension with TLV type.
ValidityPeriod getValidityPeriod() const
Get validity period of the certificate.
time::milliseconds getFreshnessPeriod() const
Represents a Data packet.
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.
const SignatureInfo & getSignatureInfo() const noexcept
Get SignatureInfo.
security::ValidityPeriod getValidityPeriod() const
Get ValidityPeriod.
Name extractIdentityFromCertName(const Name &certName)
Extract identity namespace from the certificate name certName.