42 :
Data(std::move(data))
45 NDN_THROW(
Error(
"Certificate name does not follow the naming conventions"));
122 os <<
"Certificate Name:\n"
123 <<
" " << cert.
getName() <<
"\n";
127 os <<
"Additional Description:\n";
130 for (
const auto& item : additionalDesc) {
131 os <<
" " << item.first <<
": " << item.second <<
"\n";
135 using namespace transform;
141 os <<
"Public Key:\n";
143 using namespace transform;
149 os << key.getKeySize() <<
"-bit " << key.getKeyType();
151 catch (
const std::runtime_error&) {
152 os <<
"Unknown (" << cert.
getPublicKey().size() <<
" bytes)";
172 os <<
"Signature Information:\n"
177 os <<
" Key Locator: " << *keyLoc <<
"\n";
179 os <<
" Self-Signed: yes\n";
190 NDN_THROW(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` "
191 "does not respect the naming conventions"));
201 NDN_THROW(std::invalid_argument(
"Certificate name `" + certName.
toUri() +
"` "
202 "does not respect the naming conventions"));
Represents a TLV element of the NDN packet format.
Represents a Data packet.
int32_t getSignatureType() const noexcept
Get the SignatureType.
time::milliseconds getFreshnessPeriod() const noexcept
Return the value of FreshnessPeriod.
Data & setFreshnessPeriod(time::milliseconds freshnessPeriod)
Set the FreshnessPeriod.
uint32_t getContentType() const noexcept
Return the value of ContentType.
const SignatureInfo & getSignatureInfo() const noexcept
Get the SignatureInfo element.
const Name & getName() const noexcept
Get the Data name.
std::optional< KeyLocator > getKeyLocator() const noexcept
Get the KeyLocator element.
Data & setContentType(uint32_t type)
Set the ContentType.
Represents an absolute name.
PartialName getPrefix(ssize_t nComponents) const
Returns a prefix of the name.
size_t size() const noexcept
Returns the number of components.
const Component & at(ssize_t i) const
Returns an immutable reference to the component at the specified index, with bounds checking.
void toUri(std::ostream &os, name::UriFormat format=name::UriFormat::DEFAULT) const
Write URI representation of the name to the output stream.
security::ValidityPeriod getValidityPeriod() const
Get the ValidityPeriod element.
std::optional< Block > getCustomTlv(uint32_t type) const
Get first custom TLV element with the specified TLV-TYPE.
Represents a name component.
Represents an AdditionalDescription TLV element.
Represents an NDN certificate.
name::Component getIssuerId() const
Get issuer ID.
span< const uint8_t > getPublicKey() const noexcept
Return the public key as a DER-encoded SubjectPublicKeyInfo structure, i.e., exactly as it appears in...
Name getKeyName() const
Get key name.
Name getIdentity() const
Get identity name.
static constexpr ssize_t KEY_COMPONENT_OFFSET
name::Component getKeyId() const
Get key ID.
bool isValid(const time::system_clock::time_point &ts=time::system_clock::now()) const
Check if the certificate is valid at ts.
ValidityPeriod getValidityPeriod() const
Get validity period of the certificate.
static constexpr ssize_t ISSUER_ID_OFFSET
static constexpr ssize_t KEY_ID_OFFSET
static const name::Component KEY_COMPONENT
static bool isValidName(const Name &certName)
Check if the specified name respects the naming conventions for certificates.
static constexpr size_t MIN_CERT_NAME_LENGTH
Block getExtension(uint32_t type) const
Get extension with TLV type.
Represents a ValidityPeriod TLV element.
std::pair< time::system_clock::time_point, time::system_clock::time_point > getPeriod() const
Get the stored validity period.
bool isValid(const time::system_clock::time_point &now=time::system_clock::now()) const
Check if now falls within the validity period.
::boost::chrono::time_point< system_clock > time_point
Represents an error in TLV encoding or decoding.
Output to stream with specified indent or prefix.
std::string to_string(const errinfo_stacktrace &x)
Contains the ndn-cxx security framework.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
Name extractIdentityFromCertName(const Name &certName)
Extract identity namespace from the certificate name certName.
Name extractKeyNameFromCertName(const Name &certName)
Extract key name from the certificate name certName.
std::string toIsoExtendedString(const system_clock::time_point &timePoint)
Convert to the ISO 8601 string representation, extended format (YYYY-MM-DDTHH:MM:SS,...
@ ContentType_Key
public key, certificate
SignatureTypeValue
SignatureType values.