When I want to sign a message/file, the wallet (gui/cli/rpc) only asks for the message, so it is impossible to sign it with a subaddress.
When I verify the signature, I must insert the main address. If I insert a subaddress, the wallet cannot verify the signature.
It would useful to be able to send a signed message without linking it to one's account (main address). One could instead use a subaddress, so the receiver would anyway be sure that it was the owner of the subaddress to sign the message, but couldn't link it to the main address.
The uses would be the same that prompted the existence of subaddresses, i.e. to have distinct identities without having multiple wallets.
EDIT
After checking the code, not only it is possible with the cli but also with rpc, just not documented.
The additional parameters for the wallet rpc are:
- account_index
- address_index
- signature_type (string: "spend" or "view")
So it is impossible only with the gui.