Task #3260
closedAdd GenericSignature for unrecognized signature type
0%
Description
When decoding a SignatureInfo, the library creates a subclass of Signature, such as Sha256WithRsaSignature. Right now, if the type of SignatureInfo is not recognized, the library throws a decoding exception. Instead, the library should create a GenericSignature (a new Signature subclass) which holds the encoding bytes so that the application can process it if possible. Likewise, the application can use GenericSignature to supply the encoding of a SignatureInfo unknown to the library.
Updated by Anonymous about 9 years ago
- Status changed from New to In Progress
Hello Andrew and Moreno. I added GenericSignature in the branch issue/3260-GenericSignature.
https://github.com/named-data/jndn/blob/issue/3260-GenericSignature/src/net/named_data/jndn/GenericSignature.java
I also added a unit test which gives a better idea how it is used:
https://github.com/named-data/jndn/blob/35d6602b4c0881e619ee21ac6f362457f2887362/tests/src/net/named_data/jndn/tests/unit_tests/TestDataMethods.java#L556
Please take a look and let me know what you think.
Updated by Andrew Brown almost 9 years ago
My apologies for losing track of this one. I reviewed and think this will work exactly like we need; if I understand the signature-info concept correctly, we encode all the bytes ourselves. Is the type code only for decoding then? Because your documentation makes it seem like only the signature-info blob matters.
Updated by Anonymous almost 9 years ago
Hi Andrew. Thanks for reviewing this. Yes, the type code is set when decoding the signature info. The setSignatureInfoEncoding method takes a typeCode parameter which is returned by getTypeCode(), but this is only "informational" for the application. The typeCode is not used when encoding the SignatureInfo (since the signature info encoding blob already has the type code). Is there something we could change to make this clearer?
Updated by Andrew Brown almost 9 years ago
No, it makes sense; I just wanted to confirm.
Updated by Anonymous over 8 years ago
- Status changed from In Progress to Closed
GenericSignature support is merged to master in all libraries.