In Signature, make digestAlgorithm, witness and signature a Blob.
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 387d291..0fb13d6 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -14,19 +14,19 @@
{
signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
if (digestAlgorithm_.size() > 0)
- signatureStruct.digestAlgorithm = (unsigned char *)&digestAlgorithm_[0];
+ signatureStruct.digestAlgorithm = (unsigned char *)digestAlgorithm_.buf();
else
signatureStruct.digestAlgorithm = 0;
signatureStruct.witnessLength = witness_.size();
if (witness_.size() > 0)
- signatureStruct.witness = (unsigned char *)&witness_[0];
+ signatureStruct.witness = (unsigned char *)witness_.buf();
else
signatureStruct.witness = 0;
signatureStruct.signatureLength = signature_.size();
if (signature_.size() > 0)
- signatureStruct.signature = (unsigned char *)&signature_[0];
+ signatureStruct.signature = (unsigned char *)signature_.buf();
else
signatureStruct.signature = 0;
@@ -36,9 +36,9 @@
void Signature::set(const struct ndn_Signature& signatureStruct)
{
- setVector(digestAlgorithm_, signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
- setVector(witness_, signatureStruct.witness, signatureStruct.witnessLength);
- setVector(signature_, signatureStruct.signature, signatureStruct.signatureLength);
+ digestAlgorithm_ = Blob(signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
+ witness_ = Blob(signatureStruct.witness, signatureStruct.witnessLength);
+ signature_ = Blob(signatureStruct.signature, signatureStruct.signatureLength);
publisherPublicKeyDigest_.set(signatureStruct.publisherPublicKeyDigest);
keyLocator_.set(signatureStruct.keyLocator);
}