23 #ifndef NDN_VERIFICATION_HELPERS_HPP
24 #define NDN_VERIFICATION_HELPERS_HPP
26 #include "../interest.hpp"
27 #include "certificate/public-key.hpp"
28 #include "v2/certificate-v2.hpp"
51 (
const uint8_t* buffer,
size_t bufferLength,
const uint8_t* signature,
52 size_t signatureLength,
const PublicKey& publicKey,
53 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256);
67 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256)
71 publicKey, digestAlgorithm);
92 (
const uint8_t* buffer,
size_t bufferLength,
const uint8_t* signature,
93 size_t signatureLength,
const Blob& publicKeyDer,
94 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256);
113 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256)
117 publicKeyDer, digestAlgorithm);
135 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
157 (
const Data& data,
const Blob& publicKeyDer,
158 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
177 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
181 (data, certificate.
getPublicKey(), digestAlgorithm, wireFormat);
201 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
225 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
245 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
249 (interest, certificate.
getPublicKey(), digestAlgorithm, wireFormat);
266 (
const uint8_t* buffer,
size_t bufferLength,
const uint8_t* digest,
267 size_t digestLength, DigestAlgorithm digestAlgorithm);
279 (
const Blob& buffer,
const Blob& digest, DigestAlgorithm digestAlgorithm)
299 (
const Data& data, DigestAlgorithm digestAlgorithm,
317 (
const Interest& interest, DigestAlgorithm digestAlgorithm,
328 static ptr_lib::shared_ptr<Signature>
static bool verifyInterestDigest(const Interest &interest, DigestAlgorithm digestAlgorithm, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Verify the Interest packet using the digest algorithm, where the last two name components are the Sig...
Definition: verification-helpers.cpp:184
The VerificationHelpers class has static methods to verify signatures and digests.
Definition: verification-helpers.hpp:36
static bool verifyDataSignature(const Data &data, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Verify the Data packet using the public key.
Definition: verification-helpers.cpp:87
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
static bool verifyInterestSignature(const Interest &interest, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Verify the Interest packet using the public key, where the last two name components are the Signature...
Definition: verification-helpers.cpp:118
static bool verifySignature(const uint8_t *buffer, size_t bufferLength, const uint8_t *signature, size_t signatureLength, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256)
Verify the buffer against the signature using the public key.
Definition: verification-helpers.cpp:36
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
An Interest holds a Name and other fields for an interest.
Definition: interest.hpp:43
const uint8_t * buf() const
Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null...
Definition: blob.hpp:159
Definition: public-key.hpp:34
size_t size() const
Return the length of the immutable byte array.
Definition: blob.hpp:147
static bool verifyDigest(const uint8_t *buffer, size_t bufferLength, const uint8_t *digest, size_t digestLength, DigestAlgorithm digestAlgorithm)
Verify the buffer against the digest using the digest algorithm.
Definition: verification-helpers.cpp:154
const Blob & getPublicKey() const
Get the public key DER encoding.
Definition: certificate-v2.cpp:66
static bool verifyDataDigest(const Data &data, DigestAlgorithm digestAlgorithm, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Verify the Data packet using the digest algorithm.
Definition: verification-helpers.cpp:167