以下 man ページ gpg(1) の「HOW TO SPECIFY A USER ID」項から引用します。
By key Id.
This format is deduced from the length of the string and its content or 0x prefix. The key Id of an X.509 certificate are the low 64 bits of its SHA-1 fingerprint. The use of key Ids is just a shortcut, for all automated processing the fingerprint should be used.
When using gpg an exclamation mark (!) may be appended to force using the specified primary or secondary key and not to try and calculate which primary or secondary key to use.
The last four lines of the example give the key ID in their long form as internally used by the OpenPGP protocol. You can see the long key ID using the option --with-colons.
By fingerprint.
This format is deduced from the length of the string and its content or the 0x prefix. Note, that only the 20 byte version fingerprint is available with gpgsm (i.e. the SHA-1 hash of the certificate).
When using gpg an exclamation mark (!) may be appended to force using the specified primary or secondary key and not to try and calculate which primary or secondary key to use.
The best way to specify a key Id is by using the fingerprint. This avoids any ambiguities in case that there are duplicated key IDs.
「This format is deduced from the length of the string and its content or the 0x prefix.」とあるように、指定されたパラメータがキー ID またはフィンガープリントであるかは、特定の長さの16進数であるか、または明示的にプレフィックス 0x が指定されているかで判定されます。そのため、サフィックス ! は必須ではないかと思われます。
Discussion
以下 man ページ gpg(1) の「HOW TO SPECIFY A USER ID」項から引用します。
「This format is deduced from the length of the string and its content or the 0x prefix.」とあるように、指定されたパラメータがキー ID またはフィンガープリントであるかは、特定の長さの16進数であるか、または明示的にプレフィックス
0xが指定されているかで判定されます。そのため、サフィックス!は必須ではないかと思われます。実際、ソースコードを見てみると16進数の長さで条件分岐していました。
0xもほかの&などのプレフィックスとは違い、必須ではないようです。また、
!を付けない場合は、セカンダリキーを指定してもそれのプライマリキーに紐づく署名可能なキーが自動的に選択されるようです。したがって、単にプライマリキーとセカンダリキーのセット全体を指定したい場合はプライマリキーのフィンガープリントを!無しで指定し、特定のセカンダリキーの使用を強制したい場合は!を付けるのが良さそうです。