Is 5V 5A Battery Charging legal with USB and how to signal it?
However I have trouble understanding how to signal a portable device
it is connected to a DCP and it may draw up to 5A.

A PD (Portable Device) may not draw more than 1.5 A from DCP:

A legacy DCP can source up to 5A, true, but the voltage is not guaranteed. The 5 A limit is set for &quot;safety reasons&quot;. If the draw is above 1.5A, a DCP is allowed to shut down. Or it may have a continuous load curve as shown in &quot;blue&quot;:

You can make a charger that keeps VBUS=5V and source up to 5A, but no legacy (and legal) devices will make use of this power.

The goal is to build a 5V 5A power supply that will be able to supply
the maximum of 25W to a device.

This goal can be achieved only by using Power Delivery mechanisms using Type-C connector, and with electronic marker inside the Type-C overmold indicating the cable capability of 5A. To use this power, the PD must also have implemented the proper PD protocol. :-)