37 verifySignature(
const uint8_t* blob,
size_t blobLen,
const uint8_t* sig,
size_t sigLen,
38 const v2::PublicKey& pKey)
53 verifySignature(
const uint8_t* data,
size_t dataLen,
const uint8_t* sig,
size_t sigLen,
54 const uint8_t* key,
size_t keyLen)
58 pKey.loadPkcs8(key, keyLen);
67 static std::tuple<bool, const uint8_t*, size_t, const uint8_t*, size_t>
71 return std::make_tuple(
true,
78 return std::make_tuple(
false,
nullptr, 0,
nullptr, 0);
82 static std::tuple<bool, const uint8_t*, size_t, const uint8_t*, size_t>
88 return std::make_tuple(
false,
nullptr, 0,
nullptr, 0);
93 return std::make_tuple(
true,
99 return std::make_tuple(
false,
nullptr, 0,
nullptr, 0);
104 verifySignature(
const std::tuple<bool, const uint8_t*, size_t, const uint8_t*, size_t>& params,
105 const v2::PublicKey& pKey)
107 bool isParsable =
false;
108 const uint8_t* buf =
nullptr;
110 const uint8_t* sig =
nullptr;
113 std::tie(isParsable, buf, bufLen, sig, sigLen) = params;
122 verifySignature(
const std::tuple<bool, const uint8_t*, size_t, const uint8_t*, size_t>& params,
123 const uint8_t* key,
size_t keyLen)
125 bool isParsable =
false;
126 const uint8_t* buf =
nullptr;
128 const uint8_t* sig =
nullptr;
131 std::tie(isParsable, buf, bufLen, sig, sigLen) = params;
190 verifyDigest(
const uint8_t* blob,
size_t blobLen,
const uint8_t* digest,
size_t digestLen,
204 if (result->size() != digestLen)
208 return CRYPTO_memcmp(result->buf(), digest, digestLen) == 0;
214 bool isParsable =
false;
215 const uint8_t* buf =
nullptr;
217 const uint8_t* sig =
nullptr;
220 std::tie(isParsable, buf, bufLen, sig, sigLen) =
parse(data);
223 return verifyDigest(buf, bufLen, sig, sigLen, algorithm);
233 bool isParsable =
false;
234 const uint8_t* buf =
nullptr;
236 const uint8_t* sig =
nullptr;
239 std::tie(isParsable, buf, bufLen, sig, sigLen) =
parse(interest);
242 return verifyDigest(buf, bufLen, sig, sigLen, algorithm);
const Name & getName() const
Copyright (c) 2013-2016 Regents of the University of California.
The certificate following the certificate format naming convention.
const size_t MIN_SIZE
minimal number of components for Signed Interest
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
const Block & getValue() const
Get SignatureValue in the wire format.
bool verifyDigest(const uint8_t *blob, size_t blobLen, const uint8_t *digest, size_t digestLen, DigestAlgorithm algorithm)
Verify blob against digest using algorithm.
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Fast encoding or block size estimation.
A frontend handle of a key instance.
size_t size() const
Get the number of components.
Use the SHA256 hash of the public key as the key id.
Name abstraction to represent an absolute name.
size_t value_size() const
const ssize_t POS_SIG_VALUE
const Buffer & getPublicKey() const
Get public key bits.
const Signature & getSignature() const
bool verifySignature(const uint8_t *blob, size_t blobLen, const uint8_t *sig, size_t sigLen, const v2::PublicKey &pKey)
Verify blob using key against sig.
shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
const Block & getContent() const
Get content Block.
static std::tuple< bool, const uint8_t *, size_t, const uint8_t *, size_t > parse(const Data &data)
const uint8_t * value() const
implements an output stream that constructs ndn::Buffer
shared_ptr< const Buffer > ConstBufferPtr
represents an error in TLV encoding or decoding