XMLSignatureSigningStage's includeX509SubjectName property causes exception

Description

I suspect, from examination of the code, that the XMLSignatureSigningStage's includeX509SubjectName property doesn't do anything, and may cause a run-time error.

This is because it adds a String (the the subject name in a particular format) to the array of KeyInfo items to be added to the signature:

keyInfoItems is a List<Object>. which works with the Java 8 API (expects a raw List) but the contract actually corresponds to a List<XMLStructure> and is so represented in Java 9.

Either the string needs to be turned into an appropriate XMLStructure subtype, or it should actually be added to the x509Data as the other elements in this method are.

There is no unit test for this case, which is probably how we should start out.

Environment

None

Activity

Ian YoungOctober 5, 2017 at 10:48 AM

Fixed in commit 77b102d7c162468df96cfc4a6fc85e79a6691f10.

Ian YoungOctober 4, 2017 at 5:18 PM

Confirmed that setting the includeX509SubjectName property causes an exception under Java 8:

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Created October 4, 2017 at 5:02 PM
Updated May 16, 2024 at 12:37 PM
Resolved October 5, 2017 at 10:48 AM