Error in sending/receiving parameters in Interest using setApplicationParameters
ERROR: ParametersSha256DigestComponent does not match the SHA-256 of Interest parameters
This behaviour is observed when using the method
interest.setApplicationParameters with non-empty Blob.
Meanwhile listening as a Java Server worked fine.
#1 Updated by Jeff Thompson 10 days ago
It looks like Cpp Server is written with ndn-cxx which is enforcing a check of the parameters.
Instead of setApplicationParameters, please try appendParametersDigestToName().
appendParametersDigestToName() was written according to the first spec of computing the Parameters digest. (From what I undersatand the spec is not finalized. I don't know which spec is used by your version of ndn-cxx.)
#3 Updated by Jeff Thompson 10 days ago
There have been many changes to ndn-cxx for ApplicationParameters since the last release. I'm still waiting for the new digest calculation spec to be finalized.
In the mean time, can you call
#5 Updated by Ritik kumar 9 days ago
#8 Updated by Jeff Thompson 9 days ago
Can you print the hex of the Received Block? I suspect that it is the entire TLV of the ApplicationParameters, including the type and length bytes 0x24 0x12. You need to use the correct ndn-cxx code to just get the value from the Received Block TLV.
Also, why do you use paramFromJson? The parameters are already encoded in a JSON string (of 16 bytes). You don't need to encode them again into a TLV. You can just put the JSON string as the value of the ApplicationParameters.
Blob blob = paramFromJson(jo.toString());
Blob blob = new Blob(jo.toString().getBytes());