Project

General

Profile

Actions

Task #3260

closed

Add GenericSignature for unrecognized signature type

Added by Anonymous over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
10/13/2015
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Anonymous over 8 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.

Actions #2

Updated by Andrew Brown about 8 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.

Actions #3

Updated by Anonymous about 8 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?

Actions #4

Updated by Andrew Brown about 8 years ago

No, it makes sense; I just wanted to confirm.

Actions #5

Updated by Anonymous about 8 years ago

  • Status changed from In Progress to Closed

GenericSignature support is merged to master in all libraries.

Actions

Also available in: Atom PDF