What is the signature of the sign method in the security API?
-
java.lang.String sign(java.lang.String data, java.lang.String key) throws EncryptionException
-
java.lang.String sign(java.lang.String data, java.lang.String key)
-
java.lang.String sign(java.lang.String data)
-
java.lang.String sign(java.lang.String data) throws SecurityException
The sign method takes a single String parameter (the data to be signed) and throws SecurityException if signing fails or security constraints are violated. The method does not require an explicit key parameter as the key is managed internally by the security API.
In this security API, sign(String data) takes a single argument and is declared to throw a runtime SecurityException if signing fails, rather than a checked EncryptionException. The two-argument overloads that also pass a key don't match this API's actual method signature, and a version with no throws clause misrepresents that the call can fail.