Closed GlassyYang closed 2 years ago
It seems like the
app_param
parameter ofexpress_interest
is a byte string, But I don't know how to generate the string. for instance, what kind of byte string can I use to produce the same interest packet as abovec++
code? The document on this aspect is very rare.
A byte string can be anything. The format is define by your application, not NDN. You can use Pickle, JSON, Protobuf, etc. If you prefer TLV encoding, you can use TlvModel class.
Also, the code you gave does not looks good: ExpirationPeriod is a type number defined by NFD. I suggest you use your application-defined type number instead of keeping synced with NFD. If you only want to send an CommandInterest, you may use ndn.app_support.nfd_mgmt package.
Another question is that it seems like user cannot customize their signature info.
No. SignatureInfo is delegated to the signer.
When I want to add timestamp and nonce to signature, I have to add some codes to
make_interest
:if signer is not None: interest.interest.signature_info = SignatureInfo() # code I added interest.interest.signature_info.signature_time = timestamp() interest.interest.signature_info.signature_nonce = gen_nonce()
Sorry about this. Currently we have not settled down which one to use, and the default signer does not write any. You may modify the signer (or write one yourself) to generate these info. But you also need a corresponding validator to check, because otherwise they don't make any effect. AFAIK Currently existing NDN software (like vector sync) does not make use of these fields.
I use
express_interest
sending an signed interest with customed signatureinfo. I want to add an applicatioin parameter to the interest, which is like the following code when usingncn-cxx
:It seems like the
app_param
parameter ofexpress_interest
is a byte string, But I don't know how to generate the string. for instance, what kind of byte string can I use to produce the same interest packet as abovec++
code? The document on this aspect is very rare.Another question is that it seems like user cannot customize their signature info. When I want to add timestamp and nonce to signature, I have to add some codes to
make_interest
: